Граф коммитов

2188 Коммитов

Автор SHA1 Сообщение Дата
Argyrios Kyrtzidis 66373dd2d5 [libclang] Have c-index-test output more information about a cursor with -cursor-at:
-the location of the cursor
-its extent
-its spelling

Part of radar://11113120

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153707 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-30 00:19:05 +00:00
Argyrios Kyrtzidis f962eb4dde [libclang] Fix CIndexer::isOptEnabled(); not sure what I was thinking there.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153594 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-28 20:42:59 +00:00
Argyrios Kyrtzidis 81b5ac39a9 [libclang] Rename setBackGroundPriority -> setThreadBackgroundPriority.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153566 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-28 02:49:54 +00:00
Argyrios Kyrtzidis 8e7c48a54b [libclang] Fix gcc error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153565 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-28 02:49:50 +00:00
Argyrios Kyrtzidis fdc1795acc [libclang] Introduce options to control the priority for the threads
that libclang creates.

-Introduce CXGlobalOptFlags enum for the new options that can be
 set on the CXIndex object.

-CXGlobalOpt_ThreadBackgroundPriorityForIndexing affects:
  clang_indexSourceFile
  clang_indexTranslationUnit
  clang_parseTranslationUnit
  clang_saveTranslationUnit

-CXGlobalOpt_ThreadBackgroundPriorityForEditing affects:
  clang_reparseTranslationUnit
  clang_codeCompleteAt
  clang_annotateTokens

rdar://9075282

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153562 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-28 02:18:05 +00:00
Argyrios Kyrtzidis bbca564eec [libclang] Put the CIndexer class in the clang namespace instead of having
it at global namespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153561 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-28 02:18:02 +00:00
Argyrios Kyrtzidis 142bcb59c0 [libclang] For clang_saveTranslationUnit, if the AST to save has invalid nodes
due to compiler errors, use a crash recovery thread to do the AST writing for
protection.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153560 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-28 02:17:59 +00:00
Douglas Gregor ba1030698d Introduce a new libclang API to determine the parent context of a code
completion item. For example, if the code completion itself represents
a declaration in a namespace (say, std::vector), then this API
retrieves the cursor kind and name of the namespace (std). Implements
<rdar://problem/11121951>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153545 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-27 23:34:16 +00:00
Argyrios Kyrtzidis b49a29f7e4 [libclang] Introduce indexing option CXIndexOpt_SuppressWarnings, which
disables all compiler warnings.

rdar://11059556

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153539 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-27 21:38:03 +00:00
Argyrios Kyrtzidis 30a2805c2c [libclang] Make sure we don't crash when trying to index code that
managed to insert an @interface as top level decl contained by another
@interface.

A commit to also not allow this as valid code will be coming.

rdar://11105114.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153354 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-23 23:24:18 +00:00
Argyrios Kyrtzidis ccc6f36e53 [libclang] For a CXCursor_ObjCInstanceMethodDecl/CXCursor_ObjCClassMethodDecl cursor,
return from clang_getCursorLocation the start location of the method name.

rdar://11105223

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153303 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-23 03:33:19 +00:00
Ted Kremenek 3739b32a01 Don't include FixIts with a null replacement range. Fixes <rdar://problem/11040133>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153122 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-20 20:49:45 +00:00
Argyrios Kyrtzidis 0822c5f29d [libclang] Have clang_getCursorExtent() return the range of the main file when
the passed cursor is the translation unit cursor.

Patch by Clint Caywood!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153062 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-19 23:17:58 +00:00
Argyrios Kyrtzidis 62d7fea624 [c-index-test] Make it C90 compliant.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152823 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-15 18:48:52 +00:00
Argyrios Kyrtzidis 13c20a77d4 [libclang] A couple of enhancements to c-index-test.
-When printing location avoid printing the filename if it is
same as the main file, not just if it has '.h' extension.
-Make sure we allocate enough bytes for storing as string a
huge line number.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152821 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-15 18:07:22 +00:00
Chad Rosier 2dec85b218 [driver] Parse diagnostic args in the driver.
Previously, only diagnostics thrown by the cc1 process were
actually honoring the diagnostic options given on the command line,
like -Werror.

Reuse the existing code in Frontend currently used for cc1,
adjusting it to not interpret -Wl, linker flags as warnings.

