]> granicus.if.org Git - clang/log
clang
12 years agoAdd helper method to BodyFarm for creatinging integral casts.
Ted Kremenek [Fri, 21 Sep 2012 18:13:23 +0000 (18:13 +0000)]
Add helper method to BodyFarm for creatinging integral casts.

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

12 years agoThread-safety analysis: better handling of unreachable blocks. Fixes a bug
DeLesley Hutchins [Fri, 21 Sep 2012 17:57:00 +0000 (17:57 +0000)]
Thread-safety analysis: better handling of unreachable blocks.  Fixes a bug
where a call to function marked 'noreturn' is followed by unreachable
implicit destructor calls.

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

12 years agoRe-enable faux-bodies by default.
Ted Kremenek [Fri, 21 Sep 2012 17:55:34 +0000 (17:55 +0000)]
Re-enable faux-bodies by default.

Try this again, now that r164392 is in place.

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

12 years agoUse helper method to create DeclRefExprs in BodyFarm, hopefully allevating
Ted Kremenek [Fri, 21 Sep 2012 17:54:35 +0000 (17:54 +0000)]
Use helper method to create DeclRefExprs in BodyFarm, hopefully allevating
them being correctly constructed.

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

12 years agoAdd some structuring comments. No functionality change.
Ted Kremenek [Fri, 21 Sep 2012 17:54:32 +0000 (17:54 +0000)]
Add some structuring comments.  No functionality change.

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

12 years agoUpdate comment.
Chad Rosier [Fri, 21 Sep 2012 17:50:09 +0000 (17:50 +0000)]
Update comment.

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

12 years agoUse MapVectors to make the order we mark virtual functions used by a vtable
Rafael Espindola [Fri, 21 Sep 2012 17:15:24 +0000 (17:15 +0000)]
Use MapVectors to make the order we mark virtual functions used by a vtable
deterministic. Fixes pr13868.

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

12 years agoUpdate for encapsulating the "construct*AlignmentFromInt" methods.
Bill Wendling [Fri, 21 Sep 2012 16:07:49 +0000 (16:07 +0000)]
Update for encapsulating the "construct*AlignmentFromInt" methods.

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

12 years agoRevert r164364, "Flip "faux-bodies" in the analyzer on by default to flush out bugs."
NAKAMURA Takumi [Fri, 21 Sep 2012 12:00:42 +0000 (12:00 +0000)]
Revert r164364, "Flip "faux-bodies" in the analyzer on by default to flush out bugs."

It crashed test/Analysis/Output/blocks.m on some hosts.

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

12 years agoMake warnings about uninitialized fields include the field name.
Hans Wennborg [Fri, 21 Sep 2012 08:58:33 +0000 (08:58 +0000)]
Make warnings about uninitialized fields include the field name.

This makes the wording more informative, and consistent with the other
warnings about uninitialized variables.

Also, me and David who reviewed this couldn't figure out why we would
need to do a lookup to get the name of the variable; so just print the
name directly.

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

12 years agoFlip "faux-bodies" in the analyzer on by default to flush out bugs.
Ted Kremenek [Fri, 21 Sep 2012 06:14:37 +0000 (06:14 +0000)]
Flip "faux-bodies" in the analyzer on by default to flush out bugs.

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

12 years agoSimplify getRuntimeDefinition() back to taking no arguments.
Ted Kremenek [Fri, 21 Sep 2012 06:13:13 +0000 (06:13 +0000)]
Simplify getRuntimeDefinition() back to taking no arguments.

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

12 years agoDoxygen-ify a comment.
Craig Topper [Fri, 21 Sep 2012 04:33:26 +0000 (04:33 +0000)]
Doxygen-ify a comment.

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

12 years agoPR13890: Warn on abstract final classes.
David Blaikie [Fri, 21 Sep 2012 03:21:07 +0000 (03:21 +0000)]
PR13890: Warn on abstract final classes.

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

