Commit Graph

101391 Commits

Author SHA1 Message Date
Chandler Carruth 1aef0c5621 Switch the VerifyDiagnosticsClient to use PresumedLocs now that they
exist. Cheat and do this by adding some wrappers around the PresumedLoc
machinery that directly return the line and column number.

llvm-svn: 126281
2011-02-23 00:47:48 +00:00
Richard Smith bb7dcf59a0 Update the www to indicate that auto is now implemented.
llvm-svn: 126280
2011-02-23 00:41:16 +00:00
Richard Smith 2abf6767e3 Fix PR9276: We were missing the checks for auto deducing to different types in the same declaration group in the template instantiation case.
llvm-svn: 126279
2011-02-23 00:37:57 +00:00
Greg Clayton 64195a2c8b Abtracted all mach-o and ELF out of ArchSpec. This patch is a modified form
of Stephen Wilson's idea (thanks for the input Stephen!). What I ended up
doing was:
- Got rid of ArchSpec::CPU (which was a generic CPU enumeration that mimics
  the contents of llvm::Triple::ArchType). We now rely upon the llvm::Triple 
  to give us the machine type from llvm::Triple::ArchType.
- There is a new ArchSpec::Core definition which further qualifies the CPU
  core we are dealing with into a single enumeration. If you need support for
  a new Core and want to debug it in LLDB, it must be added to this list. In
  the future we can allow for dynamic core registration, but for now it is
  hard coded.
- The ArchSpec can now be initialized with a llvm::Triple or with a C string
  that represents the triple (it can just be an arch still like "i386").
- The ArchSpec can still initialize itself with a architecture type -- mach-o
  with cpu type and subtype, or ELF with e_machine + e_flags -- and this will
  then get translated into the internal llvm::Triple::ArchSpec + ArchSpec::Core.
  The mach-o cpu type and subtype can be accessed using the getter functions:
  
  uint32_t
  ArchSpec::GetMachOCPUType () const;

  uint32_t
  ArchSpec::GetMachOCPUSubType () const;
  
  But these functions are just converting out internal llvm::Triple::ArchSpec 
  + ArchSpec::Core back into mach-o. Same goes for ELF.

All code has been updated to deal with the changes.

This should abstract us until later when the llvm::TargetSpec stuff gets
finalized and we can then adopt it.

llvm-svn: 126278
2011-02-23 00:35:02 +00:00
Jakob Stoklund Olesen 37de3235e5 Fix a bug in determining if there is only a single interfering register.
llvm-svn: 126277
2011-02-23 00:29:55 +00:00
Jakob Stoklund Olesen 6bd68cdffb Be more aggressive about evicting interference.
Use interval sizes instead of spill weights to determine if it is legal to evict
interference. A smaller interval can evict interference if all interfering live
ranges are larger.

Allow multiple interferences to be evicted as along as they are all larger than
the live range being allocated.

Spill weights are still used to select the preferred eviction candidate.

llvm-svn: 126276
2011-02-23 00:29:52 +00:00
Argyrios Kyrtzidis dd058d8a50 [analyzer] Migrate the BasicObjCFoundationChecks to CheckerV2:
NilArgChecker
	CFNumberCreateChecker
	ClassReleaseChecker

llvm-svn: 126275
2011-02-23 00:16:10 +00:00
Argyrios Kyrtzidis 22f2586bfb [analyzer] Fix CheckerManager::runCheckersForObjCMessage.
It would run PostObjCMessage checkers even for PreObjCMessage checking.

llvm-svn: 126274
2011-02-23 00:16:07 +00:00
Argyrios Kyrtzidis 9631dbe5ce Silence a MSVC warning.
llvm-svn: 126273
2011-02-23 00:16:04 +00:00
Argyrios Kyrtzidis a1540db6e4 [analyzer] Refactor BugTypes and their ownership model.
-In general, don't have the BugReporter deleting BugTypes, BugTypes will eventually become owned by checkers
 and outlive the BugReporter. In the meantime, there will be some leaks since some checkers assume that
 the BugTypes they create will be destroyed by the BugReporter.
-Have BugReporter::EmitBasicReport create BugTypes that are reused if the same name & category strings
 are passed to EmitBasicReport. These BugTypes are owned and destroyed by the BugReporter.
 This allows bugs reported through EmitBasicReport to be coalesced.
-Remove the llvm::FoldingSet<BugReportEquivClass> from BugType and move it into the BugReporter.
 For uniquing BugReportEquivClass also use the BugType* so that we can iterate over all of them using only one set.

