Commit Graph

14544 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis 9f2d24a808 Support TemplateTemplateParmDecl for PCH.
llvm-svn: 107884
2010-07-08 17:12:57 +00:00
Argyrios Kyrtzidis a4ed18191c For TagType and TemplateSpecializationType, isDependent calculation may be invalid because some decls that the
calculation is using may still be initializing.
Thus, store the isDependent flag to PCH and restore directly to Type.

llvm-svn: 107873
2010-07-08 13:09:53 +00:00
Argyrios Kyrtzidis 1985bb3b10 Read/write the C++ parts of DeclRefExpr and MemberExpr for PCH.
llvm-svn: 107872
2010-07-08 13:09:47 +00:00
Argyrios Kyrtzidis 00dda6accc Fix reading of UsingDecl from PCH.
llvm-svn: 107871
2010-07-08 13:09:41 +00:00
Chandler Carruth dd1bc0f1b5 Add support for differentiating between attributes ignored when handled and
unknown attributes that we discard. Add a diagnostic group for unknown
attribute warnings to allow turning these off when we don't care. Also
consolidates the tests for this case.

llvm-svn: 107864
2010-07-08 09:42:26 +00:00
John McCall be349def4b Mark calls to 'throw()' functions as nounwind, and mark the functions nounwind
as well.

llvm-svn: 107858
2010-07-08 06:48:12 +00:00
Douglas Gregor 747eb7840a Reinstate the fix for PR7556. A silly use of isTrivial() was
suppressing copies of objects with trivial copy constructors.

llvm-svn: 107857
2010-07-08 06:14:04 +00:00
Chris Lattner cb7696cf35 fix the clang side of PR7437: EmitAggregateCopy
was not producing a memcpy with the right address
spaces because of two places in it doing casts of
the arguments to i8, one of which that didn't
preserve the address space.

There is also an optimizer bug here.

llvm-svn: 107842
2010-07-08 00:07:45 +00:00
Douglas Gregor e182370eda Revert r107828 and r107827, the fix for PR7556, which seems to be
breaking bootstrap on Linux.

llvm-svn: 107837
2010-07-07 23:37:33 +00:00
Chris Lattner 86851b8a7a fix PR4499, patch by Kyle Dean!
llvm-svn: 107836
2010-07-07 23:24:27 +00:00
Sebastian Redl a771d2239d Rip out the C++0x-specific handling of destructor names. The specification is still in flux and unclear, and our interim workaround was broken. Fixes PR7467.
llvm-svn: 107835
2010-07-07 23:17:38 +00:00
Douglas Gregor 1d9ef840fa A using declaration can redeclare a typedef to the same type. These
typedefs won't have the same canonical declaration (since they are
distinct), so we need to check for this case specifically. Fixes
<rdar://problem/8018262>.

llvm-svn: 107833
2010-07-07 23:08:52 +00:00
Douglas Gregor 6df2b8c3ac Rename CXXZeroInitValueExpr to CXXScalarValueInitExpr, to reflect its
newly-narrowed scope. No functionality change.

llvm-svn: 107828
2010-07-07 22:43:56 +00:00
Douglas Gregor 442612c285 Do not use CXXZeroValueInitExpr for class types. Instead, use
CXXConstructExpr/CXXTemporaryObjectExpr/CXXNewExpr as
appropriate. Fixes PR7556, and provides a slide codegen improvement
when copy-initializing a POD class type from a value-initialized
temporary. Previously, we weren't eliding the copy.

llvm-svn: 107827
2010-07-07 22:35:13 +00:00
Nate Begeman 5da51d38d7 Fix an issue with opencl init list checking.
llvm-svn: 107824
2010-07-07 22:26:56 +00:00
Douglas Gregor 2530efd3cf When printing statistics for the ASTContext, also print them for its BumpPtrAllocator
llvm-svn: 107790
2010-07-07 16:40:34 +00:00
Chris Lattner 3e2ee147d0 add driver support for minix, patch by Kees van Reeuwijk
from PR7583