12 years ago[PCH] After deserializing a DeclContext, if it has external lexical decls but not
Argyrios Kyrtzidis [Fri, 21 Sep 2012 01:30:00 +0000 (01:30 +0000)]
[PCH] After deserializing a DeclContext, if it has external lexical decls but not
external visible decls, call DeclContext::setMustBuildLookupTable so that the
"lazy decls" bit of the LookupPtr is set.

Previously, in non-C++, if there were no new declarations causing the "lazy decls" bit
to be set, then DeclContext::lookups_begin() would fail to return the decls from the PCH.

Fixes rdar://12316296.

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

12 years agoAdd faux-body support for dispatch_once().
Ted Kremenek [Fri, 21 Sep 2012 00:52:24 +0000 (00:52 +0000)]
Add faux-body support for dispatch_once().

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

12 years agoARM: Use a dedicated intrinsic for vector bitwise select.
Jim Grosbach [Fri, 21 Sep 2012 00:18:30 +0000 (00:18 +0000)]
ARM: Use a dedicated intrinsic for vector bitwise select.

The expression based expansion too often results in IR level optimizations
splitting the intermediate values into separate basic blocks, preventing
the formation of the VBSL instruction as the code author intended. In
particular, LICM would often hoist part of the computation out of a loop.

rdar://11011471

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

12 years agoTidy up. Trailing whitespace and 80 columns.
Jim Grosbach [Fri, 21 Sep 2012 00:18:27 +0000 (00:18 +0000)]
Tidy up. Trailing whitespace and 80 columns.

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

12 years agoImplement faux-body-synthesis of well-known functions in the static analyzer when
Ted Kremenek [Fri, 21 Sep 2012 00:09:11 +0000 (00:09 +0000)]
Implement faux-body-synthesis of well-known functions in the static analyzer when
their implementations are unavailable.  Start by simulating dispatch_sync().

This change is largely a bunch of plumbing around something very simple.  We
use AnalysisDeclContext to conjure up a fake function body (using the
current ASTContext) when one does not exist.  This is controlled
under the analyzer-config option "faux-bodies", which is off by default.

The plumbing in this patch is largely to pass the necessary machinery
around.  CallEvent needs the AnalysisDeclContextManager to get
the function definition, as one may get conjured up lazily.

BugReporter and PathDiagnosticLocation needed to be relaxed to handle
invalid locations, as the conjured body has no real source locations.
We do some primitive recovery in diagnostic generation to generate
some reasonable locations (for arrows and events), but it can be
improved.

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

12 years agoConstify method.
Ted Kremenek [Fri, 21 Sep 2012 00:09:05 +0000 (00:09 +0000)]
Constify method.

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

12 years agoEnsure that the Decl* wrapped by an AnalysisDeclContext cannot be changed after
Ted Kremenek [Fri, 21 Sep 2012 00:09:03 +0000 (00:09 +0000)]
Ensure that the Decl* wrapped by an AnalysisDeclContext cannot be changed after
construction.

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

12 years agoRemove unused fields.
Ted Kremenek [Fri, 21 Sep 2012 00:09:01 +0000 (00:09 +0000)]
Remove unused fields.

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

12 years agoSerialize the 'IsConstexpr' bit of VarDecls. Fixes <rdar://problem/12328814>.
Douglas Gregor [Thu, 20 Sep 2012 23:43:29 +0000 (23:43 +0000)]
Serialize the 'IsConstexpr' bit of VarDecls. Fixes <rdar://problem/12328814>.

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

12 years agoThread-safety analysis: fix bug where shared trylock was treated
DeLesley Hutchins [Thu, 20 Sep 2012 23:14:43 +0000 (23:14 +0000)]
Thread-safety analysis: fix bug where shared trylock was treated
as exclusive.

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

12 years agoThread safety analysis: properly canonicalize calls to virtual methods within
DeLesley Hutchins [Thu, 20 Sep 2012 22:18:02 +0000 (22:18 +0000)]
Thread safety analysis: properly canonicalize calls to virtual methods within
lock expressions.

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