llvm-svn: 126272
2011-02-23 00:16:01 +00:00
Johnny Chen 673badf292 Renamed macro definition of CPSR_C to be CPSR_C_POS to avoid confusions and subtle bugs.
llvm-svn: 126271
2011-02-23 00:15:56 +00:00
Argyrios Kyrtzidis b9abca0000 In the clang.xcodeproj modify the 'clang' target to do nothing, not try to build anything.
llvm-svn: 126270
2011-02-23 00:15:56 +00:00
Fariborz Jahanian 82ff1e52df Better parser recovery when method is
errornously defined inside an objc class. 
// rdar://7029784

llvm-svn: 126269
2011-02-23 00:11:21 +00:00
Richard Smith e97a53a446 DeclGroup's operator[] always returned the first Decl in the group.
llvm-svn: 126268
2011-02-23 00:09:59 +00:00
Johnny Chen 7deb7422bc Add emulation methods for "RSC (immediate)" and "RSC (register)" operations.
llvm-svn: 126267
2011-02-23 00:07:09 +00:00
Matt Beaumont-Gay 06de2553f3 Clean up the error recovery at the bottom of Sema::LookupMemberExpr. This
mostly just shuffles various possibilities for recovery into a more
straightforward order, but also unifies a couple of diagnostics.

llvm-svn: 126266
2011-02-22 23:52:53 +00:00
Johnny Chen 447c001048 Add emulation methods for "RSB (immediate)" and "RSB (register)".
Plus add missing break stmts for "case" blocks.

llvm-svn: 126265
2011-02-22 23:42:58 +00:00
David Greene 9a6040dc86 [AVX] General VUNPCKL codegen support.
llvm-svn: 126264
2011-02-22 23:31:46 +00:00
David Greene 5ec8236d9d Fix Builder::execute() to more properly pass the desired environment
to tools.

llvm-svn: 126263
2011-02-22 23:30:45 +00:00
Douglas Gregor 385d3fd97d When checking for abstract types, don't crash when we have a
FunctionProtoTypeLoc with NULL function parameter types, which can
occur in invalid code. Fixes PR9247 / <rdar://problem/9037911>.

llvm-svn: 126262
2011-02-22 23:21:06 +00:00
Fariborz Jahanian bb6db56028 Provide Fixit warning when 'auto' is intended as storage
specifier in legacy code. Patch is reviewed offline by Doug.
// rdar://9036633.

llvm-svn: 126261
2011-02-22 23:17:49 +00:00
Greg Clayton 1971900fdc Don't enable thread safe logging as it currently deadlocks logging.
llvm-svn: 126260
2011-02-22 23:08:31 +00:00
Jakob Stoklund Olesen 2329c542e9 Change the RAGreedy register assignment order so large live ranges are allocated first.
This is based on the observation that long live ranges are more difficult to
allocate, so there is a better chance of solving the puzzle by handling the big
pieces first. The allocator will evict and split long alive ranges when they get
in the way.

RABasic is still using spill weights for its priority queue, so the interface to
the queue has been virtualized.

llvm-svn: 126259
2011-02-22 23:01:52 +00:00
Jakob Stoklund Olesen fbad93fa13 80 Col.
llvm-svn: 126258
2011-02-22 23:01:49 +00:00
Greg Clayton 76b436e21d Make logs threadsafe (add the -t option) when logging API stuff.
llvm-svn: 126257
2011-02-22 22:59:30 +00:00
Nick Lewycky fc7222bfc4 Fix C++0x incompatibility. The signature of std::make_pair<> changes from:
template <class T1, class T2> pair<T1,T2> make_pair(const T1&, const T2&);
to
  template <class T1, class T2> pair<V1, V2> make_pair(T1&&, T2&&);
so explicitly specifying the template arguments to make_pair<> is going to break
when C++0x rolls through. Replace them with equivalent std::pair<>. Patch by
James Dennett!

llvm-svn: 126256
2011-02-22 22:48:47 +00:00
John McCall 147d021b75 Emit the structure layout of the block literal parameter to a block
invocation function into the debug info.  Rather than faking up a class,
which is tricky because of the custom layout we do, we just emit a struct
directly from the layout information we've already got.

Also, don't emit an unnecessarily parameter alloca for this "variable".

llvm-svn: 126255
2011-02-22 22:38:33 +00:00
John McCall 550d13aebb Give ImplicitParamDecl a public constructor so that it can be allocated on
the stack.

llvm-svn: 126254
2011-02-22 22:25:56 +00:00
Cameron Zwarich 826308586c Make LoopDeletion work on loops with multiple edges, as long as the incoming
values from all of the loop's exiting blocks are equal. Patch by Andrew Clinton.

llvm-svn: 126253
2011-02-22 22:25:39 +00:00
John McCall b67608fe83 Provide a Decl::getNonClosureContext to look through any "closure" (i.e.
block and, eventually, C++ lambda) contexts.

