Commit Graph

41948 Commits

Author SHA1 Message Date
Daniel Jasper 2723403f9e Small tweaks to clang-format.
Now not joining keywords with '::' and not putting a space between
a pointer pointer.

llvm-svn: 169594
2012-12-07 09:52:15 +00:00
Ted Kremenek 245e45af7d 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%.

llvm-svn: 169589
2012-12-07 07:30:19 +00:00
John McCall c818bbb8b2 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.

llvm-svn: 169588
2012-12-07 07:03:17 +00:00
NAKAMURA Takumi 3f2f792673 clang/test: Remove "REQUIRES:LP64" in two tests. Each of them have explicit triple.
llvm-svn: 169587
2012-12-07 06:57:40 +00:00
Ted Kremenek f19db16b0e Further reduce analysis time by 0.2% on a heavy Objective-C example by avoiding over-eager canonicalization of clusters.
llvm-svn: 169586
2012-12-07 06:49:27 +00:00
David Blaikie b006d38476 Unbreak the GCC (4.4 & other bot) builds from r169571.
llvm-svn: 169581
2012-12-07 03:28:20 +00:00
Richard Smith c2f865e8e5 Add file missed from r169574!
llvm-svn: 169576
2012-12-07 02:26:01 +00:00
Richard Smith 50d705b5b0 Per [dcl.fct.def.default]p1, don't allow variadic special members to be defaulted.
llvm-svn: 169574
2012-12-07 02:10:28 +00:00
Ted Kremenek 147784fdf2 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.