12 years agoIf the range in a for range statement doesn't have a viable begin/end function,
Richard Smith [Thu, 20 Sep 2012 21:52:32 +0000 (21:52 +0000)]
If the range in a for range statement doesn't have a viable begin/end function,
but can be dereferenced to form an expression which does have viable begin/end
functions, then typo-correct the range, even if something else goes wrong with
the statement (such as inaccessible begin/end or the wrong type of loop
variable).

In order to ensure we recover correctly and produce any followup diagnostics in
this case, redo semantic analysis on the for-range statement outside of the
diagnostic trap, after issuing the typo-correction.

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

12 years agoFix typo. (s/Explided/Exploded/)
David Blaikie [Thu, 20 Sep 2012 20:59:21 +0000 (20:59 +0000)]
Fix typo. (s/Explided/Exploded/)

Patch by Sean McBride.

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

12 years agoImprovements to my patch in r164143 per
Fariborz Jahanian [Thu, 20 Sep 2012 19:36:41 +0000 (19:36 +0000)]
Improvements to my patch in r164143 per
Richard's comments. // rdar://12202422

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

12 years agoMake the wchar_t promotion test consistent across different hosts by specifying a...
David Blaikie [Thu, 20 Sep 2012 18:57:53 +0000 (18:57 +0000)]
Make the wchar_t promotion test consistent across different hosts by specifying a target triple.

This test behavior differs depending (at least) on whether
sizeof(wchar_t) == sizeof(int) or not.

When they are equal, the first redeclaration will fail because decltype(+L'x')
is unsigned int instead of the expected int. This occurs on ARM.

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

12 years agoRemove a test that is non-portable (cannot be execute on cross builds, for example)
David Blaikie [Thu, 20 Sep 2012 18:42:02 +0000 (18:42 +0000)]
Remove a test that is non-portable (cannot be execute on cross builds, for example)

While it might be nice to have a quick end-to-end sanity test, it's just not
really the right place for it & would require more work to enable lit to
provide a detection flag ("XFAIL: cross" or similar) than the value we get from
having this test. Early on it might've made more sense, but these days we've
got some pretty good coverage across the stack with more targeted tests.

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

12 years agoInclude types when a definition's type differs from a prior declaration.
David Blaikie [Thu, 20 Sep 2012 18:38:57 +0000 (18:38 +0000)]
Include types when a definition's type differs from a prior declaration.

This is some really old code (took me a while to find the test cases) & the
diagnostic text is slightly incorrect (it should really only apply to
re/declarations/, redefinitions are an error regardless of whether the types
match). Not sure if anyone cares about it, though.

For now this just makes the diagnostic more clear in less obvious cases where
the type of a declaration might not be explicitly written (eg: because it
uses decltype)

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

12 years agoAdd some matchers for basic AST nodes.
Daniel Jasper [Thu, 20 Sep 2012 14:12:57 +0000 (14:12 +0000)]
Add some matchers for basic AST nodes.

Patch by Gábor Horváth.
Review: http://llvm-reviews.chandlerc.com/D45

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

12 years agoStmtPrinter: Print floating point literals with the right suffix to disambiguate...
Benjamin Kramer [Thu, 20 Sep 2012 14:07:17 +0000 (14:07 +0000)]
StmtPrinter: Print floating point literals with the right suffix to disambiguate them from integers.

Based on a patch by Olaf Krzikalla, UDL fixes by me.

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

12 years agoBe more consistent about ending suggestions with a '?'
Nico Weber [Thu, 20 Sep 2012 13:02:00 +0000 (13:02 +0000)]
Be more consistent about ending suggestions with a '?'

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

12 years agoclang/test/Analysis: Fix the declaration of strlen() for 32 bit targets.
NAKAMURA Takumi [Thu, 20 Sep 2012 11:03:56 +0000 (11:03 +0000)]
clang/test/Analysis: Fix the declaration of strlen() for 32 bit targets.

  - Inputs/system-header-simulator.h: Declare strlen() with size_t.

  - malloc-interprocedural.c: Move the definition of size_t into the header above.

Then XFAIL can be pruned.

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

12 years agoDisable source fortification on Darwin with AddressSanitizer.
Alexander Potapenko [Thu, 20 Sep 2012 10:10:01 +0000 (10:10 +0000)]
Disable source fortification on Darwin with AddressSanitizer.

