]> granicus.if.org Git - clang/log
clang
11 years agoFix analysis based warnings so that all warnings are emitted when compiling
DeLesley Hutchins [Fri, 7 Dec 2012 22:53:48 +0000 (22:53 +0000)]
Fix analysis based warnings so that all warnings are emitted when compiling
with -Werror.  Previously, compiling with -Werror would emit only the first
warning in a compilation unit, because clang assumes that once an error occurs,
further analysis is unlikely to return valid results.  However, warnings that
have been upgraded to errors should not be treated as "errors" in this sense.

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

11 years agoAppease -Wnon-virtual-dtor
Matt Beaumont-Gay [Fri, 7 Dec 2012 22:49:27 +0000 (22:49 +0000)]
Appease -Wnon-virtual-dtor

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

11 years ago[libclang] Declarations inside anonymous namespaces have internal linkage so
Argyrios Kyrtzidis [Fri, 7 Dec 2012 22:41:46 +0000 (22:41 +0000)]
[libclang] Declarations inside anonymous namespaces have internal linkage so
their USR should contain a location.

This uniques them from other declarations with the same name but in different translation units.
rdar://10546541

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

11 years ago[analyzer] Rename the option help to reflect better what it does.
Anna Zaks [Fri, 7 Dec 2012 21:51:50 +0000 (21:51 +0000)]
[analyzer] Rename the option help to reflect better what it does.

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

11 years ago[analyzer] Optimization heuristic: do not reanalyze every ObjC method as
Anna Zaks [Fri, 7 Dec 2012 21:51:47 +0000 (21:51 +0000)]
[analyzer] Optimization heuristic: do not reanalyze every ObjC method as
top level.

This heuristic is already turned on for non-ObjC methods
(inlining-mode=noredundancy). If a method has been previously analyzed,
while being inlined inside of another method, do not reanalyze it as top
level.

This commit applies it to ObjCMethods as well. The main caveat here is
that to catch the retain release errors, we are still going to reanalyze
all the ObjC methods but without inlining turned on.

Gives 21% performance increase on one heavy ObjC benchmark, which
suffered large performance regressions due to ObjC inlining.

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

11 years agoAST matcher tutorial (Part I)
Daniel Jasper [Fri, 7 Dec 2012 20:34:49 +0000 (20:34 +0000)]
AST matcher tutorial (Part I)