llvm-svn: 126252
2011-02-22 22:25:23 +00:00
Sean Callanan 2d1f4be47a Fixed a hang in the expression parser's result synthesizer that occurs when the function generated for the expression is completely empty except for a NULL_STMT. This happens sometimes when the parser returns errors.
llvm-svn: 126251
2011-02-22 21:52:56 +00:00
Douglas Gregor 996a735b88 We need a longer long when testing this pathe Microsoft fixed-underlying-type extension for enumeration types
llvm-svn: 126250
2011-02-22 21:42:31 +00:00
Johnny Chen 5f88bcc16a Add two convenience functions: DecodeImmShiftThumb() and DecodeImmShiftARM() to ARMUtils.h.
Use them within EmulateInstructionARM.cpp to save repetitive typing.

llvm-svn: 126247
2011-02-22 21:17:52 +00:00
Devang Patel b6ed369e77 A constructor call should force class's debug info even if -flimit-debug-info is enabled.
llvm-svn: 126246
2011-02-22 20:55:26 +00:00
Chris Lattner ba9006df9e improve support for SUSE Linux Enterprise Server 11 SP1 (x86_64).
Patch by Csaba Raduly!

llvm-svn: 126245
2011-02-22 20:47:07 +00:00
Joerg Sonnenberger b7e635dcad Use the same (%dx) hack for in[bwl] as for out[bwl].
llvm-svn: 126244
2011-02-22 20:40:09 +00:00
Douglas Gregor a1aec29a2d Enable enumeration types with a fixed underlying type, e.g.,
enum X : long { Value = 0x100000000 };

when in Microsoft-extension mode (-fms-extensions). This (now C++0x)
feature has been supported since Microsoft Visual Studio .NET 2003.

llvm-svn: 126243
2011-02-22 20:32:04 +00:00
Matt Beaumont-Gay 7a24210ebd Use an unused-except-in-Debug variable.
llvm-svn: 126240
2011-02-22 20:00:16 +00:00
Evan Cheng 04ad35b53f VFP single precision arith instructions can go down to NEON pipeline, but on Cortex-A8 only.
llvm-svn: 126238
2011-02-22 19:53:14 +00:00
Johnny Chen 83a4ddd0cb Add "cmp<c>.w <Rn>, #<const>" emulation to EmulateCMPImm() method,
and implement EmulateCMNImm() and EMulateCMNReg() methods.

llvm-svn: 126236
2011-02-22 19:48:22 +00:00
Greg Clayton 681254c830 Remove an assertion that was causing a crash.
llvm-svn: 126235
2011-02-22 19:32:07 +00:00
Johnny Chen aebcfc86df Fix the 'variants' field of "CMN (immediate)" Encoding T1 entry, it should be ARMV6T2_ABOVE, not ARMvAll.
llvm-svn: 126234
2011-02-22 19:01:11 +00:00
Devang Patel d7185b755d Use LLVM coding standard.
llvm-svn: 126232
2011-02-22 18:56:36 +00:00
Devang Patel 9b4127349c Follow LLVM coding style.
clang uses DBuilder, so it requries corresponding change.

llvm-svn: 126231
2011-02-22 18:56:12 +00:00
Douglas Gregor e2f943b5cb Implement the GNU C extension which permits the initialization of an
array from a constant array compound literal. Fixes PR9261.

llvm-svn: 126230
2011-02-22 18:29:51 +00:00
Argyrios Kyrtzidis ed35cf271d [analyzer] Start moving the path-sensitive checkers to CheckerV2.
-Migrate ObjCSelfInitChecker to CheckerV2. In the process remove the 'preCallSelfFlags' field
 from the checker class and use GRState for storing that info.
-Get ExprEngine to start delegating checker running to CheckerManager.

llvm-svn: 126229
2011-02-22 17:30:38 +00:00
Argyrios Kyrtzidis 98e35dda03 [analyzer] Separate CheckerContext into its own include file. No functionality change.
llvm-svn: 126228
2011-02-22 17:30:32 +00:00
Argyrios Kyrtzidis b9eae65c63 [analyzer] Fix GRStatePartialTrait<bool> and introduce GRStatePartialTrait<unsigned>.
llvm-svn: 126227
2011-02-22 17:30:28 +00:00
Roman Divacky e8a93fe8f0 Stack alignment is 16 bytes on FreeBSD/i386 too.
llvm-svn: 126226
2011-02-22 17:30:05 +00:00
Joerg Sonnenberger 4f864d3111 Bug#9172: Don't use static in file scope, use an attribute on the
parser.

llvm-svn: 126225
2011-02-22 16:53:11 +00:00