ASan doesn't play well with -D_FORTIFY_SOURCE, which is enabled by default starting at OS X 10.7

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

12 years agoProvide better error messages for incorrect matchers.
Daniel Jasper [Thu, 20 Sep 2012 09:24:58 +0000 (09:24 +0000)]
Provide better error messages for incorrect matchers.

By changing the conversion operator into a conversion constructor, we
can enabled based on the template parameters leading to better error
messages. E.g.: stmt(decl()) will now create an error message including:

  note: candidate function not viable: no known conversion from
  'clang::ast_matchers::internal::BindableMatcher<clang::Decl>' to 'const
  clang::ast_matchers::internal::Matcher<clang::Stmt>' for 1st argument

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

12 years agotest/Analysis/malloc-interprocedural.c: Mark it as XFAIL: cygwin,mingw,msvc for now...
NAKAMURA Takumi [Thu, 20 Sep 2012 08:44:12 +0000 (08:44 +0000)]
test/Analysis/malloc-interprocedural.c: Mark it as XFAIL: cygwin,mingw,msvc for now. Investigating.

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

12 years agoThe keywords "true" and "false" shouldn't warn under -Wundef.
Eli Friedman [Thu, 20 Sep 2012 02:38:38 +0000 (02:38 +0000)]
The keywords "true" and "false" shouldn't warn under -Wundef.

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

12 years ago[analyzer] MallocChecker should not do post-call checks on inlined functions.
Jordan Rose [Thu, 20 Sep 2012 01:55:32 +0000 (01:55 +0000)]
[analyzer] MallocChecker should not do post-call checks on inlined functions.

If someone provides their own function called 'strdup', or 'reallocf', or
even 'malloc', and we inlined it, the inlining should have given us all the
malloc-related information we need. If we then try to attach new information
to the return value, we could end up with spurious warnings.

<rdar://problem/12317671>

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

12 years agoRevert "[analyzer] Remove constraints on dead symbols as part of removeDeadBindings."
Jordan Rose [Thu, 20 Sep 2012 01:54:56 +0000 (01:54 +0000)]
Revert "[analyzer] Remove constraints on dead symbols as part of removeDeadBindings."

While we definitely want this optimization in the future, we're not
currently handling constraints on symbolic /expressions/ correctly.
These should stay live even if the SymExpr itself is no longer referenced
because could recreate an identical SymExpr later. Only once the SymExpr
can no longer be recreated -- i.e. a component symbol is dead -- can we
safely remove the constraints on it.

This liveness issue is tracked by <rdar://problem/12333297>.

This reverts r163444 / 24c7f98828e039005cff3bd847e7ab404a6a09f8.

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

12 years agoHandle lambdas where the lambda-declarator is an explicit "(void)". PR13854.
Eli Friedman [Thu, 20 Sep 2012 01:40:23 +0000 (01:40 +0000)]
Handle lambdas where the lambda-declarator is an explicit "(void)".  PR13854.

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

12 years agoPer C++11 [class.friend]p3, the 'friend' keyword must appear first in a
Richard Smith [Thu, 20 Sep 2012 01:31:00 +0000 (01:31 +0000)]
Per C++11 [class.friend]p3, the 'friend' keyword must appear first in a
non-function friend declaration. Patch by Josh Magee!

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

12 years agoPR13881: Add -Wzero-length-array for zero length array extension, and move it into...
Richard Smith [Thu, 20 Sep 2012 01:02:05 +0000 (01:02 +0000)]
PR13881: Add -Wzero-length-array for zero length array extension, and move it into -Wgnu.

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

12 years agoFix a small FIXME involving template partial ordering and
Eli Friedman [Wed, 19 Sep 2012 23:52:13 +0000 (23:52 +0000)]
Fix a small FIXME involving template partial ordering and
member function templates with an rvalue ref qualifier.

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

12 years agoFix function template partial ordering rules for static vs. non-static
Eli Friedman [Wed, 19 Sep 2012 23:27:04 +0000 (23:27 +0000)]
Fix function template partial ordering rules for static vs. non-static
functions.

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