llvm-svn: 107788
2010-07-07 16:01:42 +00:00
Argyrios Kyrtzidis ad65c6926b Fix broken reading of NestedNameSpecifiers from PCH.
llvm-svn: 107784
2010-07-07 15:46:30 +00:00
Argyrios Kyrtzidis 903ccd6121 Delay passing InterestingDecls to the Consumer until when we know we are not in recursive loading and the
declarations are fully initialized.

llvm-svn: 107783
2010-07-07 15:46:26 +00:00
Argyrios Kyrtzidis 54fcbc7345 getBody() -> hasBody()
llvm-svn: 107773
2010-07-07 12:24:18 +00:00
Argyrios Kyrtzidis 0b6a06a335 Simplify code and remove comment that is no longer relevant.
llvm-svn: 107772
2010-07-07 12:24:14 +00:00
Argyrios Kyrtzidis 568bc84562 Remove Decl::getCompoundBody().
This has 2 (slight) advantages:
-Make explicit at getBody()'s callsite that we expect/handle only CompoundStmt and not CXXTryStmt.
-Better tracking of Decl::getBody()'s callsites.

llvm-svn: 107771
2010-07-07 11:31:34 +00:00
Argyrios Kyrtzidis 6fbc8fa53e Simplify code. CompoundStmt's RBraceLoc can be found using its SourceRange too.
llvm-svn: 107770
2010-07-07 11:31:27 +00:00
Argyrios Kyrtzidis 46f556d4e5 Simplify code. FunctionDecl and ObjCMethodDecl have some common interfaces.
llvm-svn: 107769
2010-07-07 11:31:23 +00:00
Argyrios Kyrtzidis 36ea322579 Introduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead of getBody() when we are just checking the existence of a body, to avoid de-serialization of the body from PCH.
Makes de-serialization of the function body even more "lazier".

llvm-svn: 107768
2010-07-07 11:31:19 +00:00
Jordy Rose 65136fb669 Add memcmp() and bcmp() to CStringChecker. These check for valid access to the buffer arguments and have a special-case for when the buffer arguments are known to be the same address, or when the size is zero.
llvm-svn: 107761
2010-07-07 08:15:01 +00:00
Jordy Rose 33c829a6fd Cleanup on CStringChecker and its associated tests. Also check for null arguments...which are allowed if the access length is 0!
llvm-svn: 107759
2010-07-07 07:48:06 +00:00
John McCall b609d3f5f9 Teach function-try-blocks on constructors and destructors to implicitly
rethrow.  Fixes rdar://problem/7696603

llvm-svn: 107757
2010-07-07 06:56:46 +00:00
Chris Lattner 3956106543 implement PR7569, warning about assignment to null, which
people seem to write when they want a deterministic trap.
Suggest instead that they use a volatile pointer or 
__builtin_trap.

llvm-svn: 107756
2010-07-07 06:14:23 +00:00
John McCall 11086fcb65 Don't consider casted non-global pointers to be evaluatable.
Fixes rdar://problem/8154689

llvm-svn: 107755
2010-07-07 05:08:32 +00:00
Tom Care ca1f871ff8 Change explicit handling of impossible condition to call llvm_unreachable in IdempotentOperationChecker::PreVisitBinaryOperator.
llvm-svn: 107748
2010-07-07 01:27:17 +00:00
Chandler Carruth 509a9ce9da Silence an annoying GCC warning about use of an uninitialized variable. Even
making the other switch case unreachable, or sinking the 'continue' into it
doesn't silence this.

llvm-svn: 107745
2010-07-07 00:36:56 +00:00
Chandler Carruth dce439d11d Use 'llvm_unreachable' to mark impossible code paths so that GCC doesn't
consider them for warnings.

llvm-svn: 107741
2010-07-07 00:07:37 +00:00
John McCall 09ae03299a Provide a hook for the benefit of clients using clang IR gen as a subroutine:
emit metadata associating allocas and global values with a Decl*.  This feature
is controlled by an option that (intentionally) cannot be enabled on the command
line.

To use this feature, simply set
  CodeGenOptions.EmitDeclMetadata = true;
and then interpret the completely underspecified metadata. :)