This an AST matcher tutorial based on Sam Panzer's document
(https://docs.google.com/a/google.com/document/d/1oTkVLhCdRJUEH1_LDaQdXqe8-aOqT5GLDL9e4MhoFF8/edit).

Checking in now although some parts might be a bit rough so others can
help improving it.

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

11 years ago[analyzer] Fix r168019 to work with unpruned paths as well.
Jordan Rose [Fri, 7 Dec 2012 19:56:29 +0000 (19:56 +0000)]
[analyzer] Fix r168019 to work with unpruned paths as well.

This is the case where the analyzer tries to print out source locations
for code within a synthesized function body, which of course does not have
a valid source location. The previous fix attempted to do this during
diagnostic path pruning, but some diagnostics have pruning disabled, and
so any diagnostic with a path that goes through a synthesized body will
either hit an assertion or emit invalid output.

<rdar://problem/12657843> (again)

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

11 years agoReduce conversions between Store <-> ImmutableMapRef in RegionStore.
Ted Kremenek [Fri, 7 Dec 2012 19:54:25 +0000 (19:54 +0000)]
Reduce conversions between Store <-> ImmutableMapRef in RegionStore.

This reduces canonicalization of ImmutableMaps.  This reduces analysis time
of one heavy Objective-C file by another 1%.

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

11 years agoAdd helper method to convert from a RegionStoreRefBindings to a Store.
Ted Kremenek [Fri, 7 Dec 2012 18:32:08 +0000 (18:32 +0000)]
Add helper method to convert from a RegionStoreRefBindings to a Store.

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

11 years agoHexagon TC: forward appropriate args to assembler
Matthew Curtis [Fri, 7 Dec 2012 17:23:04 +0000 (17:23 +0000)]
Hexagon TC: forward appropriate args to assembler

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

11 years agoDriver/ToolChains.cpp: Add the name CentOS5 32bit gcc44 (aka i386-redhat-linux6E).
NAKAMURA Takumi [Fri, 7 Dec 2012 17:13:18 +0000 (17:13 +0000)]
Driver/ToolChains.cpp: Add the name CentOS5 32bit gcc44 (aka i386-redhat-linux6E).

Thanks to Bruce Stephens.

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

11 years agoClang-format: extracted FormatTokenSource from UnwrappedLineParser.
Alexander Kornienko [Fri, 7 Dec 2012 16:15:44 +0000 (16:15 +0000)]
Clang-format: extracted FormatTokenSource from UnwrappedLineParser.

Summary: FormatTokenLexer is here, FormatTokenBuffer is on the way. This will allow to re-parse unwrapped lines when needed.

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D186

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

11 years agoHexagon TC: add cc1 defaults for hexagon-gcc
Matthew Curtis [Fri, 7 Dec 2012 13:52:44 +0000 (13:52 +0000)]
Hexagon TC: add cc1 defaults for hexagon-gcc
 compatibility

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

11 years agoSmall tweaks to clang-format.
Daniel Jasper [Fri, 7 Dec 2012 09:52:15 +0000 (09:52 +0000)]
Small tweaks to clang-format.

Now not joining keywords with '::' and not putting a space between
a pointer pointer.

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

11 years agoCache queries to lookupPrivateMethod() within ObjCMethodCall::getRuntimeDefinition().
Ted Kremenek [Fri, 7 Dec 2012 07:30:19 +0000 (07:30 +0000)]
Cache queries to lookupPrivateMethod() within ObjCMethodCall::getRuntimeDefinition().

The same queries can happen thousands of times.  This reduces the analysis
time on one heavy Objective-C file by 2.4%.

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

11 years agoFix the required args count for variadic blocks.
John McCall [Fri, 7 Dec 2012 07:03:17 +0000 (07:03 +0000)]
Fix the required args count for variadic blocks.

We were emitting calls to blocks as if all arguments were
required --- i.e. with signature (A,B,C,D,...) rather than
(A,B,...).  This patch fixes that and accounts for the
implicit block-context argument as a required argument.
In addition, this patch changes the function type under which
we call unprototyped functions on platforms like x86-64 that
guarantee compatibility of variadic functions with unprototyped
function types;  previously we would always call such functions
under the LLVM type T (...)*, but now we will call them under
the type T (A,B,C,D,...)*.  This last change should have no
material effect except for making the type conventions more
explicit;  it was a side-effect of the most convenient implementation.

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

11 years agoclang/test: Remove "REQUIRES:LP64" in two tests. Each of them have explicit triple.
NAKAMURA Takumi [Fri, 7 Dec 2012 06:57:40 +0000 (06:57 +0000)]
clang/test: Remove "REQUIRES:LP64" in two tests. Each of them have explicit triple.

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

11 years agoFurther reduce analysis time by 0.2% on a heavy Objective-C example by avoiding over...
Ted Kremenek [Fri, 7 Dec 2012 06:49:27 +0000 (06:49 +0000)]
Further reduce analysis time by 0.2% on a heavy Objective-C example by avoiding over-eager canonicalization of clusters.

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

11 years agoUnbreak the GCC (4.4 & other bot) builds from r169571.
David Blaikie [Fri, 7 Dec 2012 03:28:20 +0000 (03:28 +0000)]
Unbreak the GCC (4.4 & other bot) builds from r169571.

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

11 years agoAdd file missed from r169574!
Richard Smith [Fri, 7 Dec 2012 02:26:01 +0000 (02:26 +0000)]
Add file missed from r169574!

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

11 years agoPer [dcl.fct.def.default]p1, don't allow variadic special members to be defaulted.
Richard Smith [Fri, 7 Dec 2012 02:10:28 +0000 (02:10 +0000)]
Per [dcl.fct.def.default]p1, don't allow variadic special members to be defaulted.

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

11 years agoChange RegionStore to always use ImmutableMapRef for processing cluster bindings.
Ted Kremenek [Fri, 7 Dec 2012 01:55:21 +0000 (01:55 +0000)]
Change RegionStore to always use ImmutableMapRef for processing cluster bindings.

This reduces analysis time by 1.2% on one test case (Objective-C), but
also cleans up some of the code conceptually as well.  We can possible
just make RegionBindingsRef -> RegionBindings, but I wanted to stage
things.

After this, we should revisit Jordan's optimization of not canonicalizing
the immutable AVL trees for the cluster bindings as well.

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

11 years ago[analyzer] Remove possible pessimizations from r169563.
Jordan Rose [Fri, 7 Dec 2012 01:54:38 +0000 (01:54 +0000)]
[analyzer] Remove possible pessimizations from r169563.

Thanks for reminding me about copy-elision, David. Passing references here
doesn't help when we could get move construction in C++11. If we really
cared, we'd use std::swap to steal the reference from the temporary arg,
but it's probably not /that/ critical outside of Profile anyway.

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

11 years agotest/Index/skip-parsed-bodies/compile_commands.json: Remove XFAIL on cygming.
NAKAMURA Takumi [Fri, 7 Dec 2012 00:05:36 +0000 (00:05 +0000)]
test/Index/skip-parsed-bodies/compile_commands.json: Remove XFAIL on cygming.

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

11 years ago[analyzer] Avoid ProgramStateRef copy constructors.
Jordan Rose [Thu, 6 Dec 2012 23:55:34 +0000 (23:55 +0000)]
[analyzer] Avoid ProgramStateRef copy constructors.

Suggested by David Blaikie. ExplodedNode, CallEvent, and CheckerContext all
hang onto their ProgramState, so the accessors can return a reference to the
internal state rather than preemptively copying it. This helps avoid
temporary ProgramStateRefs, though local variables will still (correctly)
do an extra retain and release.

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

11 years agoRevert r169557. It seems that the test is too restricted
Logan Chien [Thu, 6 Dec 2012 23:40:31 +0000 (23:40 +0000)]
Revert r169557.  It seems that the test is too restricted
and will break the build on buildbot.

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

11 years ago[libclang] Add a test to make sure we skip bodies properly from "#pragma once" headers.
Argyrios Kyrtzidis [Thu, 6 Dec 2012 23:04:24 +0000 (23:04 +0000)]
[libclang] Add a test to make sure we skip bodies properly from "#pragma once" headers.

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

11 years agoAdd i686-linux-android for gcc toolchain detection.
Logan Chien [Thu, 6 Dec 2012 22:59:37 +0000 (22:59 +0000)]
Add i686-linux-android for gcc toolchain detection.

* Look for i686-linux-android under <sysroot>/lib/gcc.

* This patch also slightly enhance the test suite for
  Android GCC toolchain detection.

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

11 years agoAdd extra truthiness.
Richard Smith [Thu, 6 Dec 2012 22:40:09 +0000 (22:40 +0000)]
Add extra truthiness.

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

11 years agoFixes Makefile for Format unit tests.
Fariborz Jahanian [Thu, 6 Dec 2012 22:29:01 +0000 (22:29 +0000)]
Fixes Makefile for Format unit tests.

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

11 years agohexagon-toolchain.c now passes on win32
Matthew Curtis [Thu, 6 Dec 2012 21:25:18 +0000 (21:25 +0000)]
hexagon-toolchain.c now passes on win32

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

11 years agorelax hexagon-toolchain.c even more to accomodate mingw32 targets
Matthew Curtis [Thu, 6 Dec 2012 20:55:41 +0000 (20:55 +0000)]
relax hexagon-toolchain.c even more to accomodate mingw32 targets

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

11 years agorelax hexagon-toolchain.c CHECK to accomodate mingw32 targets
Matthew Curtis [Thu, 6 Dec 2012 20:21:20 +0000 (20:21 +0000)]
relax hexagon-toolchain.c CHECK to accomodate mingw32 targets

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

11 years agoSimplify PDiag's move assignment overload a bit, the self-move check isn't actually...
Benjamin Kramer [Thu, 6 Dec 2012 20:12:03 +0000 (20:12 +0000)]
Simplify PDiag's move assignment overload a bit, the self-move check isn't actually necessary.

This just empties out the diag, which is fine.

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

11 years agoMake sure to initialize the HasSkippedBody bit.
Argyrios Kyrtzidis [Thu, 6 Dec 2012 19:41:23 +0000 (19:41 +0000)]
Make sure to initialize the HasSkippedBody bit.

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

11 years ago[libclang] Introduce a new indexing mode where we skip function bodies
Argyrios Kyrtzidis [Thu, 6 Dec 2012 19:41:16 +0000 (19:41 +0000)]
[libclang] Introduce a new indexing mode where we skip function bodies
that were already parsed in the same "indexing session".

An indexing session is defined as using the same CXIndexAction object
for multiple clang_indexSourceFile calls.
Passing CXIndexOpt_SkipParsedBodiesInSession as an indexing option will
enable the mode where we try to skip bodies that were already parsed in
another translation unit.

If a function's body was skipped, the "flags" field in the CXIdxDeclInfo
structure will have "CXIdxDeclFlag_Skipped" bit was set.

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

11 years agoRevert "[analyzer] Aggressively cut back on the canonicalization in RegionStore."
Ted Kremenek [Thu, 6 Dec 2012 19:40:32 +0000 (19:40 +0000)]
Revert "[analyzer] Aggressively cut back on the canonicalization in RegionStore."

Jordan and I discussed this, and we are going to do this another way.

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

11 years agoAdd move semantics to PartialDiagnostic, which can be very expensive to copy.
Benjamin Kramer [Thu, 6 Dec 2012 19:09:30 +0000 (19:09 +0000)]
Add move semantics to PartialDiagnostic, which can be very expensive to copy.

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

11 years agoUn-XFAIL hexagon-toolchain.c test for mingw32
Matthew Curtis [Thu, 6 Dec 2012 19:03:09 +0000 (19:03 +0000)]
Un-XFAIL hexagon-toolchain.c test for mingw32

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

11 years agoAdd a bit on FunctionDecl/ObjCMethodDecl to indicate if there was a body
Argyrios Kyrtzidis [Thu, 6 Dec 2012 18:59:10 +0000 (18:59 +0000)]
Add a bit on FunctionDecl/ObjCMethodDecl to indicate if there was a body
that was skipped by the parser.

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

11 years ago[analyzer] Remove isa<> followed by dyn_cast<>.
Jordan Rose [Thu, 6 Dec 2012 18:58:29 +0000 (18:58 +0000)]
[analyzer] Remove isa<> followed by dyn_cast<>.

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

11 years ago[analyzer] Remove unused fields from ExprEngine.
Jordan Rose [Thu, 6 Dec 2012 18:58:26 +0000 (18:58 +0000)]
[analyzer] Remove unused fields from ExprEngine.

'currStmt', 'CleanedState', and 'EntryNode' were being set, but only ever
used locally.

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

11 years ago[analyzer] Remove checks that predate the linearized CFG.
Jordan Rose [Thu, 6 Dec 2012 18:58:22 +0000 (18:58 +0000)]
[analyzer] Remove checks that predate the linearized CFG.

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

11 years ago[analyzer] Simplify RetainCountChecker's handling of dead symbols.
Jordan Rose [Thu, 6 Dec 2012 18:58:18 +0000 (18:58 +0000)]
[analyzer] Simplify RetainCountChecker's handling of dead symbols.

Previously we made three passes over the set of dead symbols, and removed
them from the state /twice/. Now we combine the autorelease pass and the
symbol death pass, and only have to remove the bindings for the symbols
that leaked.

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

11 years ago[analyzer] Use a smarter algorithm to find the last block in an inlined call.
Jordan Rose [Thu, 6 Dec 2012 18:58:15 +0000 (18:58 +0000)]
[analyzer] Use a smarter algorithm to find the last block in an inlined call.

Previously we would search for the last statement, then back up to the
entrance of the block that contained that statement. Now, while we're
scanning for the statement, we just keep track of which blocks are being
exited (in reverse order).

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

11 years ago[analyzer] Speed up ExplodedNode::Profile by avoiding copy constructors.
Jordan Rose [Thu, 6 Dec 2012 18:58:12 +0000 (18:58 +0000)]
[analyzer] Speed up ExplodedNode::Profile by avoiding copy constructors.

ProgramStateRef::Retain isn't free!

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

11 years ago[analyzer] Use optimized assumeDual for branches.
Jordan Rose [Thu, 6 Dec 2012 18:58:09 +0000 (18:58 +0000)]
[analyzer] Use optimized assumeDual for branches.

This doesn't seem to make much of a difference in practice, but it does
have the potential to avoid a trip through the constraint manager.

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

11 years ago[analyzer] Aggressively cut back on the canonicalization in RegionStore.
Jordan Rose [Thu, 6 Dec 2012 18:58:06 +0000 (18:58 +0000)]
[analyzer] Aggressively cut back on the canonicalization in RegionStore.

Whenever we touch a single bindings cluster multiple times, we can delay
canonicalizing it until the final access. This has some interesting
implications, in particular that we shouldn't remove an /empty/ cluster
from the top-level map until canonicalization.

This is good for a 2% speedup or so on the test case in
<rdar://problem/12810842>

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

11 years ago[analyzer] Remove bindExprAndLocation, which does extra work for no gain.
Jordan Rose [Thu, 6 Dec 2012 18:58:01 +0000 (18:58 +0000)]
[analyzer] Remove bindExprAndLocation, which does extra work for no gain.

This feature was probably intended to improve diagnostics, but was currently
only used when dumping the Environment. It shows what location a given value
was loaded from, e.g. when evaluating an LValueToRValue cast.

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

11 years agoClang-format: IndentCaseLabels option, proper namespace handling
Alexander Kornienko [Thu, 6 Dec 2012 18:03:27 +0000 (18:03 +0000)]
Clang-format: IndentCaseLabels option, proper namespace handling

Summary: + tests arranged in groups, as their number is already quite large.

Reviewers: djasper, klimek

Reviewed By: djasper

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D185

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

11 years agoFixes a typo in this test.
Fariborz Jahanian [Thu, 6 Dec 2012 17:50:40 +0000 (17:50 +0000)]
Fixes a typo in this test.

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

11 years agoClang-format: detect unbalanced braces.
Alexander Kornienko [Thu, 6 Dec 2012 17:49:17 +0000 (17:49 +0000)]
Clang-format: detect unbalanced braces.

Reviewers: klimek, djasper

Reviewed By: klimek

CC: cfe-commits, silvas
Differential Revision: http://llvm-reviews.chandlerc.com/D176

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

11 years agoHexagon TC: Add/improve support for small data
Matthew Curtis [Thu, 6 Dec 2012 17:49:03 +0000 (17:49 +0000)]
Hexagon TC: Add/improve support for small data
 threshold, pic, pie

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

11 years agoFix hexagon-toolchain.c test to handle versioned clang executables.
Matthew Curtis [Thu, 6 Dec 2012 16:01:06 +0000 (16:01 +0000)]
Fix hexagon-toolchain.c test to handle versioned clang executables.

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

11 years agoHexagon TC: Reimplement Link::ConstructJob to call
Matthew Curtis [Thu, 6 Dec 2012 15:46:07 +0000 (15:46 +0000)]
Hexagon TC: Reimplement Link::ConstructJob to call
 linker directly

Rather than calling gcc.

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

11 years agoSema: Don't emit a warning when __func__ is used in a lambda outside of a function.
Benjamin Kramer [Thu, 6 Dec 2012 15:42:21 +0000 (15:42 +0000)]
Sema: Don't emit a warning when __func__ is used in a lambda outside of a function.

Fixes PR14518.

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

11 years agotest/Driver/hexagon-toolchain.c: Unbreak XPASS. Cygwin can be treated as unix-like...
NAKAMURA Takumi [Thu, 6 Dec 2012 14:42:56 +0000 (14:42 +0000)]
test/Driver/hexagon-toolchain.c: Unbreak XPASS. Cygwin can be treated as unix-like system.

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

11 years agoImplements multiple parents in the parent map.
Manuel Klimek [Thu, 6 Dec 2012 14:42:48 +0000 (14:42 +0000)]
Implements multiple parents in the parent map.

Previously we would match the last visited parent, which in the
case of template instantiations was the last instantiated template.

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

11 years agoHexagon TC: Move getHexagonTargetCPU from Tools.cpp to
Matthew Curtis [Thu, 6 Dec 2012 14:16:43 +0000 (14:16 +0000)]
Hexagon TC: Move getHexagonTargetCPU from Tools.cpp to
 ToolChains.cpp

This is in anticipation of forthcoming library path changes.

Also ...
- Fixes some inconsistencies in how the arch is passed to tools.
- Add test cases for various forms of arch flags

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

11 years agoImprove clang-format's handling of unary operators.
Daniel Jasper [Thu, 6 Dec 2012 13:16:39 +0000 (13:16 +0000)]
Improve clang-format's handling of unary operators.

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

11 years agoDisable hexagon toolchain test on windows targets
Matthew Curtis [Thu, 6 Dec 2012 13:06:19 +0000 (13:06 +0000)]
Disable hexagon toolchain test on windows targets

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

11 years agoHexagon TC: Update toolchain to add appropriate include
Matthew Curtis [Thu, 6 Dec 2012 12:43:18 +0000 (12:43 +0000)]
Hexagon TC: Update toolchain to add appropriate include
 paths

- Inherit from Linux rather than ToolChain
- Override AddClangSystemIncludeArgs and AddClangCXXStdlibIncludeArgs
  to properly set include paths.

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

11 years agoclang/test/CodeGen/2008-01-07-UnusualIntSize.c: Add triple x86_64. It doesn't assume...
NAKAMURA Takumi [Thu, 6 Dec 2012 12:05:25 +0000 (12:05 +0000)]
clang/test/CodeGen/2008-01-07-UnusualIntSize.c: Add triple x86_64. It doesn't assume 32-bit target, for now.

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

11 years agoRework the bitfield access IR generation to address PR13619 and
Chandler Carruth [Thu, 6 Dec 2012 11:14:44 +0000 (11:14 +0000)]
Rework the bitfield access IR generation to address PR13619 and
generally support the C++11 memory model requirements for bitfield
accesses by relying more heavily on LLVM's memory model.

The primary change this introduces is to move from a manually aligned
and strided access pattern across the bits of the bitfield to a much
simpler lump access of all bits in the bitfield followed by math to
extract the bits relevant for the particular field.

This simplifies the code significantly, but relies on LLVM to
intelligently lowering these integers.

I have tested LLVM's lowering both synthetically and in benchmarks. The
lowering appears to be functional, and there are no really significant
performance regressions. Different code patterns accessing bitfields
will vary in how this impacts them. The only real regressions I'm seeing
are a few patterns where the LLVM code generation for loads that feed
directly into a mask operation don't take advantage of the x86 ability
to do a smaller load and a cheap zero-extension. This doesn't regress
any benchmark in the nightly test suite on my box past the noise
threshold, but my box is quite noisy. I'll be watching the LNT numbers,
and will look into further improvements to the LLVM lowering as needed.

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

11 years ago"<<" alignment for clang-format.
Daniel Jasper [Thu, 6 Dec 2012 09:56:08 +0000 (09:56 +0000)]
"<<" alignment for clang-format.

Also, small fix for handling the first token correctly.

Review: http://llvm-reviews.chandlerc.com/D177

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

11 years agoUse the BlockDecl captures list to infer the direct captures for a BlockDataRegion...
Ted Kremenek [Thu, 6 Dec 2012 07:17:26 +0000 (07:17 +0000)]
Use the BlockDecl captures list to infer the direct captures for a BlockDataRegion.  Fixes <rdar://problem/12415065>.

We still need to do a recursive walk to determine all static/global variables
referenced by a block, which is needed for region invalidation.

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

11 years agoOnly provide explicit getCapturedRegion() and getOriginalRegion() from referenced_var...
Ted Kremenek [Thu, 6 Dec 2012 07:17:20 +0000 (07:17 +0000)]
Only provide explicit getCapturedRegion() and getOriginalRegion() from referenced_vars_iterator.

This is a nice conceptual cleanup.

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

11 years agoPull logic to map from VarDecl* to captured region using a helper function. WIP.
Ted Kremenek [Thu, 6 Dec 2012 07:17:13 +0000 (07:17 +0000)]
Pull logic to map from VarDecl* to captured region using a helper function.  WIP.

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

11 years agoUse 'getOriginalRegion()' rather than going through the logic to recreate it.
Ted Kremenek [Thu, 6 Dec 2012 07:17:04 +0000 (07:17 +0000)]
Use 'getOriginalRegion()' rather than going through the logic to recreate it.

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

11 years agoFix http://stackoverflow.com/questions/13521163
Richard Smith [Thu, 6 Dec 2012 06:44:44 +0000 (06:44 +0000)]
Fix http://stackoverflow.com/questions/13521163

Don't require that, during template deduction, a template specialization type
as a function parameter has at least as many template arguments as one used in
a function argument (not even if the argument has been resolved to an exact
type); the additional parameters might be provided by default template
arguments in the template. We don't need this check, since we now implement
[temp.deduct.call]p4 with an additional check after deduction.

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

11 years agoDon't use dyn_cast on a Type* which might not be canonical. Fixes an extremely obscur...
Richard Smith [Thu, 6 Dec 2012 03:04:50 +0000 (03:04 +0000)]
Don't use dyn_cast on a Type* which might not be canonical. Fixes an extremely obscure record layout bug.

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

11 years agoDisable clang/test/Preprocessor/macro-multiline.c for now, while investigating lit...
NAKAMURA Takumi [Thu, 6 Dec 2012 01:09:31 +0000 (01:09 +0000)]
Disable clang/test/Preprocessor/macro-multiline.c for now, while investigating lit.ShUtil.parser.

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

11 years agomore test of template declarations in a
Fariborz Jahanian [Thu, 6 Dec 2012 00:57:28 +0000 (00:57 +0000)]
more test of template declarations in a
<declaration> XML tag. // rdar://12378714

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

11 years agoMore C++ testing of declarations embedded in
Fariborz Jahanian [Thu, 6 Dec 2012 00:09:40 +0000 (00:09 +0000)]
More C++ testing of declarations embedded in
<declaration> tag of Comment XML  and fixing
DeclPrint of templates along the way - wip.
//rdar://12378714

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

11 years ago[driver, ms-inline asm] -fms-compatibility enables -fms-extensions, so this should...
Chad Rosier [Wed, 5 Dec 2012 23:35:10 +0000 (23:35 +0000)]
[driver, ms-inline asm] -fms-compatibility enables -fms-extensions, so this should enable
the AsmBlocks language extension as well.
rdar://12808010

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

11 years ago[driver, ms-inline asm] Have -fms-extensions enable the AsmBlocks language
Chad Rosier [Wed, 5 Dec 2012 23:08:09 +0000 (23:08 +0000)]
[driver, ms-inline asm] Have -fms-extensions enable the AsmBlocks language
option.  MS-style inline asm can now be enabled by either -fasm-blocks or
-fms-extensions.
rdar://12808010

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

11 years agoLooks like lit on Windows can't cope with parens here, and in any case, we shouldn...
Richard Smith [Wed, 5 Dec 2012 22:59:28 +0000 (22:59 +0000)]
Looks like lit on Windows can't cope with parens here, and in any case, we shouldn't need them after r169441.

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

11 years agoIn DeclPrint add printing of '= default'
Fariborz Jahanian [Wed, 5 Dec 2012 22:53:06 +0000 (22:53 +0000)]
In DeclPrint add printing of '= default'
in constructors.

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

11 years agoMore workarounds for PR10867.
Richard Smith [Wed, 5 Dec 2012 22:33:14 +0000 (22:33 +0000)]
More workarounds for PR10867.

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

11 years agoIn DeclPrint add printing of 'explicit'
Fariborz Jahanian [Wed, 5 Dec 2012 22:19:06 +0000 (22:19 +0000)]
In DeclPrint add printing of 'explicit'
constructors.

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

11 years agoFix an egregiously broken test. This pattern doesn't work:
Richard Smith [Wed, 5 Dec 2012 22:18:04 +0000 (22:18 +0000)]
Fix an egregiously broken test. This pattern doesn't work:

RUN: a
RUN: b || true

lit expands it to a && b || true, and the || true applies to both commands (thus ignoring failures in 'a')! This is PR10867 again.

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

11 years ago[c-index-test] Introduce '-index-compile-db' which accepts a compilation database...
Argyrios Kyrtzidis [Wed, 5 Dec 2012 21:53:37 +0000 (21:53 +0000)]
[c-index-test] Introduce '-index-compile-db' which accepts a compilation database file
and does an '-index-file' for all compile commands in the database.

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

11 years agoFix name. The array is unboundED.
Bill Wendling [Wed, 5 Dec 2012 21:43:37 +0000 (21:43 +0000)]
Fix name. The array is unboundED.

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

11 years ago[driver, ms-inline asm] MS-Style inline assembly is controlled by the
Chad Rosier [Wed, 5 Dec 2012 21:08:21 +0000 (21:08 +0000)]
[driver, ms-inline asm] MS-Style inline assembly is controlled by the
-fasm-blocks flag, not the -fms-extensions flag.
rdar://12808010

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

11 years agofix comment.
Fariborz Jahanian [Wed, 5 Dec 2012 20:10:11 +0000 (20:10 +0000)]
fix comment.

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

11 years agoTesting C++ declarations embedded in
Fariborz Jahanian [Wed, 5 Dec 2012 19:54:11 +0000 (19:54 +0000)]
Testing C++ declarations embedded in
<declaration> tag of Comment XML.
Added DeclPrint support for constructors
and fix tests accordingly.
This is wip. // rdar://12378714

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

11 years ago[ms-inline asm] Add more tests.
Chad Rosier [Wed, 5 Dec 2012 19:52:05 +0000 (19:52 +0000)]
[ms-inline asm] Add more tests.

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

11 years agoFormat strings: offer a cast to 'unichar' for %C in Objective-C contexts.
Jordan Rose [Wed, 5 Dec 2012 18:44:49 +0000 (18:44 +0000)]
Format strings: offer a cast to 'unichar' for %C in Objective-C contexts.

For most cases where a conversion specifier doesn't match an argument,
we usually guess that the conversion specifier is wrong. However, if
the argument is an integer type and the specifier is %C, it's likely
the user really did mean to print the integer as a character.

(This is more common than %c because there is no way to specify a unichar
literal -- you have to write an integer literal, such as '0x2603',
and then cast it to unichar.)

This does not change the behavior of %S, since there are fewer cases
where printing a literal Unicode *string* is necessary, but this could
easily be changed in the future.

<rdar://problem/11982013>

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

11 years agoFormat strings: add more expression types that don't need parens to cast.
Jordan Rose [Wed, 5 Dec 2012 18:44:44 +0000 (18:44 +0000)]
Format strings: add more expression types that don't need parens to cast.

No functionality change (the test change is a comment only, and the new
functionality can't be tested using the current test).

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

11 years agoFormat strings: a character literal should be printed with %c, not %d.
Jordan Rose [Wed, 5 Dec 2012 18:44:40 +0000 (18:44 +0000)]
Format strings: a character literal should be printed with %c, not %d.

The type of a character literal is 'int' in C, but if the user writes a
character /as/ a literal, we should assume they meant it to be a
character and not a numeric value, and thus offer %c as a correction
rather than %d.

There's a special case for multi-character literals (like 'MooV'), which
have implementation-defined value and usually cannot be printed with %c.
These still use %d as the suggestion.

In C++, the type of a character literal is 'char', and so this problem
doesn't exist.

<rdar://problem/12282316>

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

11 years agoFormat strings: the correct conversion for 'char' is %c, not %d or %hhd.
Jordan Rose [Wed, 5 Dec 2012 18:44:37 +0000 (18:44 +0000)]
Format strings: the correct conversion for 'char' is %c, not %d or %hhd.

We tried to account for 'uint8_t' by saying that /typedefs/ of 'char'
should be corrected as %hhd rather than %c, but the condition was wrong.

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

11 years agoRemove bad and useless enum to bool conversion.
Daniel Jasper [Wed, 5 Dec 2012 16:24:48 +0000 (16:24 +0000)]
Remove bad and useless enum to bool conversion.

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

11 years agoClang-format: parse for and while loops
Alexander Kornienko [Wed, 5 Dec 2012 15:06:06 +0000 (15:06 +0000)]
Clang-format: parse for and while loops

Summary: Adds support for formatting for and while loops.

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D174

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

11 years agoIndentation fixes for clang-format.
Daniel Jasper [Wed, 5 Dec 2012 14:57:28 +0000 (14:57 +0000)]
Indentation fixes for clang-format.

- Fix behavior of memoization together with optimization
- Correctly attribute the PenaltyIndentLevel (breaking directly after "(" did
  not count towards the inner level)
- Recognize more tokens as assignments

Review: http://llvm-reviews.chandlerc.com/D172

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

11 years agoFollow-up to r169286, addresses comments in http://llvm-reviews.chandlerc.com/D164...
Alexander Kornienko [Wed, 5 Dec 2012 13:56:52 +0000 (13:56 +0000)]
Follow-up to r169286, addresses comments in http://llvm-reviews.chandlerc.com/D164#comment-4 : comments and a method rename

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

11 years agoReuse an existing diagnostic for tsan/msan needing -pie error.
Evgeniy Stepanov [Wed, 5 Dec 2012 13:37:12 +0000 (13:37 +0000)]
Reuse an existing diagnostic for tsan/msan needing -pie error.
Add a diagnosting for -fsanitize=memory conflicting with other sanitizers.
Extend tests.

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

11 years agotest/Modules/build-fail-notes.m: Tweak to unbreak Win32 hosts to relax expressions...
NAKAMURA Takumi [Wed, 5 Dec 2012 11:52:45 +0000 (11:52 +0000)]
test/Modules/build-fail-notes.m: Tweak to unbreak Win32 hosts to relax expressions, for now.

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

11 years agoIn C++, if we hit an error in the class-head, don't try to parse the class body.
Richard Smith [Wed, 5 Dec 2012 11:34:06 +0000 (11:34 +0000)]
In C++, if we hit an error in the class-head, don't try to parse the class body.
Our error recovery path may have made the class anonymous, and that has a pretty
disastrous impact on any attempt to parse a class body containing constructors.

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

11 years agoPR14049: Don't say "expanded from macro 'foo'" when 'foo' just happens to be
Richard Smith [Wed, 5 Dec 2012 11:04:55 +0000 (11:04 +0000)]
PR14049: Don't say "expanded from macro 'foo'" when 'foo' just happens to be
the LHS of a token paste. Use "expanded from here" instead when we're not sure
it's actually a macro.

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

11 years agoMinor reorganization. No functionality change.
Richard Smith [Wed, 5 Dec 2012 09:47:49 +0000 (09:47 +0000)]
Minor reorganization. No functionality change.

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