12 years agoccc-analyzer: pass -stdlib=libc++ through to the analyzer.
Benjamin Kramer [Wed, 19 Sep 2012 22:56:24 +0000 (22:56 +0000)]
ccc-analyzer: pass -stdlib=libc++ through to the analyzer.

Otherwise clang can't analyze code that relies on features provided by libc++.

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

12 years agoGrammar.
Eric Christopher [Wed, 19 Sep 2012 22:40:44 +0000 (22:40 +0000)]
Grammar.

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

12 years agoUpdate and expand comment.
Eric Christopher [Wed, 19 Sep 2012 22:01:42 +0000 (22:01 +0000)]
Update and expand comment.

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

12 years agoHandle a captured this for the debug information as well.
Eric Christopher [Wed, 19 Sep 2012 21:47:34 +0000 (21:47 +0000)]
Handle a captured this for the debug information as well.

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

12 years agoFix awkward comment.
Eric Christopher [Wed, 19 Sep 2012 21:47:29 +0000 (21:47 +0000)]
Fix awkward comment.

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

12 years agoThread-safety analysis: Fix warning when EXCLUSIVE_LOCKS_REQUIRED
DeLesley Hutchins [Wed, 19 Sep 2012 19:49:40 +0000 (19:49 +0000)]
Thread-safety analysis:  Fix warning when EXCLUSIVE_LOCKS_REQUIRED
is placed on a function that has no path to the exit block.

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

12 years agoThread-safety analysis: fix ICE when EXCLUSIVE_LOCKS_REQUIRED or
DeLesley Hutchins [Wed, 19 Sep 2012 19:18:29 +0000 (19:18 +0000)]
Thread-safety analysis: fix ICE when EXCLUSIVE_LOCKS_REQUIRED or
LOCKS_EXCLUDED is used on a method with a name that is is not a simple
identifier.

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

12 years agoFix ABI dependent tests by providing an explicit target triple.
David Blaikie [Wed, 19 Sep 2012 18:46:03 +0000 (18:46 +0000)]
Fix ABI dependent tests by providing an explicit target triple.

Patch by Joey Gouly.

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

12 years agoFix test better way.
Fariborz Jahanian [Wed, 19 Sep 2012 16:20:17 +0000 (16:20 +0000)]
Fix test better way.

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

12 years agoAdded link to HowToSetupToolingForLLVM.html. Added missing #include to the example.
Alexander Kornienko [Wed, 19 Sep 2012 15:17:49 +0000 (15:17 +0000)]
Added link to HowToSetupToolingForLLVM.html. Added missing #include to the example.

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

12 years agoAdd some typedefs for clarity.
Rafael Espindola [Wed, 19 Sep 2012 14:11:44 +0000 (14:11 +0000)]
Add some typedefs for clarity.

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

12 years agoASTWriter: Tighten up assertions when emitting a declaration name.
Benjamin Kramer [Wed, 19 Sep 2012 13:40:40 +0000 (13:40 +0000)]
ASTWriter: Tighten up assertions when emitting a declaration name.

clang has recently started to warn about the enum compares:
lib/Serialization/ASTWriter.cpp:2760:31: warning: comparison of literal 256 with expression of type
'clang::DeclarationName::NameKind' is always true [-Wtautological-constant-out-of-range-compare]

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

12 years agoUpdate clang for API change.
Benjamin Kramer [Wed, 19 Sep 2012 13:13:52 +0000 (13:13 +0000)]
Update clang for API change.

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

12 years agoRemove Context argument from TemplateDeductionInfo constructor. It was no longer...
Craig Topper [Wed, 19 Sep 2012 02:26:47 +0000 (02:26 +0000)]
Remove Context argument from TemplateDeductionInfo constructor. It was no longer needed after the unused Context member was removed in r164104.

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

12 years agoTest for r164186.
Eli Friedman [Wed, 19 Sep 2012 01:35:20 +0000 (01:35 +0000)]
Test for r164186.

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