Also fix a faulty test exposed by this change.
It wasn't actually testing anything, and was giving this warning:

clang-3: warning: argument unused during compilation: '-verify'

Which -Werror didn't turn into an error because it was output
by the driver, not the cc1 process, and diagnostic options
weren't parsed by the driver. And you couldn't see the warning
when running the test suite.

Fixes PR12181.
Patch by Dylan Noblesmith <nobled@dreamwidth.org>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152660 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-13 20:09:56 +00:00
NAKAMURA Takumi 74d2a9cfc9 Update library dependencies to add clangEdit on c-index-test and c-arcmt-test.
To link with -static -lclang, linker tries to seek not libclang.so, clang.dll nor libclang.dll.a, but libclang.a. USEDLIBS should have correct dependencies for -static.
(In contrast, USEDLIBS=libclang.so might be enough w/o -static)

FYI, cygwin build (in buildbot) is using -static, due to avoiding weirdness of extremely slower startup lag of clang.exe.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152539 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-11 08:04:40 +00:00
David Blaikie 4e4d08403c Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST).
The member variable is always "LangOpts" and the member function is always "getLangOpts".

Reviewed by Chris Lattner

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152536 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-11 07:00:24 +00:00
John McCall f4b88a4590 Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr to
track whether the referenced declaration comes from an enclosing
local context.  I'm amenable to suggestions about the exact meaning
of this bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152491 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-10 09:33:50 +00:00
Daniel Dunbar 96a0014f9b [AST/Sema/libclang] Replace getSourceRange().getBegin() with getLocStart().
- getSourceRange().getBegin() is about as awesome a pattern as .copy().size().

I already killed the hot paths so this doesn't seem to impact performance on my
tests-of-the-day, but it is a much more sensible (and shorter) pattern.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152419 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-09 18:35:03 +00:00
Argyrios Kyrtzidis 044e645605 [libclang] Enhance clang_getOverriddenCursors.
Basically the current design is:
-for an implementation method, show as overridden the interface method.
  This is not useful, and is inconsistent with the C++ side
-for an interface method, show as overridden the protocols methods (this is desirable)
  and the methods from the categories; methods from categories are not useful
  since they are considered the same method (same USR).
-If there is a protocol method or category method reported, it does not check the
  super class for overridden methods. This is really problematic since
  overridden methods from super class is what we want to give back.

Change clang_getOverriddenCursors to show as overridden any method in the class's
base class, its protocols, or its categories' protocols, that has the same
selector and is of the same kind (class or instance).
If no such method exists, the search continues to the class's superclass,
its protocols, and its categories, and so on. A method from an Objective-C
implementation is considered to override the same methods as its
corresponding method in the interface.

rdar://10967206

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152270 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-08 00:20:03 +00:00
Richard Smith 9fcce65e7e AST representation for user-defined literals, plus just enough of semantic
analysis to make the AST representation testable. They are represented by a
new UserDefinedLiteral AST node, which is a sugared CallExpr. All semantic
properties, including full CodeGen support, are achieved for free by this
representation.

UserDefinedLiterals can never be dependent, so no custom instantiation
behavior is required. They are mangled as if they were direct calls to the
underlying literal operator. This matches g++'s apparent behavior (but not its
actual mangling, which is broken for literal-operator-ids).

User-defined *string* literals are now fully-operational, but the semantic
analysis is quite hacky and needs more work. No other forms of user-defined
literal are created yet, but the AST support for them is present.

This patch committed after midnight because we had already hit the quota for
new kinds of literal yesterday.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152211 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-07 08:35:16 +00:00
Argyrios Kyrtzidis bef35c91b5 [PCH] Mark a PCH file with a flag to indicate if the serialized AST had
compiler errors or not.

-Control whether ASTReader should reject such a PCH by a boolean flag at ASTReader's creation time.
By default, such a PCH file will be rejected with an error when trying to load it.

[libclang] Allow clang_saveTranslationUnit to create a PCH file even if compiler errors
occurred.
-Have libclang API calls accept a PCH that had compiler errors.

The general idea is that we want libclang to stay functional even if a PCH had a compiler error.
rdar://10976363.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152192 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-07 01:51:17 +00:00
Ted Kremenek 30660a8985 Add new code migrator support for migrating existing Objective-C code to use
the new Objective-C NSArray/NSDictionary/NSNumber literal syntax.

