Commit Graph

2053 Commits

Author SHA1 Message Date
Ted Kremenek d87cdd1d11 Update set-xcode-analyzer to work with Xcode repackaging in Xcode 4.3
llvm-svn: 151179
2012-02-22 18:44:35 +00:00
Argyrios Kyrtzidis a1bed4cd96 [libclang] Index the field references of a designated initializer, rdar://10906206
llvm-svn: 151118
2012-02-22 02:10:41 +00:00
Dylan Noblesmith c95d81924d Basic: import IntrusiveRefCntPtr<> into clang namespace
The class name is long enough without the llvm:: added.
Also bring in RefCountedBase and RefCountedBaseVPTR.

llvm-svn: 150958
2012-02-20 14:00:23 +00:00
Sebastian Redl 6047f07e81 Revert "Revert "Make CXXNewExpr contain only a single initialier, and not hold the used constructor itself.""
This reintroduces commit r150682 with a fix for the Bullet benchmark crash.

llvm-svn: 150685
2012-02-16 12:22:20 +00:00
Sebastian Redl c3a3c60040 Revert "Make CXXNewExpr contain only a single initialier, and not hold the used constructor itself."
It leads to a compiler crash in the Bullet benchmark.

This reverts commit r12014.

llvm-svn: 150684
2012-02-16 11:35:52 +00:00
Sebastian Redl 86fab844bb Make CXXNewExpr contain only a single initialier, and not hold the used constructor itself.
Holding the constructor directly makes no sense when list-initialized arrays come into play. The constructor is now held in a CXXConstructExpr, if construction is what is done. The new design can also distinguish properly between list-initialization and direct-initialization, as well as implicit default-initialization constructors and explicit value-initialization constructors. Finally, doing it this way removes redundance from the AST because CXXNewExpr doesn't try to handle both the allocation and the initialization responsibilities.

This breaks the static analysis of new expressions. I've filed PR12014 to track this.

llvm-svn: 150682
2012-02-16 10:58:10 +00:00
Argyrios Kyrtzidis 3454d444dc [libclang] Do index statements inside a type source info. rdar://10872758
llvm-svn: 150647
2012-02-16 01:12:04 +00:00
David Blaikie af90ec11e1 Provide common include for all diagnostic headers.
Reviewed by Ted Kremenek.

llvm-svn: 150616
2012-02-15 21:58:34 +00:00
David Blaikie 040a3a28f1 Remove the unuseful -fdiagnostics-show-name
This option was added in r129614 and doesn't have any use case that I'm aware
of. It's possible that external tools are using these names - and if that's
the case we can certainly reassess the functionality, but for now it lets us
shave out a few unneeded bits from clang.

Move the "StaticDiagNameIndex" table into the only remaining consumer, diagtool.
This removes the actual diagnostic name strings from clang entirely.

Reviewed by Chris Lattner & Ted Kremenek.

llvm-svn: 150612
2012-02-15 19:45:34 +00:00
Richard Smith 19582e85bd Fix typo in r150549.
llvm-svn: 150555
2012-02-15 02:07:05 +00:00
Douglas Gregor 3009383b9f Implement indexing support for lambdas in libclang (both kinds), as
well as improving the RecursiveASTVisitor's walk of lambda
expressions.

llvm-svn: 150549
2012-02-15 00:54:55 +00:00
Argyrios Kyrtzidis 7e747957cd [libclang] Indexing: only index implicit template instantiations via an opt-in indexing option.
llvm-svn: 150517
2012-02-14 22:23:11 +00:00
Ted Kremenek b05119cb00 Fix use-after-free introduced by me being an idiot.
llvm-svn: 150461
2012-02-14 06:54:46 +00:00
Ted Kremenek 914c7e62e8 Implement new DiagnosticsRenderer that packages notes retrieved by clang_getDiagnosticSetFromTU() as
child diagnostics of primary diagnostics.  By using the DiagnosticRenderer, these Diagnostics now
match with those generated for serialized diagnostics.

llvm-svn: 150456
2012-02-14 02:46:03 +00:00
Dylan Noblesmith f1a13f29f2 drop more llvm:: prefixes on SmallString<>
More cleanup after r149799.

llvm-svn: 150380
2012-02-13 12:32:26 +00:00
Dylan Noblesmith 1cd1069b68 drop more llvm:: prefixes on OwningPtr<>
More cleanup after r149798.