12 years agoAdd the TypeSourceInfo for the lambda call operator to the lambda's
Eli Friedman [Wed, 19 Sep 2012 01:18:11 +0000 (01:18 +0000)]
Add the TypeSourceInfo for the lambda call operator to the lambda's
definition info; it needs to be there because the mangler needs to
access it before we're finished defining the lambda class.
PR12808.

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

12 years agoAdd the freescale_ppc64_tree that should have been included in r164177.
Hal Finkel [Tue, 18 Sep 2012 22:53:24 +0000 (22:53 +0000)]
Add the freescale_ppc64_tree that should have been included in r164177.

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

12 years agoAdd C/C++ header locations for the Freescale SDK.
Hal Finkel [Tue, 18 Sep 2012 22:25:07 +0000 (22:25 +0000)]
Add C/C++ header locations for the Freescale SDK.

The Freescale SDK is based on OpenEmbedded, and this might be useful
for other OpenEmbedded-based configurations as well.

With minor modifications, patch by Tobias von Koch!

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

12 years agoAdd e500mc and e5500 to the list of valid PPC CPU names.
Hal Finkel [Tue, 18 Sep 2012 22:25:03 +0000 (22:25 +0000)]
Add e500mc and e5500 to the list of valid PPC CPU names.

Patch by Tobias von Koch!

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

12 years agoFix a small bug in the way we handle builtin candidates for
Eli Friedman [Tue, 18 Sep 2012 21:52:24 +0000 (21:52 +0000)]
Fix a small bug in the way we handle builtin candidates for
relational operators of enumeration type.  From the gcc testsuite.

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

12 years agoAdd an extra check for invalid decls in the lambda semantic analysis to avoid a crash...
Eli Friedman [Tue, 18 Sep 2012 21:11:30 +0000 (21:11 +0000)]
Add an extra check for invalid decls in the lambda semantic analysis to avoid a crash.  PR13860.

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

12 years agoRemove invalid double colon in test case was previously ignored by FileCheck.
Benjamin Kramer [Tue, 18 Sep 2012 20:59:03 +0000 (20:59 +0000)]
Remove invalid double colon in test case was previously ignored by FileCheck.

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

12 years agominor refactoring of my last check-in.
Fariborz Jahanian [Tue, 18 Sep 2012 17:46:26 +0000 (17:46 +0000)]
minor refactoring of my last check-in.

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

12 years agoc: warn when an integer value comparison with an
Fariborz Jahanian [Tue, 18 Sep 2012 17:37:21 +0000 (17:37 +0000)]
c: warn when an integer value comparison with an
integral expression have the obvious result.
Patch reviewed by John McCall off line.
// rdar://12202422

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

12 years agoFollow up on llvm r164132.
Roman Divacky [Tue, 18 Sep 2012 16:09:16 +0000 (16:09 +0000)]
Follow up on llvm r164132.

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

12 years agoWarn about self references in in-class initializers.
Hans Wennborg [Tue, 18 Sep 2012 15:58:06 +0000 (15:58 +0000)]
Warn about self references in in-class initializers.

This makes Clang warn about self references in in-class initializers,
for example:

  struct S {
    int a = a + 42;
  };

This basically just moves UninitializedFieldVisitor up a bit in
SemaDeclCXX.cpp, and adds a call to it from ActOnCXXInClassMemberInitializer.

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

12 years agoFix isDerivedFrom matcher.
Daniel Jasper [Tue, 18 Sep 2012 14:17:42 +0000 (14:17 +0000)]
Fix isDerivedFrom matcher.

Without this patch, the isDerivedFrom matcher asserts in the
"assert(ClassDecl != NULL);" in the new test, as a
DependentTemplateSpecilizationType is not a sub-type of
TemplateSpecializationType and also does not offer getAsCXXRecordDecl().

I am not sure why this did not cause problems before. It is now (after
the changed implementation of isDerivedFrom) easier to write a matcher
that actually gets into this branch of the code.

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

12 years agoAdd missing matcher for C-style cast expressions.
Daniel Jasper [Tue, 18 Sep 2012 13:36:17 +0000 (13:36 +0000)]
Add missing matcher for C-style cast expressions.