This introduces a new library, libEdit, which provides a new way to support
migration of code that improves on the original ARC migrator.  We now believe
that most of its functionality can be refactored into the existing libraries,
and thus this new library may shortly disappear.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152141 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-06 20:06:33 +00:00
Ted Kremenek 1a45a5ff5d Add static analyzer support for new NSArray/NSDictionary/NSNumber literals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152139 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-06 20:06:12 +00:00
Ted Kremenek b3f7542a95 And libclang cursor/indexing support for new Objective-C NSArray/NSDictionary/NSNumber literals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152138 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-06 20:06:06 +00:00
Jim Grosbach a187c5cc7c Add MCRegisterInfo to the MCInstPrinter factory function interface.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152046 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05 19:33:41 +00:00
Argyrios Kyrtzidis b2c60b04a5 Move llvm/ADT/SaveAndRestore.h -> llvm/Support/SaveAndRestore.h.
Needs llvm update.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151829 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-01 19:45:56 +00:00
Daniel Dunbar fc399c7719 Remove stray semi-colon.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151682 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-29 00:20:42 +00:00
Argyrios Kyrtzidis f911242f43 [AST] When we @synthesize a property with a user-defined ivar name,
make sure to record the source location of the ivar name.
[libclang] When indexing @synthesized objc methods, report the @implementation
as the lexical container.

Fixes rdar://10905472

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151635 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-28 17:50:39 +00:00
Argyrios Kyrtzidis 792db266f3 [libclang] When indexing an objc property, also provide information about
the getter/setter objc method entities that the property is associated with.

rdar://10244558

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151634 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-28 17:50:33 +00:00
Argyrios Kyrtzidis d7c15a64ba [AST] Associate the getter/setter methods to a property of a objc class extension.
[libclang] Index the getter/setter methods of a property of a objc class extension.

Fixes rdar://10907597

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151633 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-28 17:50:28 +00:00
Argyrios Kyrtzidis d45d361f2c Move "clang/Analysis/Support/SaveAndRestore.h" to "llvm/ADT/SaveAndRestore.h"
to make it more widely available.

Depends on llvm commit r151564

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151566 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-27 21:09:45 +00:00
Argyrios Kyrtzidis e1d4330ada Don't record nested macro expansions in the preprocessing record,
it can only bring pain when dealing with preprocessor abuse (see: boost).

rdar://10898986

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151427 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25 02:41:16 +00:00
Douglas Gregor 4ca8ac2e61 Implement a new type trait __is_trivially_constructible(T, Args...)
that provides the behavior of the C++11 library trait
std::is_trivially_constructible<T, Args...>, which can't be
implemented purely as a library.

Since __is_trivially_constructible can have zero or more arguments, I
needed to add Yet Another Type Trait Expression Class, this one
handling arbitrary arguments. The next step will be to migrate
UnaryTypeTrait and BinaryTypeTrait over to this new, more general
TypeTrait class.