llvm-svn: 169571
2012-12-07 01:55:21 +00:00
Jordan Rose d40d321bcd [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.

llvm-svn: 169570
2012-12-07 01:54:38 +00:00
NAKAMURA Takumi 3c114f81b6 test/Index/skip-parsed-bodies/compile_commands.json: Remove XFAIL on cygming.
llvm-svn: 169566
2012-12-07 00:05:36 +00:00
Jordan Rose 6c4e70817c [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.

llvm-svn: 169563
2012-12-06 23:55:34 +00:00
Logan Chien 48a353d339 Revert r169557. It seems that the test is too restricted
and will break the build on buildbot.

llvm-svn: 169562
2012-12-06 23:40:31 +00:00
Argyrios Kyrtzidis fc7f04510c [libclang] Add a test to make sure we skip bodies properly from "#pragma once" headers.
llvm-svn: 169558
2012-12-06 23:04:24 +00:00
Logan Chien 74aa8f1141 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.

llvm-svn: 169557
2012-12-06 22:59:37 +00:00
Richard Smith 39dd38c061 Add extra truthiness.
llvm-svn: 169555
2012-12-06 22:40:09 +00:00
Fariborz Jahanian 19cd502a1d Fixes Makefile for Format unit tests.
llvm-svn: 169554
2012-12-06 22:29:01 +00:00
Matthew Curtis 4446bca53e hexagon-toolchain.c now passes on win32
llvm-svn: 169548
2012-12-06 21:25:18 +00:00
Matthew Curtis 1ece04413c relax hexagon-toolchain.c even more to accomodate mingw32 targets
llvm-svn: 169544
2012-12-06 20:55:41 +00:00
Matthew Curtis ed6f395c68 relax hexagon-toolchain.c CHECK to accomodate mingw32 targets
llvm-svn: 169543
2012-12-06 20:21:20 +00:00
Benjamin Kramer bb09cb6433 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.

llvm-svn: 169542
2012-12-06 20:12:03 +00:00
Argyrios Kyrtzidis 8c1e667b7b Make sure to initialize the HasSkippedBody bit.
llvm-svn: 169540
2012-12-06 19:41:23 +00:00
Argyrios Kyrtzidis 8b71bc7d6b [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.

llvm-svn: 169539
2012-12-06 19:41:16 +00:00
Ted Kremenek cb95a8fd20 Revert "[analyzer] Aggressively cut back on the canonicalization in RegionStore."
Jordan and I discussed this, and we are going to do this another way.

llvm-svn: 169538
2012-12-06 19:40:32 +00:00
Benjamin Kramer bba0a95373 Add move semantics to PartialDiagnostic, which can be very expensive to copy.
llvm-svn: 169535
2012-12-06 19:09:30 +00:00
Matthew Curtis c91f0be499 Un-XFAIL hexagon-toolchain.c test for mingw32
llvm-svn: 169533
2012-12-06 19:03:09 +00:00
Argyrios Kyrtzidis 1eb71a1ba7 Add a bit on FunctionDecl/ObjCMethodDecl to indicate if there was a body
that was skipped by the parser.

llvm-svn: 169531
2012-12-06 18:59:10 +00:00
Jordan Rose b10aae3fec [analyzer] Remove isa<> followed by dyn_cast<>.
llvm-svn: 169530
2012-12-06 18:58:29 +00:00
Jordan Rose 642e063838 [analyzer] Remove unused fields from ExprEngine.
'currStmt', 'CleanedState', and 'EntryNode' were being set, but only ever
used locally.

llvm-svn: 169529
2012-12-06 18:58:26 +00:00
Jordan Rose de606eaf18 [analyzer] Remove checks that predate the linearized CFG.
llvm-svn: 169528
2012-12-06 18:58:22 +00:00
Jordan Rose ff03c1d26d [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.

llvm-svn: 169527
2012-12-06 18:58:18 +00:00
Jordan Rose 5e4e61ddf9 [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).

llvm-svn: 169526
2012-12-06 18:58:15 +00:00
Jordan Rose a64c6dbb98 [analyzer] Speed up ExplodedNode::Profile by avoiding copy constructors.
ProgramStateRef::Retain isn't free!

llvm-svn: 169525
2012-12-06 18:58:12 +00:00
Jordan Rose 1ecba4cc69 [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.

llvm-svn: 169524
2012-12-06 18:58:09 +00:00
Jordan Rose 5f28afc8a1 [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>

llvm-svn: 169523
2012-12-06 18:58:06 +00:00
Jordan Rose 047208027a [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.

llvm-svn: 169522
2012-12-06 18:58:01 +00:00
Alexander Kornienko 578fdd8968 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

llvm-svn: 169520
2012-12-06 18:03:27 +00:00
Fariborz Jahanian a14523f11c Fixes a typo in this test.
llvm-svn: 169519
2012-12-06 17:50:40 +00:00
Alexander Kornienko ecdc7507ab Clang-format: detect unbalanced braces.
Reviewers: klimek, djasper

Reviewed By: klimek

CC: cfe-commits, silvas

Differential Revision: http://llvm-reviews.chandlerc.com/D176

llvm-svn: 169518
2012-12-06 17:49:17 +00:00
Matthew Curtis e8f80a12bd Hexagon TC: Add/improve support for small data
threshold, pic, pie

llvm-svn: 169517
2012-12-06 17:49:03 +00:00
Matthew Curtis ff15a1d2e5 Fix hexagon-toolchain.c test to handle versioned clang executables.
llvm-svn: 169513
2012-12-06 16:01:06 +00:00
Matthew Curtis e689b0570c Hexagon TC: Reimplement Link::ConstructJob to call
linker directly

Rather than calling gcc.

llvm-svn: 169512
2012-12-06 15:46:07 +00:00
Benjamin Kramer 6928cf7826 Sema: Don't emit a warning when __func__ is used in a lambda outside of a function.
Fixes PR14518.

llvm-svn: 169510
2012-12-06 15:42:21 +00:00
NAKAMURA Takumi 8ccff08f76 test/Driver/hexagon-toolchain.c: Unbreak XPASS. Cygwin can be treated as unix-like system.
llvm-svn: 169509
2012-12-06 14:42:56 +00:00
Manuel Klimek c844a46e77 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.

llvm-svn: 169508
2012-12-06 14:42:48 +00:00
Matthew Curtis f10a595eac 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

llvm-svn: 169505
2012-12-06 14:16:43 +00:00
Daniel Jasper 26333c3b6b Improve clang-format's handling of unary operators.
llvm-svn: 169500
2012-12-06 13:16:39 +00:00
Matthew Curtis b69d3da00b Disable hexagon toolchain test on windows targets
llvm-svn: 169498
2012-12-06 13:06:19 +00:00
Matthew Curtis 22dd8da6cd Hexagon TC: Update toolchain to add appropriate include
paths

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

llvm-svn: 169495
2012-12-06 12:43:18 +00:00
NAKAMURA Takumi dbe7d7e965 clang/test/CodeGen/2008-01-07-UnusualIntSize.c: Add triple x86_64. It doesn't assume 32-bit target, for now.
llvm-svn: 169492
2012-12-06 12:05:25 +00:00