llvm-svn: 150379
2012-02-13 12:32:21 +00:00
Argyrios Kyrtzidis d0e58e9be8 [libclang] For a reference of an implicit template instantiation just give
a reference for the instantiation decl. Also test that its location is correct
after previous commit.

llvm-svn: 150291
2012-02-11 02:00:00 +00:00
Jim Grosbach 576452b830 Have the driver pass CPU and target feature information to cc1as.
When creating the MCSubtargetInfo, the assembler driver uses the CPU and
feature string to construct a more accurate model of what instructions
are and are not legal.

rdar://10840476

llvm-svn: 150273
2012-02-10 20:37:10 +00:00
Argyrios Kyrtzidis 4701cf61d7 [libclang] Indexing API: fully index using decls and directives.
llvm-svn: 150268
2012-02-10 20:10:48 +00:00
Argyrios Kyrtzidis e5dc5b31f2 [libclang] Indexing API: Fully index implict template instantiations.
llvm-svn: 150267
2012-02-10 20:10:44 +00:00
Argyrios Kyrtzidis 1b6e5dc6a5 [libclang] Encode the template specialization parameters of a function
specialization in its USR string.

llvm-svn: 150264
2012-02-10 20:10:32 +00:00
Dylan Noblesmith 9345813ddd cmake: create a relative symlink to clang, not absolute
Hardcoding the location of the build directory seems like it would
break at `make install`/packaging time.

llvm-svn: 150201
2012-02-09 20:02:46 +00:00
Argyrios Kyrtzidis 95c0feb5e0 [libclang] Indexing: When suppressing references, suppress references
of bases in C++ classes. rdar://10768707

llvm-svn: 150048
2012-02-08 03:04:33 +00:00
Argyrios Kyrtzidis a2a299e586 [libclang] For CXXOperatorCallExprs, give a valid source location to the DeclRefExpr
that is referencing the member function, so we can index the referenced function.

Fixes rdar://10762375&10324915 & http://llvm.org/PR11192

llvm-svn: 150033
2012-02-08 01:21:13 +00:00
Argyrios Kyrtzidis ea9b81b4c6 [libclang] Do not index implicit C++ member functions. rdar://10769813
llvm-svn: 150007
2012-02-07 22:46:16 +00:00
Benjamin Kramer 7ec12c928a Revert my patches which removed Diagnostic.h includes by moving some operator overloads out of line.
This seems to negatively affect compile time onsome ObjC tests
(which use a lot of partial diagnostics I assume). I have to come
up with a way to keep them inline without including Diagnostic.h
everywhere. Now adding a new diagnostic requires a full rebuild
of e.g. the static analyzer which doesn't even use those diagnostics.

This reverts commit 6496bd10dc3a6d5e3266348f08b6e35f8184bc99.
This reverts commit 7af19b817ba964ac560b50c1ed6183235f699789.
This reverts commit fdd15602a42bbe26185978ef1e17019f6d969aa7.
This reverts commit 00bd44d5677783527d7517c1ffe45e4d75a0f56f.
This reverts commit ef9b60ffed980864a8db26ad30344be429e58ff5.

llvm-svn: 150006
2012-02-07 22:29:24 +00:00
David Blaikie 09d20eefaa Make use of const-correct ParseCommandLineOptions
llvm-svn: 150000
2012-02-07 19:36:38 +00:00
Benjamin Kramer db0fc5131d Print NamedDecls directly to a raw_ostream where possible.
llvm-svn: 149982
2012-02-07 11:57:57 +00:00
Douglas Gregor e31e606ff3 Introduce basic ASTs for lambda expressions. This covers:
- Capturing variables by-reference and by-copy within a lambda
  - The representation of lambda captures
  - The creation of the non-static data members in the lambda class
  that store the captured variables
  - The initialization of the non-static data members from the
  captured variables
  - Pretty-printing lambda expressions

There are a number of FIXMEs, both explicit and implied, including:
  - Creating a field for a capture of 'this'
  - Improved diagnostics for initialization failures when capturing
  variables by copy
  - Dealing with temporaries created during said initialization
  - Template instantiation
  - AST (de-)serialization
  - Binding and returning the lambda expression; turning it into a
  proper temporary
  - Lots and lots of semantic constraints
  - Parameter pack captures

llvm-svn: 149977
2012-02-07 10:09:13 +00:00
Abramo Bagnara 48c05be124 Added location for template keyword in TemplateSpecializationTypeLoc. In the process removed some naming ambiguities.
llvm-svn: 149870
2012-02-06 14:41:24 +00:00
Benjamin Kramer 3307c508c9 Move various diagnostic operator<< overloads out of line and remove includes of Diagnostic.h.
Fix all the files that depended on transitive includes of Diagnostic.h.
With this patch in place changing a diagnostic no longer requires a full rebuild of the StaticAnalyzer.