Fixes the Clang side of <rdar://problem/10895483> / PR12038.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151352 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 07:38:34 +00:00
Ted Kremenek 2775b935fb Update set-xcode-analyzer to work with Xcode repackaging in Xcode 4.3
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151179 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 18:44:35 +00:00
Argyrios Kyrtzidis e0d92a4307 [libclang] Index the field references of a designated initializer, rdar://10906206
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151118 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 02:10:41 +00:00
Dylan Noblesmith c93dc78896 Basic: import IntrusiveRefCntPtr<> into clang namespace
The class name is long enough without the llvm:: added.
Also bring in RefCountedBase and RefCountedBaseVPTR.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150958 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 14:00:23 +00:00
Sebastian Redl 2aed8b8861 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150685 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 12:22:20 +00:00
Sebastian Redl 1548d14f40 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150684 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 11:35:52 +00:00
Sebastian Redl 5f688f4b15 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150682 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 10:58:10 +00:00
Argyrios Kyrtzidis f8490eeb96 [libclang] Do index statements inside a type source info. rdar://10872758
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150647 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 01:12:04 +00:00
David Blaikie 6c44886ed0 Provide common include for all diagnostic headers.
Reviewed by Ted Kremenek.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150616 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 21:58:34 +00:00
David Blaikie ceb15656fb 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150612 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 19:45:34 +00:00
Richard Smith 5677eafb01 Fix typo in r150549.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150555 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 02:07:05 +00:00
Douglas Gregor 011d8b93b7 Implement indexing support for lambdas in libclang (both kinds), as
well as improving the RecursiveASTVisitor's walk of lambda
expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150549 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 00:54:55 +00:00
Argyrios Kyrtzidis 58d2dbea68 [libclang] Indexing: only index implicit template instantiations via an opt-in indexing option.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150517 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 22:23:11 +00:00
Ted Kremenek 7b8290f7e5 Fix use-after-free introduced by me being an idiot.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150461 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 06:54:46 +00:00
Ted Kremenek 7473b1c6e7 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150456 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 02:46:03 +00:00
Dylan Noblesmith 36d592718f drop more llvm:: prefixes on SmallString<>
More cleanup after r149799.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150380 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 12:32:26 +00:00
Dylan Noblesmith 1e4c01b792 drop more llvm:: prefixes on OwningPtr<>
More cleanup after r149798.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150379 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 12:32:21 +00:00
Argyrios Kyrtzidis b70a3bad9c [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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150291 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-11 02:00:00 +00:00
Jim Grosbach fc30829694 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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150273 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 20:37:10 +00:00
Argyrios Kyrtzidis 911d717307 [libclang] Indexing API: fully index using decls and directives.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150268 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 20:10:48 +00:00
Argyrios Kyrtzidis 6d96836387 [libclang] Indexing API: Fully index implict template instantiations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150267 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 20:10:44 +00:00
Argyrios Kyrtzidis ad133ea9ed [libclang] Encode the template specialization parameters of a function
specialization in its USR string.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150264 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 20:10:32 +00:00
Dylan Noblesmith 3d9000dc90 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150201 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-09 20:02:46 +00:00
Argyrios Kyrtzidis 7b318d1699 [libclang] Indexing: When suppressing references, suppress references
of bases in C++ classes. rdar://10768707

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150048 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 03:04:33 +00:00
Argyrios Kyrtzidis 46e75477bd [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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150033 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 01:21:13 +00:00
Argyrios Kyrtzidis d089008483 [libclang] Do not index implicit C++ member functions. rdar://10769813
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150007 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 22:46:16 +00:00
Benjamin Kramer d7a3e2c5f6 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 6496bd10dc.
This reverts commit 7af19b817b.
This reverts commit fdd15602a4.
This reverts commit 00bd44d567.
This reverts commit ef9b60ffed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150006 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 22:29:24 +00:00
David Blaikie 6bd17d2f2e Make use of const-correct ParseCommandLineOptions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150000 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 19:36:38 +00:00
Benjamin Kramer a59d20b135 Print NamedDecls directly to a raw_ostream where possible.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149982 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 11:57:57 +00:00
Douglas Gregor 01d08018b7 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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149977 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 10:09:13 +00:00
Abramo Bagnara 55d23c925b Added location for template keyword in TemplateSpecializationTypeLoc. In the process removed some naming ambiguities.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149870 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 14:41:24 +00:00
Benjamin Kramer 00bd44d567 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149781 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 12:31:12 +00:00
Argyrios Kyrtzidis 1836db0f2c [libclang] Stick to the silly notion that a forward class/protocol
declaration is a reference. rdar://10749990

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149733 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 01:04:58 +00:00
Jim Grosbach 6a9a6d22d7 Pass the SourceMgr to the MCContext for cc1as.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149608 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-02 17:54:07 +00:00
Abramo Bagnara e4b92761b4 Added source location for the template keyword in AST template-id expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149127 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 09:46:47 +00:00
Ted Kremenek 71d9d5cb9d Teach ccc-analyzer about -fobjc-abi-version.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149094 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 23:30:13 +00:00
Fariborz Jahanian bbdfad581f 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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149079 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 20:57:58 +00:00
Argyrios Kyrtzidis ada4fa7978 [driver] Do emit the diagnostics when CompilerInvocation::CreateFromArgs() fails.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148970 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-25 20:00:43 +00:00
Anna Zaks 2c3038edc2 [analyzer] Add the HTML file to the SATest diagnostic diff.
(Uses the functionality which has been in CmpRuns long before.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148868 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24 21:57:35 +00:00
Argyrios Kyrtzidis c15707d8da [libclang] In clang::getCursorKindForDecl() don't return "UnexposedDecl"
for forward references of classes and protocols, this breaks libclang API usage.

rdar://10747438.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148861 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24 21:39:26 +00:00
Argyrios Kyrtzidis 98c16b8b4f [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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148848 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24 19:40:15 +00:00
Argyrios Kyrtzidis 05b7846d87 [libclang] For:
@implementation I(cat)
suppress subsequent references to 'I'.

rdar://10568103

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148730 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-23 21:28:38 +00:00
Argyrios Kyrtzidis 277b156845 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148708 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-23 16:58:45 +00:00
Argyrios Kyrtzidis 145f7b2093 [libclang] Index C++ template specializations, rdar://10732708
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148707 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-23 16:58:41 +00:00
Argyrios Kyrtzidis 55fa1d9b7e [libclang] Index namespaces in C++ qualified lookup of members, rdar://10732798
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148706 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-23 16:58:38 +00:00
Argyrios Kyrtzidis 8818d4570b [libclang] Index C++ constructor initializers, rdar://10732164
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148705 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-23 16:58:36 +00:00
Sebastian Pop 9ec60dfe77 rename -ccc-host-triple into -target
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148582 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-20 22:01:23 +00:00
David Blaikie 3026348bd4 More dead code removal (using -Wunreachable-code)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148577 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-20 21:50:17 +00:00
Douglas Gregor 1f6b2b5c82 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148546 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-20 16:28:04 +00:00
Argyrios Kyrtzidis 0b28928a71 [libclang] Fix crash when indexing attributes, rdar://10702250.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148524 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-20 01:38:51 +00:00
Argyrios Kyrtzidis 7fe90f3bfa [libclang] Make sure Preprocessor is set in ASTUnit during indexing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148319 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17 18:48:07 +00:00
David Blaikie 7530c034c0 Remove unreachable code in Clang. (replace with llvm_unreachable where appropriate or when GCC requires it)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148292 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17 06:56:22 +00:00
David Blaikie 561d3abc88 Remove unnecessary default cases in switches over enums.
This allows -Wswitch-enum to find switches that need updating when these enums are modified.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148281 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17 02:30:50 +00:00
Argyrios Kyrtzidis 5e192a7d60 [libclang] Make clang_getCursorCompletionString not depend on the ASTUnit having
a Sema.

This allows it to work when Sema is not available, like when loading AST files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148279 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17 02:15:54 +00:00
Douglas Gregor ef96ee0be5 De-virtualize getPreviousDecl() and getMostRecentDecl() when we know
we have a redeclarable type, and only use the new virtual versions
(getPreviousDeclImpl() and getMostRecentDeclImpl()) when we don't have
that type information. This keeps us from penalizing users with strict
type information (and is the moral equivalent of a "final" method).

Plus, settle on the names getPreviousDecl() and getMostRecentDecl()
throughout.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148187 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-14 16:38:05 +00:00
Argyrios Kyrtzidis db4d7a5f47 [libclang] If CXIndexOpt_IndexFunctionLocalSymbols is enabled, also
index parameters.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148169 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-14 02:05:51 +00:00
Argyrios Kyrtzidis 22490747c1 [libclang] Add CXIndexOpt_IndexFunctionLocalSymbols indexing option to indicate
that one wants indexing callbacks for function-local symbols as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148160 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-14 00:11:49 +00:00
Eli Friedman 31cbe68430 Revert r148138; it's causing test failures.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148141 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-13 21:33:06 +00:00
Sebastian Pop edd4f3c391 rename -ccc-host-triple into -target
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148138 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-13 20:37:02 +00:00
Rafael Espindola b29d3e73aa Revert 148045 to fix the bots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148049 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-12 21:17:34 +00:00
Rafael Espindola 9f141c4be1 Add a SONAME to the libclang library.
Patch by Sylvestre Ledru.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148045 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-12 21:04:54 +00:00
Argyrios Kyrtzidis 746f5bcbfd Add IsImplicit field in ObjCMessageExpr that is true when the message
was constructed, e.g. for a property access.

This allows the selector identifier locations machinery for ObjCMessageExpr
to function correctly, in that there are not real locations to handle/report for
such a message.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148013 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-12 02:34:39 +00:00
Anna Zaks f46ca24d66 [analyzer] Correct the c++-analyzer symlink
As Matt pointed out, this should be just a link to 'ccc-analyzer'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147661 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-06 17:11:23 +00:00
Anna Zaks e0e7c99410 [analyzer] c++-analyzer should be a symlink.
This fixes a regression from r147643.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147648 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-06 02:19:07 +00:00
Anna Zaks a772b86a6e [analyzer] Update the docs to reflect that gcc is not the only default
compiler option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147645 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-06 01:54:08 +00:00
Anna Zaks dd40b84040 [analyzer] scan-build: If we are on MacOS, use clang as the default
compiler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147644 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-06 01:54:05 +00:00
Anna Zaks f5c5f89a10 [analyzer] Skip --serialize-diagnostic when running scan-build.
Otherwise, the analyzer will try to analyze the serialized diagnostic
file as if it were a source file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147643 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-06 01:54:02 +00:00
Ted Kremenek 5a15d92206 Force set-xcode-analyzer to use the system version of Python installed on OS X.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147483 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-03 22:05:57 +00:00
Douglas Gregor c9d3c7edb5 Eliminate the ForwardDecl/InitiallyForwardDecl bits from ObjCProtocolDecl. They are no longer needed
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147419 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01 22:06:18 +00:00
Douglas Gregor bd9482d859 Eliminate ObjCForwardProtocolDecl, which is redundant now that
ObjCProtocolDecl modules forward declarations properly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147415 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01 21:23:57 +00:00
Douglas Gregor 5e2a1ff9f2 Move the data that corresponds to the definition of a protocol into a
separately-allocated DefinitionData structure. Introduce various
functions that will help with the separation of declarations from
definitions (isThisDeclarationADefinition(), hasDefinition(),
getDefinition()).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147408 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01 19:29:29 +00:00
Douglas Gregor 375bb1413c Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDecl
covers both declarations (@class) and definitions (@interface) of an
Objective-C class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147299 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-27 22:43:10 +00:00
Dylan Noblesmith 89ea416d3f driver: fix unused variable warning
from r147218.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147278 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-26 19:29:47 +00:00
Dylan Noblesmith 8fdb6dee2d Let CompilerInvocation initialization indicate failure
This fixes the FIXMEs in ParseAnalyzeArgs. (Also a
precursor to moving the analyzer into an AST plugin.)

For consistency, do the same with AssemblerInvocation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147218 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 03:05:38 +00:00
Dylan Noblesmith 1770e0dadc remove unneeded config.h includes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147195 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 22:49:47 +00:00
Kevin Enderby 567003e572 Last part of support for generating dwarf for assembly source files. This gets
the clang driver to enable this when assembling a .s file.  rdar://9275556


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147167 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 19:31:58 +00:00
Argyrios Kyrtzidis acca41167c [libclang] In visitPreprocessedEntitiesInRange we are interested in a file region
so translate the range to file locations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147058 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 16:56:38 +00:00
Douglas Gregor 7723fec9b4 Keep track of all declarations of an Objective-C class (both forward
declarations and definitions) as ObjCInterfaceDecls within the same
redeclaration chain. This new representation matches what we do for
C/C++ variables/functions/classes/templates/etc., and makes it
possible to answer the query "where are all of the declarations of
this class?"



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146679 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 20:29:51 +00:00
Argyrios Kyrtzidis db7a800e0b [libclang] Give up on using write(); hopefully unbreaks mingw build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146648 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 06:51:30 +00:00
Argyrios Kyrtzidis 53ba95612c Revert r146646 that was a mistake, and make the intended change in the right file.
Log:
[libclang] Try to unbreak mingw build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146647 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 05:53:37 +00:00
Douglas Gregor 2e5c15be82 Move the definition-specific data of ObjCInterfaceDecl into a
separately-allocated DefinitionData structure, which we manage the
same way as CXXRecordDecl::DefinitionData. This prepares the way for
making ObjCInterfaceDecls redeclarable, to more accurately model
forward declarations of Objective-C classes and eliminate the mutation
of ObjCInterfaceDecl that causes us serious trouble in the AST reader.

Note that ObjCInterfaceDecl's accessors are fairly robust against
being applied to forward declarations, because Clang (and Sema in
particular) doesn't perform RequireCompleteType/hasDefinition() checks
everywhere it has to. Each of these overly-robust cases is marked with
a FIXME, which we can tackle over time.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146644 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 05:27:12 +00:00
Argyrios Kyrtzidis fa39f5b76b [libclang] Install a fatal error handler that will call abort() instead of exit()
when there is a report_fatal_error() call.

rdar://10507984

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146641 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 04:52:41 +00:00
Argyrios Kyrtzidis 643d3ce93c [libclang] Indexing API: provide an attribute list inside CXIdxEntityInfo
so that we can access the attributes of an entity for a reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146616 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 00:05:00 +00:00
Argyrios Kyrtzidis 90fd67af4a [libclang] Suppress indexing references for occurrences of the interface
in a superclass and the protocols in a protocol list.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146615 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 00:04:56 +00:00
Douglas Gregor af764723bf Eliminate the vistigial ObjCClassDecl::ObjCClassRef, and inline its
members into ObjCClassDecl, saving ourselves one pointer per forward
declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146564 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14 17:12:03 +00:00
Argyrios Kyrtzidis c10a4c8baf [libclang] Indexing API: Provide the protocols list for objc categories as well.
rdar://10573361

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146498 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-13 18:47:45 +00:00
Argyrios Kyrtzidis e422e45a6a [libclang] Indexing API: Fix indexing of missed references.
rdar://10567864&10567916

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146497 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-13 18:47:41 +00:00
Argyrios Kyrtzidis c2be04eaec [libclang] Indexing API: Fix suppressing of references in macros and suppress
@class forward references.

rdar://10568080&10568103&10568119

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146496 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-13 18:47:35 +00:00
Argyrios Kyrtzidis 16ed0e6fda [libclang] Add defensive checks to make sure we don't try to dereference
a null pointer after getCursorDecl() is called. rdar://10298421.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146312 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-10 02:36:25 +00:00
Ted Kremenek 0373fcc3e5 Add clang_getDiagnosticSetFromTU() to libclang. Fixes <rdar://problem/10553081>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146287 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 22:28:32 +00:00
Ted Kremenek 52a9b5aa5d Sort exports list.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146286 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 22:28:29 +00:00
Argyrios Kyrtzidis c6994005dc Save category name loc in ObjCCategoryImplDecl, patch by Jason Haslam!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146213 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 00:31:40 +00:00
Argyrios Kyrtzidis 4451746d8f [libclang] Make sure we don't try to handle a CXCursor_NoDeclFound
passed to clang_findReferencesInFile.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146211 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 00:17:49 +00:00
Eli Friedman 6d402dc963 Misc Minix-specific changes to clang:
. move compiler-rt to a separate directory so the -L argument only includes compiler-rt (thanks joerg)
. build all clang subdirs
. switches the Minix platform to ELF
. normalizes toolchain invocation

Patch by Ben Gras.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146206 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 23:54:21 +00:00
Argyrios Kyrtzidis e368a641a0 [libclang] When doing clang_findReferencesInFile, make sure we don't crash
if we come up against a null Decl.

No test case unfortunately. rdar://10457799.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146127 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 01:56:07 +00:00
Argyrios Kyrtzidis bb7f5420bd [libclang] Remove IndexingContext's getScopedContext(), it's not useful
now that client containers can be set via function calls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146117 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 00:54:07 +00:00
Argyrios Kyrtzidis b1febb646b [libclang] Indexing API: provide both the semantic and the lexical container.
They are generally the same except in C++ cases like out-of-line member functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146069 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07 20:44:19 +00:00
Argyrios Kyrtzidis b526a871af [libclang] Fix indexing of C++ bases in a C++ class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146068 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07 20:44:15 +00:00
Argyrios Kyrtzidis 838d3c2320 [libclang] Introduce CXIdxEntityLanguage that indicates the language
of an indexed entity.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146067 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07 20:44:12 +00:00
Argyrios Kyrtzidis 68478b0cc1 [libclang] Index C++ namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146019 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07 05:52:06 +00:00
Ted Kremenek 13eee19646 Tweak serialized diagnostics to support errors with no categories. Fixes <rdar://problem/10538300>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146011 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07 02:08:00 +00:00
Argyrios Kyrtzidis 84b796492d [libclang] API enhancements by Joe Groff!
- Exposes a CXType_Vector type kind for vector types.
- Adds generalized versions of the clang_getArrayElementType and clang_getArraySize functions, named clang_getElementType and clang_getNumElements, which work on array, vector, or complex types.
- Adds additional functions for querying function types. clang_isFunctionTypeVariadic returns true if a function type is variadic. clang_getFunctionCallingConv returns an enumeration value indicating the calling convention of the function type. clang_getNumArgTypes returns the number of static argument types, and clang_getArgType gets the type of an argument.
- Adds a clang_getTypedefDeclUnderlyingType function to get the underlying type from a TypedefDecl cursor.
- Adds a clang_getEnumDeclIntegerType function to get the integer type from an EnumDecl cursor.
- Adds clang_getEnumConstantDeclValue and clang_getEnumConstantDeclUnsignedValue functions to get the value of an EnumConstantDecl as a signed or unsigned long long, respectively.
- Exposes a CXCursor_AsmLabelAttr cursor kind for __asm__("label") attributes.
- Alters clang_getCursorSpelling to return the label value for AsmLabelAttr-kind cursors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145972 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-06 22:05:01 +00:00
Argyrios Kyrtzidis da5f2d2360 [libclang] When indexing a field in a C++ class, return an entity
of kind CXIdxEntity_CXXInstanceVariable. rdar://10522503.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145859 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-05 22:05:28 +00:00
Argyrios Kyrtzidis d977e6b0eb [libclang] Fix infinite loop when doing visitation of an OpaqueValueExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145751 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-03 03:49:47 +00:00
Argyrios Kyrtzidis dcbb2fb871 [libclang] Allow indexing/get-cursor/etc. for the exception variable in a C++ catch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145750 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-03 03:49:44 +00:00
Douglas Gregor 15de72cf58 Introduce a module import declaration, so that we properly represent, e.g.,
__import_module__ std.vector;

in the AST.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145725 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-02 23:23:56 +00:00
Argyrios Kyrtzidis 996e6e564a [libclang] Create a diagnostic set to pass at the end of indexing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145557 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-01 02:42:50 +00:00
Argyrios Kyrtzidis 5c2a1f741e [libclang] Do the ConcurrencyCheck at the beginning of clang_findReferencesInFile.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145455 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 23:21:50 +00:00
Benjamin Kramer 3267e11b4b Preserve constness.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145397 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 12:31:20 +00:00
Benjamin Kramer 85224ae68a Silence GCC warnings, RefCountedBase is meant to be default-initialized here.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145396 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 11:31:35 +00:00
Argyrios Kyrtzidis 7383550585 [libclang] Fix leak in clang_indexSourceFile_Impl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145393 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 08:14:50 +00:00
Argyrios Kyrtzidis b49e728a4d [libclang] Make clang_findReferencesInFile also work on macros (find all expansions/definition
of a macro in a file).

As a bonus, also make searching for declarations more efficient by ignoring
preprocessing entities when we know that we are looking for a declaration.

Fixes rdar://10427411.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145369 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 03:14:11 +00:00
Ted Kremenek 952538d48d Fix serialized diagnostics to handle FixIts that only remove text. Fixes <rdar://problem/10473903>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145339 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 00:30:52 +00:00
Argyrios Kyrtzidis ed8bef44c0 [libclang] Protect against the declaration's SourceRange being invalid
before passing to RangeCompare.

Though no idea how this can occur with the decls returned from
findFileRegionDecls().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145301 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-28 22:38:07 +00:00
Bob Wilson 3e627ae2a9 Install c-index-test and clang-c/Index.h as internal files. rdar://10217046
Specify that these files should be installed to the optional internal
install location as specified by configure's --with-internal-prefix.
If that option is not used, they'll be installed to the default prefix
as before.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145235 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-28 08:03:54 +00:00
Argyrios Kyrtzidis 6f3ce979a7 [libclang] Indexing API: If the client requested to get a CXTranslationUnit after
indexing, honor all the TU options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145229 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-28 04:56:00 +00:00