]> granicus.if.org Git - clang/log
clang
13 years agoMake SymbolManager comments doxygen friendly.
Anna Zaks [Thu, 11 Aug 2011 01:03:22 +0000 (01:03 +0000)]
Make SymbolManager comments doxygen friendly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137290 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCleanup: remove CleanedSate member and GetState() wrapper from StmtNodeBuilder, not...
Anna Zaks [Thu, 11 Aug 2011 00:11:21 +0000 (00:11 +0000)]
Cleanup: remove CleanedSate member and GetState() wrapper from StmtNodeBuilder, not needed as of r137273.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137284 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCleanup: remove GetState() wrapper from ExprEngine, not needed as of r137273.
Anna Zaks [Wed, 10 Aug 2011 23:34:53 +0000 (23:34 +0000)]
Cleanup: remove GetState() wrapper from ExprEngine, not needed as of r137273.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137279 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAnalyzer Core: In checkDeadSymbols checker callback, provide the state in which the...
Anna Zaks [Wed, 10 Aug 2011 23:14:54 +0000 (23:14 +0000)]
Analyzer Core: In checkDeadSymbols checker callback, provide the state in which the symbols are not yet deleted so that checkers could inspect them. Since we are now always creating a transition in ProcessStmt(), remove the logic for adding a transition when none was generated. TODO: the extra transitions will have to be removed; more cleanups; a checker that tests teh new fucntionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137273 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRefactoring of DiagnoseBitwisePrecedence() in SemaExpr.cpp to reduce code duplication.
Richard Trieu [Wed, 10 Aug 2011 22:41:34 +0000 (22:41 +0000)]
Refactoring of DiagnoseBitwisePrecedence() in SemaExpr.cpp to reduce code duplication.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137259 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen performing the lookup in the current scope for a member access to
Douglas Gregor [Wed, 10 Aug 2011 21:59:45 +0000 (21:59 +0000)]
When performing the lookup in the current scope for a member access to
a member template, e.g.,

  x.f<int>

if we have found a template in the type of x, but the lookup in the
current scope is ambiguous, just ignore the lookup in the current
scope.  Fixes <rdar://problem/9915664>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137255 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[arcmt] When checking whether properties needs to be strong or not, take into account
Argyrios Kyrtzidis [Wed, 10 Aug 2011 21:46:48 +0000 (21:46 +0000)]
[arcmt] When checking whether properties needs to be strong or not, take into account
that assigning result of -retain means it should be strong. rdar://9931757.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137252 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[libclang] When pointing at an objc property don't return a cursor that points at the
Argyrios Kyrtzidis [Wed, 10 Aug 2011 21:12:04 +0000 (21:12 +0000)]
[libclang] When pointing at an objc property don't return a cursor that points at the
synthesized method for the property. rdar://9771715

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137248 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd the new unit test that I managed to leave out of r136997 :/
Kaelyn Uhrain [Wed, 10 Aug 2011 19:49:27 +0000 (19:49 +0000)]
Add the new unit test that I managed to leave out of r136997 :/

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137242 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd a test case for the divide-by-zero fix in r137234
Kaelyn Uhrain [Wed, 10 Aug 2011 19:47:25 +0000 (19:47 +0000)]
Add a test case for the divide-by-zero fix in r137234

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137240 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake sure ptrarith_typesize is at least 1 to avoid division by zero
Kaelyn Uhrain [Wed, 10 Aug 2011 18:49:28 +0000 (18:49 +0000)]
Make sure ptrarith_typesize is at least 1 to avoid division by zero

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137234 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRenamings to consistently use 'Constexpr' not 'ConstExpr' when referring to the C...
Richard Smith [Wed, 10 Aug 2011 18:11:37 +0000 (18:11 +0000)]
Renamings to consistently use 'Constexpr' not 'ConstExpr' when referring to the C++0x 'constexpr' keyword.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137230 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoobjective-c: Using existing infrastructure for finding
Fariborz Jahanian [Wed, 10 Aug 2011 17:16:30 +0000 (17:16 +0000)]
objective-c: Using existing infrastructure for finding
overridden  methods to diagnose their type mismatch.
This is a general solution for previous fixes
for // rdar://6191214 and // rdar://9352731
and removes lots of duplicate code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137222 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoExpand test of C++0x [class.copymove]p15 to make sure we're actually calling the...
Douglas Gregor [Wed, 10 Aug 2011 16:59:20 +0000 (16:59 +0000)]
Expand test of C++0x [class.copymove]p15 to make sure we're actually calling the copy constructor of a base/member from an explicitly-defaulted copy constructor, rather than the default constructor

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137220 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen adding the base and member initializers for an implicitly-defined
Douglas Gregor [Wed, 10 Aug 2011 16:51:53 +0000 (16:51 +0000)]
When adding the base and member initializers for an implicitly-defined
special member function, make sure to classify an explicitly-defaulted
copy constructor as a "copy" operation. Fixes PR10622.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137219 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSwitch a C-style cast over to a const_cast. No functionality change
Douglas Gregor [Wed, 10 Aug 2011 16:34:38 +0000 (16:34 +0000)]
Switch a C-style cast over to a const_cast. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137218 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUpdate a comment to match the recently-changed code
Douglas Gregor [Wed, 10 Aug 2011 16:09:55 +0000 (16:09 +0000)]
Update a comment to match the recently-changed code

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137216 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFor the availability attribute, allow a declaration to be deprecated
Douglas Gregor [Wed, 10 Aug 2011 15:31:35 +0000 (15:31 +0000)]
For the availability attribute, allow a declaration to be deprecated
in the same version that it is introduced. Stuff happens.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137214 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRewrite default initialization of anonymous structs/unions within a
Douglas Gregor [Wed, 10 Aug 2011 15:22:55 +0000 (15:22 +0000)]
Rewrite default initialization of anonymous structs/unions within a
constructor. Previously, we did some bogus recursion into the fields
of anonymous structs (recursively), which ended up building invalid
ASTs that would cause CodeGen to crash due to invalid GEPs.