Patch by Gábor Horváth.

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

12 years agoDisable some tests that fail when the x86 backend isn't built.
Benjamin Kramer [Tue, 18 Sep 2012 13:34:01 +0000 (13:34 +0000)]
Disable some tests that fail when the x86 backend isn't built.

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

12 years agoMake all VariadicDynCast-Expr-matchers StatementMatchers
Daniel Jasper [Tue, 18 Sep 2012 13:09:13 +0000 (13:09 +0000)]
Make all VariadicDynCast-Expr-matchers StatementMatchers

Having Expr-subclass-matchers being VariadicDynCast-Expr-matchers does
not provide additional type safety and just makes using them harder. In
the clang AST, expressions are always statements and an expression
matcher can be used anywhere, a statement matcher is expected. Any given
matcher definition still has at least one noun.

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

12 years agoRemove an unused private field exposed by the recent LLVM_DELETED_FUNCTION changes.
Craig Topper [Tue, 18 Sep 2012 05:34:55 +0000 (05:34 +0000)]
Remove an unused private field exposed by the recent LLVM_DELETED_FUNCTION changes.

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

12 years agoRemove an unused private field exposed by the recent LLVM_DELETED_FUNCTION changes.
Craig Topper [Tue, 18 Sep 2012 05:30:57 +0000 (05:30 +0000)]
Remove an unused private field exposed by the recent LLVM_DELETED_FUNCTION changes.

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

12 years agoRemove an unused private field exposed by the recent LLVM_DELETED_FUNCTION changes.
Craig Topper [Tue, 18 Sep 2012 05:21:59 +0000 (05:21 +0000)]
Remove an unused private field exposed by the recent LLVM_DELETED_FUNCTION changes.

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

12 years agoMark unimplemented copy constructors and copy assignment operators with LLVM_DELETED_...
Craig Topper [Tue, 18 Sep 2012 04:52:05 +0000 (04:52 +0000)]
Mark unimplemented copy constructors and copy assignment operators with LLVM_DELETED_FUNCTION.

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

12 years agoIf a comma operator is followed by a token which unambiguously indicates the
Richard Smith [Tue, 18 Sep 2012 00:52:05 +0000 (00:52 +0000)]
If a comma operator is followed by a token which unambiguously indicates the
start of a statement or the end of a compound-statement, diagnose the comma as
a typo for a semicolon. Patch by Ahmed Bougacha! Additional test cases and
minor refactoring by me.

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

12 years agoPer discussion on cfe-dev, remove -Wunique-enums entirely. There
Ted Kremenek [Tue, 18 Sep 2012 00:41:42 +0000 (00:41 +0000)]
Per discussion on cfe-dev, remove -Wunique-enums entirely.  There
is no compelling argument that this is a generally useful warning,
and imposes a strong stylistic argument on code beyond what it was
intended to find warnings in.

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

12 years agoobjective-C: don't warn about class extension property's
Fariborz Jahanian [Mon, 17 Sep 2012 23:57:35 +0000 (23:57 +0000)]
objective-C: don't warn about class extension property's
missing 'assign' attribute as it is determined by its
overridden property in primary class. // rdar://12214070

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

12 years agoobjective-C: add Doug's test for my last patch.
Fariborz Jahanian [Mon, 17 Sep 2012 23:24:36 +0000 (23:24 +0000)]
objective-C: add Doug's test for my last patch.

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

12 years agoobjective-C: improve on warnings about misplacement of method
Fariborz Jahanian [Mon, 17 Sep 2012 23:09:59 +0000 (23:09 +0000)]
objective-C: improve on warnings about misplacement of method
argument names. // rdar://12263549

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

12 years agoAdded an example of an empty case label to avoid confusion.
Alexander Kornienko [Mon, 17 Sep 2012 21:45:21 +0000 (21:45 +0000)]
Added an example of an empty case label to avoid confusion.

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

12 years agoobjective-C: peroform property attribute consistency
Fariborz Jahanian [Mon, 17 Sep 2012 20:57:19 +0000 (20:57 +0000)]
objective-C: peroform property attribute consistency
checking on property declared in class extension.
// rdar://12214070

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

