summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Properly compute triviality for explicitly-defaulted or deleted special members.Richard Smith2012-12-0821-441/+978
| | | | | | | | | | | | | | Remove pre-standard restriction on explicitly-defaulted copy constructors with 'incorrect' parameter types, and instead just make those special members non-trivial as the standard requires. This required making CXXRecordDecl correctly handle classes which have both a trivial and a non-trivial special member of the same kind. This also fixes PR13217 by reimplementing DiagnoseNontrivial in terms of the new triviality computation technology. llvm-svn: 169667
* [libclang] Resolve a cursor that points to a macro name inside a #ifdef/#ifndefArgyrios Kyrtzidis2012-12-083-2/+47
| | | | | | | | | | directive as a macro expansion. This is more of a "macro reference" than a macro expansion but it's close enough for libclang's purposes. If it causes issues we can revisit and introduce a new kind of cursor. llvm-svn: 169666
* [Preprocessor] Enhance Ifdef/Ifndef/Defined preprocessor callbacks to also passArgyrios Kyrtzidis2012-12-085-21/+38
| | | | | | a MacroInfo object if the identifier was a macro name. llvm-svn: 169665
* Add a FIXME.Richard Smith2012-12-081-0/+1
| | | | llvm-svn: 169664
* Implement C++03 [dcl.init]p5's checking for value-initialization of referencesRichard Smith2012-12-089-16/+143
| | | | | | | | properly, rather than faking it up by pretending that a reference member makes the default constructor non-trivial. That leads to rejects-valids when putting such types inside unions. llvm-svn: 169662
* Currently when AST record layouts are dumped with -fdump-record-layouts, theEli Bendersky2012-12-081-3/+11
| | | | | | | | | | | | | | following: sizeof=132, dsize=132, align=4 nvsize=132, nvalign=4 Is not indented, so when classes are nested there is no way to know to which class it belongs. Fix this problem by indenting the size summary properly for each class. llvm-svn: 169654
* s/AttrListPtr/AttributeSet/g to better label what this class is going to be ↵Bill Wendling2012-12-074-11/+11
| | | | | | in the near future. llvm-svn: 169652
* Fix analysis based warnings so that all warnings are emitted when compilingDeLesley Hutchins2012-12-075-2/+19
| | | | | | | | | 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. llvm-svn: 169649
* Appease -Wnon-virtual-dtorMatt Beaumont-Gay2012-12-071-0/+2
| | | | llvm-svn: 169648
* [libclang] Declarations inside anonymous namespaces have internal linkage soArgyrios Kyrtzidis2012-12-072-10/+4
| | | | | | | | | their USR should contain a location. This uniques them from other declarations with the same name but in different translation units. rdar://10546541 llvm-svn: 169647
* [analyzer] Rename the option help to reflect better what it does.Anna Zaks2012-12-071-2/+2
| | | | llvm-svn: 169640
* [analyzer] Optimization heuristic: do not reanalyze every ObjC method asAnna Zaks2012-12-075-22/+82
| | | | | | | | | | | | | | | | | | 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. llvm-svn: 169639
* AST matcher tutorial (Part I)Daniel Jasper2012-12-071-0/+533
| | | | | | | | | | 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. llvm-svn: 169632
* [analyzer] Fix r168019 to work with unpruned paths as well.Jordan Rose2012-12-073-26/+310
| | | | | | | | | | | | | 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) llvm-svn: 169631
* Reduce conversions between Store <-> ImmutableMapRef in RegionStore.Ted Kremenek2012-12-071-147/+151
| | | | | | | This reduces canonicalization of ImmutableMaps. This reduces analysis time of one heavy Objective-C file by another 1%. llvm-svn: 169630
* Add helper method to convert from a RegionStoreRefBindings to a Store.Ted Kremenek2012-12-071-8/+13
| | | | llvm-svn: 169622
* Hexagon TC: forward appropriate args to assemblerMatthew Curtis2012-12-072-0/+19
| | | | llvm-svn: 169611
* Driver/ToolChains.cpp: Add the name CentOS5 32bit gcc44 (aka ↵NAKAMURA Takumi2012-12-071-0/+1
| | | | | | | | i386-redhat-linux6E). Thanks to Bruce Stephens. llvm-svn: 169610
* Clang-format: extracted FormatTokenSource from UnwrappedLineParser.Alexander Kornienko2012-12-073-61/+76
| | | | | | | | | | | | | | 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 llvm-svn: 169605
* Hexagon TC: add cc1 defaults for hexagon-gccMatthew Curtis2012-12-072-3/+15
| | | | | | compatibility llvm-svn: 169599
* Small tweaks to clang-format.Daniel Jasper2012-12-072-3/+12
| | | | | | | Now not joining keywords with '::' and not putting a space between a pointer pointer. llvm-svn: 169594
* Cache queries to lookupPrivateMethod() within ↵Ted Kremenek2012-12-071-1/+29
| | | | | | | | | 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
* Fix the required args count for variadic blocks.John McCall2012-12-078-19/+111
| | | | | | | | | | | | | | | | | 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
* clang/test: Remove "REQUIRES:LP64" in two tests. Each of them have explicit ↵NAKAMURA Takumi2012-12-072-4/+0
| | | | | | triple. llvm-svn: 169587
* Further reduce analysis time by 0.2% on a heavy Objective-C example by ↵Ted Kremenek2012-12-071-8/+9
| | | | | | avoiding over-eager canonicalization of clusters. llvm-svn: 169586
* Unbreak the GCC (4.4 & other bot) builds from r169571.David Blaikie2012-12-071-2/+4
| | | | llvm-svn: 169581
* Add file missed from r169574!Richard Smith2012-12-071-0/+3
| | | | llvm-svn: 169576
* Per [dcl.fct.def.default]p1, don't allow variadic special members to be ↵Richard Smith2012-12-072-0/+30
| | | | | | defaulted. llvm-svn: 169574
* Change RegionStore to always use ImmutableMapRef for processing cluster ↵Ted Kremenek2012-12-071-224/+250
| | | | | | | | | | | | | | 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
* [analyzer] Remove possible pessimizations from r169563.Jordan Rose2012-12-072-5/+3
| | | | | | | | | 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
* test/Index/skip-parsed-bodies/compile_commands.json: Remove XFAIL on cygming.NAKAMURA Takumi2012-12-071-1/+1
| | | | llvm-svn: 169566
* [analyzer] Avoid ProgramStateRef copy constructors.Jordan Rose2012-12-063-6/+8
| | | | | | | | | | 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
* Revert r169557. It seems that the test is too restrictedLogan Chien2012-12-069-26/+4
| | | | | | and will break the build on buildbot. llvm-svn: 169562
* [libclang] Add a test to make sure we skip bodies properly from "#pragma ↵Argyrios Kyrtzidis2012-12-064-1/+21
| | | | | | once" headers. llvm-svn: 169558
* Add i686-linux-android for gcc toolchain detection.Logan Chien2012-12-069-4/+26
| | | | | | | | | * 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
* Add extra truthiness.Richard Smith2012-12-061-1/+1
| | | | llvm-svn: 169555
* Fixes Makefile for Format unit tests.Fariborz Jahanian2012-12-062-2/+2
| | | | llvm-svn: 169554
* hexagon-toolchain.c now passes on win32Matthew Curtis2012-12-061-3/+0
| | | | llvm-svn: 169548
* relax hexagon-toolchain.c even more to accomodate mingw32 targetsMatthew Curtis2012-12-061-143/+143
| | | | llvm-svn: 169544
* relax hexagon-toolchain.c CHECK to accomodate mingw32 targetsMatthew Curtis2012-12-061-2/+2
| | | | llvm-svn: 169543
* Simplify PDiag's move assignment overload a bit, the self-move check isn't ↵Benjamin Kramer2012-12-061-9/+5
| | | | | | | | actually necessary. This just empties out the diag, which is fine. llvm-svn: 169542
* Make sure to initialize the HasSkippedBody bit.Argyrios Kyrtzidis2012-12-062-2/+3
| | | | llvm-svn: 169540
* [libclang] Introduce a new indexing mode where we skip function bodiesArgyrios Kyrtzidis2012-12-0611-27/+420
| | | | | | | | | | | | | | | 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
* Revert "[analyzer] Aggressively cut back on the canonicalization in ↵Ted Kremenek2012-12-061-37/+31
| | | | | | | | RegionStore." Jordan and I discussed this, and we are going to do this another way. llvm-svn: 169538
* Add move semantics to PartialDiagnostic, which can be very expensive to copy.Benjamin Kramer2012-12-061-0/+26
| | | | llvm-svn: 169535
* Un-XFAIL hexagon-toolchain.c test for mingw32Matthew Curtis2012-12-061-2/+2
| | | | llvm-svn: 169533
* Add a bit on FunctionDecl/ObjCMethodDecl to indicate if there was a bodyArgyrios Kyrtzidis2012-12-067-2/+30
| | | | | | that was skipped by the parser. llvm-svn: 169531
* [analyzer] Remove isa<> followed by dyn_cast<>.Jordan Rose2012-12-061-7/+6
| | | | llvm-svn: 169530
* [analyzer] Remove unused fields from ExprEngine.Jordan Rose2012-12-063-26/+10
| | | | | | | 'currStmt', 'CleanedState', and 'EntryNode' were being set, but only ever used locally. llvm-svn: 169529
* [analyzer] Remove checks that predate the linearized CFG.Jordan Rose2012-12-061-10/+1
| | | | llvm-svn: 169528
OpenPOWER on IntegriCloud