Now, we instead build the default initializations based on the
indirect field declarations at the top level, which properly generates
the sequence of GEPs needed to initialize the proper member. Fixes
PR10512 and <rdar://problem/9924046>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137212 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoChange an assert into a check. I'm pretty sure there was a point
John McCall [Wed, 10 Aug 2011 04:12:23 +0000 (04:12 +0000)]
Change an assert into a check.  I'm pretty sure there was a point
in time when this assert was valid, but it's not valid now.
Also teach this code to correctly introduce function-to-pointer
decay.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137201 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFormatting.
John McCall [Wed, 10 Aug 2011 04:11:11 +0000 (04:11 +0000)]
Formatting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137200 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert bad change. (It may look equivalent, but it isn't.)
Eli Friedman [Tue, 9 Aug 2011 18:16:09 +0000 (18:16 +0000)]
Revert bad change.  (It may look equivalent, but it isn't.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137132 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThread Safety: Added basic argument parsing for all new attributes.
Caitlin Sadowski [Tue, 9 Aug 2011 17:59:31 +0000 (17:59 +0000)]
Thread Safety: Added basic argument parsing for all new attributes.

This patch special cases the parser for thread safety attributes so that all
attribute arguments are put in the argument list (instead of a special
parameter) since arguments may not otherwise resolve correctly without two-token
lookahead.

This patch also adds checks to make sure that attribute arguments are
lockable objects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137130 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCleanup; no functionality change.
Eli Friedman [Tue, 9 Aug 2011 17:38:12 +0000 (17:38 +0000)]
Cleanup; no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137126 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMove the creation of the record type for the state of Objective-C fast
Douglas Gregor [Tue, 9 Aug 2011 17:23:49 +0000 (17:23 +0000)]
Move the creation of the record type for the state of Objective-C fast
enumerations from the ASTContext into CodeGen, so that we don't need
to serialize it to AST files. This appears to be the last of the
low-hanging fruit for SpecialTypes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137124 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't serialize the block descriptor or block extended descriptor
Douglas Gregor [Tue, 9 Aug 2011 16:24:26 +0000 (16:24 +0000)]
Don't serialize the block descriptor or block extended descriptor
types to AST files; they're only used by debug info generation anyway,
and shouldn't ever exist in the AST anyway.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137122 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMove the construction of the RecordDecl representing the runtime
Douglas Gregor [Tue, 9 Aug 2011 15:54:21 +0000 (15:54 +0000)]
Move the construction of the RecordDecl representing the runtime
layout of a constant NSString from the ASTContext over to CodeGen,
since this is solely CodeGen's responsibility. Eliminates one of the
unnecessary "special" types that we serialize.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137121 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMigrate the serialization of ASTContext's AutoDeduceTy and
Douglas Gregor [Tue, 9 Aug 2011 15:13:55 +0000 (15:13 +0000)]
Migrate the serialization of ASTContext's AutoDeduceTy and
AutoRRefDeductTy from the "special types" block to predefined
types. The latter behaves better when loading multiple AST files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137120 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPlace back previous order of add_subdirectory()'s to reflect build depedencies.
Ted Kremenek [Tue, 9 Aug 2011 14:55:12 +0000 (14:55 +0000)]
Place back previous order of add_subdirectory()'s to reflect build depedencies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137117 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd libsupport to list of libraries to link into diagtool
Ted Kremenek [Tue, 9 Aug 2011 03:41:03 +0000 (03:41 +0000)]
Add libsupport to list of libraries to link into diagtool

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137110 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd 'diagtool' to the 'tools/' directory. diagtool is a new tool (WIP) for analyzing...
Ted Kremenek [Tue, 9 Aug 2011 03:39:19 +0000 (03:39 +0000)]
Add 'diagtool' to the 'tools/' directory.  diagtool is a new tool (WIP) for analyzing and working with clang diagnostics.

Some interesting stats from 'diagtool list-warnings' on the current version of clang:

  Percentage of warnings with flags: 48.79%
  Number of unique flags: 148
  Average number of diagnostics per flag: 2.041

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137109 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoProvide diag_iterator for iterating over the built-in diagnostic IDs/names in the...
Ted Kremenek [Tue, 9 Aug 2011 03:39:14 +0000 (03:39 +0000)]
Provide diag_iterator for iterating over the built-in diagnostic IDs/names in the internal table of DiagnosticIDs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137108 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSort CMakeLists.txt.
Ted Kremenek [Tue, 9 Aug 2011 03:39:10 +0000 (03:39 +0000)]
Sort CMakeLists.txt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137107 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake sure to canonicalize the argument type of a non-type template
Douglas Gregor [Tue, 9 Aug 2011 01:55:14 +0000 (01:55 +0000)]
Make sure to canonicalize the argument type of a non-type template
argument of enumeration type when checking template arguments. Fixes PR10579.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137101 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoHand materialization of temporary expressions when emitting a scalar
Douglas Gregor [Tue, 9 Aug 2011 00:37:14 +0000 (00:37 +0000)]
Hand materialization of temporary expressions when emitting a scalar
expression. Fxies PR10592.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137086 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't emit memcpy for copying fields of arrays of volatile elements.
Fariborz Jahanian [Tue, 9 Aug 2011 00:26:11 +0000 (00:26 +0000)]
Don't emit memcpy for copying fields of arrays of volatile elements.
Use the the path that generates a loop. This fixes
bogus error that clang puts out. // rdar://9894548

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137080 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIf no -miphoneos-version-min specified, see if we can set the default based on
Chad Rosier [Mon, 8 Aug 2011 23:39:34 +0000 (23:39 +0000)]
If no -miphoneos-version-min specified, see if we can set the default based on
-isysroot.
rdar://9837120

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137075 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix another -Wuninitialized assertion failure (this one involving bit casts) resultin...
Ted Kremenek [Mon, 8 Aug 2011 21:43:08 +0000 (21:43 +0000)]
Fix another -Wuninitialized assertion failure (this one involving bit casts) resulting from the recent -Wuninitialized changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137068 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd -W flag for ARC warning "performSelector may cause a leak because its selector...
Ted Kremenek [Mon, 8 Aug 2011 21:28:18 +0000 (21:28 +0000)]
Add -W flag for ARC warning "performSelector may cause a leak because its selector is unknown".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137066 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoobjective-c: diagnose protocol inconsistencies in following
Fariborz Jahanian [Mon, 8 Aug 2011 18:03:17 +0000 (18:03 +0000)]
objective-c: diagnose protocol inconsistencies in following
situation. When a class explicitly or implicitly (through inheritance)
"conformsTo" two protocols which conflict (have methods which conflict).
This patch fixes the previous patch where warnings were coming out in
non-deterministic order.  This is 2nd part of // rdar://6191214.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137055 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake sure FunctionDecls aren't considered during overload resolution if there
Kaelyn Uhrain [Mon, 8 Aug 2011 17:35:31 +0000 (17:35 +0000)]
Make sure FunctionDecls aren't considered during overload resolution if there
are explicit template args.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137054 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSilence the category-replacing-class-method warning for +load: category
David Chisnall [Mon, 8 Aug 2011 17:32:19 +0000 (17:32 +0000)]
Silence the category-replacing-class-method warning for +load: category
implementations of +load do not replace the class definition in a meaningful
sense, they are run when the category loads, the +load method for class is run
when the class is loaded.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137053 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix typo so we don't use the wrong function for ending ObjC++ catch blocks (GNU runtimes)
David Chisnall [Mon, 8 Aug 2011 17:26:06 +0000 (17:26 +0000)]
Fix typo so we don't use the wrong function for ending ObjC++ catch blocks (GNU runtimes)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137052 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImproved efficiency by using iterator returned by erase, rather then restarting.
Chad Rosier [Mon, 8 Aug 2011 17:17:15 +0000 (17:17 +0000)]
Improved efficiency by using iterator returned by erase, rather then restarting.
Thanks to David Blaikie for pointing this out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137051 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix comment (test commit)
Craig Topper [Mon, 8 Aug 2011 06:10:39 +0000 (06:10 +0000)]
Fix comment (test commit)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137039 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAvoid fallthrough-branching to an inactive cleanup even if it's
John McCall [Sun, 7 Aug 2011 07:05:57 +0000 (07:05 +0000)]
Avoid fallthrough-branching to an inactive cleanup even if it's
otherwise required.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137029 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd a __has_feature macro for generalized initializers, turned off
Sean Hunt [Sun, 7 Aug 2011 00:34:32 +0000 (00:34 +0000)]
Add a __has_feature macro for generalized initializers, turned off
because we don't support them yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137027 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDo l-value conversion, etc., on a switch condition expression in
John McCall [Sat, 6 Aug 2011 07:30:58 +0000 (07:30 +0000)]
Do l-value conversion, etc., on a switch condition expression in
ActOnStartOfSwitchStmt (i.e. before binding up a full-expression)
instead of ActOnFinishSwitchStmt.

Among other things, this means that property l-values are properly
converted inside the full-expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137014 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Start sketching out a new BugReporterVisitor that inspects branches and...
Ted Kremenek [Sat, 6 Aug 2011 06:54:45 +0000 (06:54 +0000)]
[analyzer] Start sketching out a new BugReporterVisitor that inspects branches and other expressions to generate interesting path events in diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137012 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoBe sure to destroy the normal entry block of a cleanup that we
John McCall [Sat, 6 Aug 2011 06:53:52 +0000 (06:53 +0000)]
Be sure to destroy the normal entry block of a cleanup that we
aren't actually going to make a normal cleanup for.  Sometimes
we optimistically create branches to such blocks for fixups,
and then we resolve the fixup to somewhere within the cleanup's
scope, and then the cleanup is actually not reachable for some
reason.  The process of resolving the fixup leaves us with
switches whose default edge leads to the cleanup;  we can
replace that with unreachable, then (in many cases) turn
the switch into an unconditional branch.

Fixes PR10467.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137011 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix HTML.
Benjamin Kramer [Sat, 6 Aug 2011 03:04:45 +0000 (03:04 +0000)]
Fix HTML.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137010 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoOnly look at decls after the current one when checking if it's the last field in...
Benjamin Kramer [Sat, 6 Aug 2011 03:04:42 +0000 (03:04 +0000)]
Only look at decls after the current one when checking if it's the last field in a record.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137009 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] add more buffer overflow tests to show we handle sizeof(VLA) in obstruse...
Ted Kremenek [Sat, 6 Aug 2011 00:34:48 +0000 (00:34 +0000)]
[analyzer] add more buffer overflow tests to show we handle sizeof(VLA) in obstruse ways...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137007 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Simplify logic for ExprEngine::VisitUnaryExprOrTypeTraitExpr to avoid...
Ted Kremenek [Sat, 6 Aug 2011 00:30:00 +0000 (00:30 +0000)]
[analyzer] Simplify logic for ExprEngine::VisitUnaryExprOrTypeTraitExpr to avoid recursion to subexpression.

This exposed bugs in the live variables analysis, and a latent analyzer bug in the SymbolReaper.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137006 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Change SymbolReaper to store region roots implied by the Environment,...
Ted Kremenek [Sat, 6 Aug 2011 00:29:57 +0000 (00:29 +0000)]
[analyzer] Change SymbolReaper to store region roots implied by the Environment, allowing it be queried when
determining if symbols derived from regions are still live.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137005 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoKeychainAPI checker: Track SymbolMetadata instead of MemRegion in checker state so...
Anna Zaks [Fri, 5 Aug 2011 23:52:45 +0000 (23:52 +0000)]
KeychainAPI checker: Track SymbolMetadata instead of MemRegion in checker state so that we could clear the state on evalDeadSymbols; also track the return value.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137003 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoStatic Analyzer: Add a convinience API. Add comment.
Anna Zaks [Fri, 5 Aug 2011 23:47:13 +0000 (23:47 +0000)]
Static Analyzer: Add a convinience API. Add comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137000 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert 136984 and 136927.
Ted Kremenek [Fri, 5 Aug 2011 23:31:22 +0000 (23:31 +0000)]
Revert 136984 and 136927.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136998 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPerform array bounds checking in more situations and properly handle special
Kaelyn Uhrain [Fri, 5 Aug 2011 23:18:04 +0000 (23:18 +0000)]
Perform array bounds checking in more situations and properly handle special
case situations with the unary operators & and *. Also extend the array bounds
checking to work with pointer arithmetic; the pointer arithemtic checking can
be turned on using -Warray-bounds-pointer-arithmetic.

The changes to where CheckArrayAccess gets called is based on some trial &
error and a bunch of digging through source code and gdb backtraces in order
to have the check performed under as many situations as possible (such as for
variable initializers, arguments to function calls, and within conditional in
addition to the simpler cases of the operands to binary and unary operator)
while not being called--and triggering warnings--more than once for a given
ArraySubscriptExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136997 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd workaround for built va list (and other builtins) so that running ReadAST multipl...
Jonathan D. Turner [Fri, 5 Aug 2011 23:07:10 +0000 (23:07 +0000)]
Add workaround for built va list (and other builtins) so that running ReadAST multiple times does not immediately throw an error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136995 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd support for using anonymous bitfields (e.g., int : 0) to enforce alignment.
Chad Rosier [Fri, 5 Aug 2011 22:38:04 +0000 (22:38 +0000)]
Add support for using anonymous bitfields (e.g., int : 0) to enforce alignment.
This fixes cases where the anonymous bitfield is followed by a bitfield member.
E.g.,
struct t4
{
 char foo;
 long : 0;
 char bar : 1;
};

rdar://9859156

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136991 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWire up -import-module to run ReadAST for each module loaded.
Jonathan D. Turner [Fri, 5 Aug 2011 22:17:03 +0000 (22:17 +0000)]
Wire up -import-module to run ReadAST for each module loaded.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136987 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake test/SemaObjC/qualified-protocol-method-conflicts.m always fail and mark it...
Ted Kremenek [Fri, 5 Aug 2011 21:53:47 +0000 (21:53 +0000)]
Make test/SemaObjC/qualified-protocol-method-conflicts.m always fail and mark it XFAIL.  This is a stop gap until the output of the test is deterministic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136984 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoLet attribute((cdecl)) and company override -mrtd default calling convention.
Roman Divacky [Fri, 5 Aug 2011 16:37:22 +0000 (16:37 +0000)]
Let attribute((cdecl)) and company override -mrtd default calling convention.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136971 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFlesh out the -Warray-bounds detection of C89 tail-padded one-element
Chandler Carruth [Fri, 5 Aug 2011 09:10:50 +0000 (09:10 +0000)]
Flesh out the -Warray-bounds detection of C89 tail-padded one-element
arrays. This now suppresses the warning only in the case of
a one-element array as the last field in a struct where the array size
is a literal '1' rather than any macro expansion or template parameter.

This doesn't distinguish between the language standard in use to allow
code which dates from C89 era to compile without the warning even in C99
and C++ builds. We could add a separate warning (under a different flag)
with fixit hints to switch to a flexible array, but its not clear that
this would be desirable. Much of the code using this idiom is striving
for maximum portability.

Tests were also fleshed out a bit, and the diagnostic itself tweaked to
be more pretty w.r.t. single elment arrays. This is more ugly than
I would like due to APInt's not being supported by the diagnostic
rendering engine.

A pseudo-patch for this was proposed by Nicola Gigante, but I reworked
it both for several correctness issues and for code style.

Sorry this was so long in coming.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136965 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFinally getting around to re-working this to more accurately white-list
Chandler Carruth [Fri, 5 Aug 2011 08:07:29 +0000 (08:07 +0000)]
Finally getting around to re-working this to more accurately white-list
1-element character arrays which are serving as flexible arrays. This is
the initial step, which is to restrict the 1-element array whitelist to
arrays that are member declarations. I'll refine it from here based on
the proposed patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136964 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFixed FieldDecl source range.
Abramo Bagnara [Fri, 5 Aug 2011 08:02:55 +0000 (08:02 +0000)]
Fixed FieldDecl source range.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136963 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoChange the this -W flag to 'return-stack-address'.
Chandler Carruth [Fri, 5 Aug 2011 02:11:36 +0000 (02:11 +0000)]
Change the this -W flag to 'return-stack-address'.

  ~or~

Paint the bikeshed green.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136959 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoOutput to /dev/null, not "0"
Matt Beaumont-Gay [Fri, 5 Aug 2011 01:05:35 +0000 (01:05 +0000)]
Output to /dev/null, not "0"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136955 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoKeychainAPI checker: Generate an error on double allocation. Pull out getAsPointeeMem...
Anna Zaks [Fri, 5 Aug 2011 00:37:00 +0000 (00:37 +0000)]
KeychainAPI checker: Generate an error on double allocation. Pull out getAsPointeeMemoryRegion so that it could be reused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136952 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoExtend memset/memcpy/memmove checking to include memcmp
Matt Beaumont-Gay [Fri, 5 Aug 2011 00:22:34 +0000 (00:22 +0000)]
Extend memset/memcpy/memmove checking to include memcmp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136950 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThe continue label in an ARC for-in loop should not involve
John McCall [Fri, 5 Aug 2011 00:14:38 +0000 (00:14 +0000)]
The continue label in an ARC for-in loop should not involve
releasing the collection.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136949 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoHave the typo correction in DiagnoseEmptyLookup properly handle template
Kaelyn Uhrain [Fri, 5 Aug 2011 00:09:52 +0000 (00:09 +0000)]
Have the typo correction in DiagnoseEmptyLookup properly handle template
functions when performing function overload resolution.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136948 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoobjc rewriter: Fixes a rewriting of implicit casting of an integral
Fariborz Jahanian [Thu, 4 Aug 2011 23:58:03 +0000 (23:58 +0000)]
objc rewriter: Fixes a rewriting of implicit casting of an integral
argument to bool. // rdar://9899834

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136946 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMore whitespace and naming fixup. No functionality change.
Chad Rosier [Thu, 4 Aug 2011 23:34:15 +0000 (23:34 +0000)]
More whitespace and naming fixup.  No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136944 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a small bug where DiagnoseEmptyLookup would no longer print any messages
Kaelyn Uhrain [Thu, 4 Aug 2011 23:30:54 +0000 (23:30 +0000)]
Fix a small bug where DiagnoseEmptyLookup would no longer print any messages
when performing typo correction involving any overloaded template functions.

The added test cases, while currently demontrating sub-optimal behavior, will
not trigger any messages without the 1-line change to SemaExpr.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136943 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSpecialize diag::warn_unused_call for the "warn_unused_result" attribute, so
Matt Beaumont-Gay [Thu, 4 Aug 2011 23:11:04 +0000 (23:11 +0000)]
Specialize diag::warn_unused_call for the "warn_unused_result" attribute, so
it can be controlled with a distinct flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136941 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix assertion failure in -Wuninitialized involving no-op casts. Fixes PR 10577.
Ted Kremenek [Thu, 4 Aug 2011 22:40:57 +0000 (22:40 +0000)]
Fix assertion failure in -Wuninitialized involving no-op casts.  Fixes PR 10577.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136939 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoKeychainAPI checker: forgot to commit the test with r136930. This should fix the...
Anna Zaks [Thu, 4 Aug 2011 22:40:38 +0000 (22:40 +0000)]
KeychainAPI checker: forgot to commit the test with r136930. This should fix the bot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136938 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPut a few warnings into a DiagGroup. Feel free to improve the flag name!
Matt Beaumont-Gay [Thu, 4 Aug 2011 22:35:03 +0000 (22:35 +0000)]
Put a few warnings into a DiagGroup. Feel free to improve the flag name!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136937 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoKeychainAPI checker: Track additional pair of SecKeychain APIs. Also, keep exploring...
Anna Zaks [Thu, 4 Aug 2011 21:53:01 +0000 (21:53 +0000)]
KeychainAPI checker: Track additional pair of SecKeychain APIs. Also, keep exploring the transition on which a call to allocator function failed (to be able to find errors in examples like ErrorCodesFromDifferentAPISDoNotInterfere).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136930 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhitespace.
Chad Rosier [Thu, 4 Aug 2011 21:50:29 +0000 (21:50 +0000)]
Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136929 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoobjective-c: diagnose protocol inconsistencies in following
Fariborz Jahanian [Thu, 4 Aug 2011 21:28:44 +0000 (21:28 +0000)]
objective-c: diagnose protocol inconsistencies in following
situation. When a class explicitly or implicitly (through inheritance)
"conformsTo" two protocols which conflict (have methods which conflict).
This is 2nd part of // rdar://6191214.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136927 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFormatting.
Chad Rosier [Thu, 4 Aug 2011 21:26:30 +0000 (21:26 +0000)]
Formatting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136924 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd a new libclang API to return a CXCompletionString for an arbitrary
Douglas Gregor [Thu, 4 Aug 2011 20:04:59 +0000 (20:04 +0000)]
Add a new libclang API to return a CXCompletionString for an arbitrary
cursor, from Connor Wakamo! Addresses <rdar://problem/9087798>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136911 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix style and remove obviously redundant code.
Chad Rosier [Thu, 4 Aug 2011 19:25:14 +0000 (19:25 +0000)]
Fix style and remove obviously redundant code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136907 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoClean up the debug dump for a Module, so the local->global maps are
Douglas Gregor [Thu, 4 Aug 2011 19:00:50 +0000 (19:00 +0000)]
Clean up the debug dump for a Module, so the local->global maps are
clearly called out, and add the missing local -> global selector map
output.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136903 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIntroduce local -> global mapping for preprocessed entity IDs. This is
Douglas Gregor [Thu, 4 Aug 2011 18:56:47 +0000 (18:56 +0000)]
Introduce local -> global mapping for preprocessed entity IDs. This is
the last of the ID/offset/index mappings that I know
of. Unfortunately, the "gap" method of testing doesn't work here due
to the way the preprocessing record performs iteration. We'll do more
testing once multi-AST loading is possible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136902 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove the unset, unused return value of
Douglas Gregor [Thu, 4 Aug 2011 18:09:14 +0000 (18:09 +0000)]
Remove the unset, unused return value of
ASTReader::ReadMacroRecord(). No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136893 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdditional comments and whitespace.
Chad Rosier [Thu, 4 Aug 2011 17:52:43 +0000 (17:52 +0000)]
Additional comments and whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136892 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMatch type names and give more info for out-of-line function definition errors.
Kaelyn Uhrain [Thu, 4 Aug 2011 17:40:00 +0000 (17:40 +0000)]
Match type names and give more info for out-of-line function definition errors.

Having a function declaration and definition with different types for a
parameter where the types have same (textual) name can occur when an unqualified
type name resolves to types in different namespaces in each location.

The error messages have been extended by adding notes that point to the first
parameter of the function definition that doesn't match the declaration, instead
of a generic "member declaration nearly matches". The generic message is still
used in cases where the mismatch is not in the paramenter list, such as
mismatched cv qualifiers on the member function itself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136891 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoKeychainAPI checker: Refactor to make it easier to add more allocator/deallocator...
Anna Zaks [Thu, 4 Aug 2011 17:28:06 +0000 (17:28 +0000)]
KeychainAPI checker: Refactor to make it easier to add more allocator/deallocator API pairs. Add the allocator function ID to the checker state. Better comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136889 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIn the AST reader and writer, slide the preprocessed entity IDs by +1
Douglas Gregor [Thu, 4 Aug 2011 17:06:18 +0000 (17:06 +0000)]
In the AST reader and writer, slide the preprocessed entity IDs by +1
so that we use ID zero as a sentinel for "no result". This matches the
convention set by all of the other global IDs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136885 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd some missing record names to the AST output. No functionality change, but llvm...
Douglas Gregor [Thu, 4 Aug 2011 16:39:39 +0000 (16:39 +0000)]
Add some missing record names to the AST output. No functionality change, but llvm-bcanalyzer will be a little more informative now for AST files

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136883 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplement the local -> global remapping for macro definition IDs in
Douglas Gregor [Thu, 4 Aug 2011 16:36:56 +0000 (16:36 +0000)]
Implement the local -> global remapping for macro definition IDs in
the detailed preprocessing record. Tested with the standard "gaps" method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136882 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThe AST reader was forgetting to parse ObjCInferRelatedReturnType
Douglas Gregor [Thu, 4 Aug 2011 15:46:00 +0000 (15:46 +0000)]
The AST reader was forgetting to parse ObjCInferRelatedReturnType

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136879 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoParsing of C++0x lambda expressions, from John Freeman with help from
Douglas Gregor [Thu, 4 Aug 2011 15:30:47 +0000 (15:30 +0000)]
Parsing of C++0x lambda expressions, from John Freeman with help from
David Blaikie!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136876 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThis test still hangs on win32, despite XFAIL it. Remove XFAIL.
Ted Kremenek [Thu, 4 Aug 2011 03:24:35 +0000 (03:24 +0000)]
This test still hangs on win32, despite XFAIL it.  Remove XFAIL.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136864 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTake -Wvector-conversions out of -Wmost; it needs a lot of
John McCall [Thu, 4 Aug 2011 01:26:15 +0000 (01:26 +0000)]
Take -Wvector-conversions out of -Wmost;  it needs a lot of
QoI work.  rdar://problem/9887979.  If some open-source
wants to get an idea for what QoI work I have in mind,
ping me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136860 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd documentation for useBitFieldTypeAlignment.
Chad Rosier [Thu, 4 Aug 2011 01:22:40 +0000 (01:22 +0000)]
Add documentation for useBitFieldTypeAlignment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136859 91177308-0d34-0410-b5e6-96231b3b80d8