llvm-svn: 149781
2012-02-04 12:31:12 +00:00
Argyrios Kyrtzidis fcf8d1f82a [libclang] Stick to the silly notion that a forward class/protocol
declaration is a reference. rdar://10749990

llvm-svn: 149733
2012-02-04 01:04:58 +00:00
Jim Grosbach ff3789a6bb Pass the SourceMgr to the MCContext for cc1as.
llvm-svn: 149608
2012-02-02 17:54:07 +00:00
Abramo Bagnara 7945c981b9 Added source location for the template keyword in AST template-id expressions.
llvm-svn: 149127
2012-01-27 09:46:47 +00:00
Ted Kremenek 49db052db4 Teach ccc-analyzer about -fobjc-abi-version.
llvm-svn: 149094
2012-01-26 23:30:13 +00:00
Fariborz Jahanian 48fd81b484 objc-arc: introduce -no-finalize-removal which in gc mode,
leaves "finalize' behind and in arc mode, does not
include it. This allows the migrated source to be compiled
in both gc and arc mode. // rdar://10532441

llvm-svn: 149079
2012-01-26 20:57:58 +00:00
Argyrios Kyrtzidis be6d89d255 [driver] Do emit the diagnostics when CompilerInvocation::CreateFromArgs() fails.
llvm-svn: 148970
2012-01-25 20:00:43 +00:00
Anna Zaks b3d896d333 [analyzer] Add the HTML file to the SATest diagnostic diff.
(Uses the functionality which has been in CmpRuns long before.)

llvm-svn: 148868
2012-01-24 21:57:35 +00:00
Argyrios Kyrtzidis 3698cef19f [libclang] In clang::getCursorKindForDecl() don't return "UnexposedDecl"
for forward references of classes and protocols, this breaks libclang API usage.

rdar://10747438.

llvm-svn: 148861
2012-01-24 21:39:26 +00:00
Argyrios Kyrtzidis d0a27f717e [libclang] When calling clang_getCursorReferenced on a class or protocol
forward reference, do give an interface or protocol cursor back, don't give
an 'UnexposedDecl' one.

rdar://10743193

llvm-svn: 148848
2012-01-24 19:40:15 +00:00
Argyrios Kyrtzidis 18dc04eba2 [libclang] For:
@implementation I(cat)
suppress subsequent references to 'I'.

rdar://10568103

llvm-svn: 148730
2012-01-23 21:28:38 +00:00
Argyrios Kyrtzidis 5c4e065a9a Introduce CXXRecordDecl::isCLike() that is true if the class is C-like,
without C++-specific features.

Use it to set the language to C++ when indexing non-C-like structs.
rdar://10732579

llvm-svn: 148708
2012-01-23 16:58:45 +00:00
Argyrios Kyrtzidis 7e614d7dce [libclang] Index C++ template specializations, rdar://10732708
llvm-svn: 148707
2012-01-23 16:58:41 +00:00
Argyrios Kyrtzidis 9f777356a3 [libclang] Index namespaces in C++ qualified lookup of members, rdar://10732798
llvm-svn: 148706
2012-01-23 16:58:38 +00:00
Argyrios Kyrtzidis 84bd164862 [libclang] Index C++ constructor initializers, rdar://10732164
llvm-svn: 148705
2012-01-23 16:58:36 +00:00
Sebastian Pop 422377cfd3 rename -ccc-host-triple into -target
llvm-svn: 148582
2012-01-20 22:01:23 +00:00
David Blaikie e4d798f078 More dead code removal (using -Wunreachable-code)
llvm-svn: 148577
2012-01-20 21:50:17 +00:00
Douglas Gregor 32fbe31246 Extract the (InputKind, std::string) pair used to describe inputs to
the front end into its own class, FrontendInputFile, to make it easier
to introduce new per-input data. No functionality change.

llvm-svn: 148546
2012-01-20 16:28:04 +00:00
Argyrios Kyrtzidis 908c4dcc5d [libclang] Fix crash when indexing attributes, rdar://10702250.
llvm-svn: 148524
2012-01-20 01:38:51 +00:00
Argyrios Kyrtzidis da6e05476d [libclang] Make sure Preprocessor is set in ASTUnit during indexing.
llvm-svn: 148319
2012-01-17 18:48:07 +00:00