llvm-svn: 107739
2010-07-06 23:57:41 +00:00
Ted Kremenek da534381f8 Fix casts in RegionStore to not always assume that bindings are only to SubRegions. Fixes assertion failure
reported in PR 7572.

llvm-svn: 107738
2010-07-06 23:53:29 +00:00
Ted Kremenek 0fc6354f2f Implement dumpToStream() for NonStaticGlobalSpaceRegion and StaticGlobalSpaceRegion.
llvm-svn: 107731
2010-07-06 23:37:21 +00:00
Jordy Rose cf781e5430 Add comment noting VLASizeChecker's duty in defining a VLA's extent.
llvm-svn: 107728
2010-07-06 23:33:54 +00:00
Jordy Rose 134a236a14 Add a new path-sensitive checker for functions in <string.h>, for both null-terminated strings and memory blocks. Currently only checks memcpy(), memmove(), and bcopy(), but this is intended to be expanded soon.
llvm-svn: 107722
2010-07-06 23:11:01 +00:00
Ted Kremenek 128bfb7643 Sort CMake file.
llvm-svn: 107709
2010-07-06 22:03:19 +00:00
Tom Care 3ff08a8e76 Added a path-sensitive idempotent operation checker (-analyzer-idempotent-operation). Finds idempotent and/or tautological operations in a path sensitive context, flagging operations that have no effect or a predictable effect.
Example:
{
int a = 1;
int b = 5;
int c = b / a; // a is 1 on all paths
}

- New IdempotentOperationChecker class
- Moved recursive Stmt functions in r107675 to IdempotentOperationChecker
- Minor refactoring of SVal to allow checking for any integer
- Added command line option for check
- Added basic test cases

llvm-svn: 107706
2010-07-06 21:43:29 +00:00
Nick Lewycky c96c37f6fd Fix multiple emission of the this-> fixit for each instantiation by fixing the
AST during the instantiation. Fixes PR7417!

llvm-svn: 107690
2010-07-06 19:51:49 +00:00
John McCall 189223e222 Make CGBuilderTy a typedef again; its functionality has been rolled back
into IRBuilder.

llvm-svn: 107687
2010-07-06 18:43:48 +00:00
Douglas Gregor ec9c6ae1cb Improve the accuracy of getSourceRange() for DeclaratorDecl and
TagDecl subclasses when out-of-line template declaration information
is available, from Peter Collingbourne!

llvm-svn: 107686
2010-07-06 18:42:40 +00:00
Douglas Gregor d890b734f8 Correctly set the location of the "template" keyword for a class
template specialization, from Peter Collingbourne.

llvm-svn: 107682
2010-07-06 18:33:12 +00:00
Douglas Gregor 6191f6c607 Remove my egregious hack that forced deserialization of visible
declarations when implicitly declaring the default constructor, copy
constructor, destructor, and copy-assignment operators of a
class. Argiris fixed the underlying problem in r107596.

llvm-svn: 107681
2010-07-06 18:29:01 +00:00
Duncan Sands 1614396b15 Pacify versions of gcc that think these variables may be used
uninitialized (which doesn't seem to be the case), by giving
them arbitrary initial values.

llvm-svn: 107679
2010-07-06 18:19:40 +00:00
John McCall 2d605ac1f5 When destroying a cleanup, kill any references to instructions in the entry
block before deleting it.  Fixes PR7575.

This really just a short-term fix before implementing lazy cleanups.

llvm-svn: 107676
2010-07-06 17:35:03 +00:00
Tom Care 4626285dba Added several helper functions to Stmt to recursively check for different elements (macros, enum constants, etc).
llvm-svn: 107675
2010-07-06 17:28:49 +00:00
Argyrios Kyrtzidis 39fdf81b43 Read/write function template specializations for PCH, properly this time.
llvm-svn: 107665
2010-07-06 15:37:09 +00:00
Argyrios Kyrtzidis af2eac2869 Add to PCH missing Sema information about VTable uses and dynamic classes.
llvm-svn: 107664
2010-07-06 15:37:04 +00:00