12 years agoobjective-C: issue warning when there is no whitespace
Fariborz Jahanian [Mon, 17 Sep 2012 19:15:26 +0000 (19:15 +0000)]
objective-C: issue warning when there is no whitespace
between objc method parameter name and colon.
// rdar://12263549

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

12 years ago[analyzer] Teach the analyzer about implicit initialization of statics
Anna Zaks [Mon, 17 Sep 2012 19:13:56 +0000 (19:13 +0000)]
[analyzer] Teach the analyzer about implicit initialization of statics
in ObjCMethods.

Extend FunctionTextRegion to represent ObjC methods as well as
functions. Note, it is not clear what type ObjCMethod region should
return. Since the type of the FunctionText region is not currently used,
defer solving this issue.

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

12 years ago-Warc-retain-cycles: look through [^{...} copy] and Block_copy(^{...})
Jordan Rose [Mon, 17 Sep 2012 17:54:30 +0000 (17:54 +0000)]
-Warc-retain-cycles: look through [^{...} copy] and Block_copy(^{...})

Retain cycles happen in the case where a block is persisted past its
life on the stack, and the way that occurs is by copying the block.
We should thus look through any explicit copies we see.

Note that Block_copy is actually a type-safe wrapper for _Block_copy,
which does all the real work.

<rdar://problem/12219663>

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

12 years agoDon't write uninitialized values even if nobody ever asks for it.
Axel Naumann [Mon, 17 Sep 2012 14:26:53 +0000 (14:26 +0000)]
Don't write uninitialized values even if nobody ever asks for it.

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

12 years agoRun install_name_tool to fix the dynamic library ID after it has been copied.
Alexander Potapenko [Mon, 17 Sep 2012 14:18:41 +0000 (14:18 +0000)]
Run install_name_tool to fix the dynamic library ID after it has been copied.
Fixes http://code.google.com/p/address-sanitizer/issues/detail?id=113

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

12 years agoOpen up a few higher-level functions for tools.
Axel Naumann [Mon, 17 Sep 2012 13:14:34 +0000 (13:14 +0000)]
Open up a few higher-level functions for tools.

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

12 years agoFix dead store found by static analyzer.
Ted Kremenek [Sun, 16 Sep 2012 06:18:45 +0000 (06:18 +0000)]
Fix dead store found by static analyzer.

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

12 years agoUpdate the PCH internals documentation to cover chained precompiled
Douglas Gregor [Sun, 16 Sep 2012 01:44:02 +0000 (01:44 +0000)]
Update the PCH internals documentation to cover chained precompiled
headers and modules in more detail. I'd still like to expand on some
of the modules-related issues further, but this is a decent start.

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

12 years agoComment parsing: support \namespace like other commands that contain just a
Dmitri Gribenko [Sat, 15 Sep 2012 21:33:50 +0000 (21:33 +0000)]
Comment parsing: support \namespace like other commands that contain just a
declaration for the entity being documented.

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

12 years agoComment parsing: don't treat typedef to a typedef to a function as a
Dmitri Gribenko [Sat, 15 Sep 2012 21:13:36 +0000 (21:13 +0000)]
Comment parsing: don't treat typedef to a typedef to a function as a
'function-like' type that can be annotated with \param.

Thanks to Eli Friedman for noticing!

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

12 years agoUse LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.
Dmitri Gribenko [Sat, 15 Sep 2012 20:20:27 +0000 (20:20 +0000)]
Use LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.

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

12 years agoMake PTHManager properly noncopyable.
Dmitri Gribenko [Sat, 15 Sep 2012 20:16:46 +0000 (20:16 +0000)]
Make PTHManager properly noncopyable.

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

12 years agoAddress a long-standing FIXME: remove an unused copy constructor and make
Dmitri Gribenko [Sat, 15 Sep 2012 19:23:53 +0000 (19:23 +0000)]
Address a long-standing FIXME: remove an unused copy constructor and make
UnqualifiedId() properly noncopyable.

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