Commit Graph

1881 Commits

Author SHA1 Message Date
Douglas Gregor deb4a2be67 Implement support for dependent Microsoft __if_exists/__if_not_exists
statements. As noted in the documentation for the AST node, the
semantics of __if_exists/__if_not_exists are somewhat different from
the way Visual C++ implements them, because our parsed-template
representation can't accommodate VC++ semantics without serious
contortions. Hopefully this implementation is "good enough".

llvm-svn: 142901
2011-10-25 01:33:02 +00:00
Argyrios Kyrtzidis 429ec024f8 [PCH] When visiting preprocessed entities, make it possible to avoid deserializing
preprocessed entities that are #included in the range that we are interested.

This is useful when we are interested in preprocessed entities of a specific file, e.g
when we are annotating tokens. There is also an optimization where we cache the last
result of PreprocessingRecord::getPreprocessedEntitiesInRange and we re-use it if
there is a call with the same range as before.

rdar://10313365

llvm-svn: 142887
2011-10-25 00:29:50 +00:00
Benjamin Kramer 42d0cbd76e Reduce dependencies.
llvm-svn: 142742
2011-10-23 08:38:37 +00:00
Argyrios Kyrtzidis 9006807dcd [libclang] Don't use C++-style comments in c-index-test.c.
llvm-svn: 142590
2011-10-20 17:21:46 +00:00
John McCall 59207978e6 More metaprogramming with builtin types.
llvm-svn: 142433
2011-10-18 22:28:37 +00:00
Argyrios Kyrtzidis 72a3cf0a4a [libclang] Make sure we do a correct invalid check in clang_getExpansionLocation.
llvm-svn: 142430
2011-10-18 21:59:54 +00:00
John McCall e314e27c58 Macro metaprogramming for builtin types.
llvm-svn: 142420
2011-10-18 21:02:43 +00:00
Argyrios Kyrtzidis 098c4eabd2 [libclang] Since an objc extension semantically continues the interface of the class
don't use unique USRs for them, otherwise we fail to associate @implementation methods
with the methods in extensions.

llvm-svn: 142361
2011-10-18 16:50:06 +00:00
Argyrios Kyrtzidis 0c7735e525 [libclang] Index implicit property references.
llvm-svn: 142355
2011-10-18 15:50:50 +00:00
Argyrios Kyrtzidis 1c7dcd04b8 [libclang] When printing the diagnostic print it with a new line.
llvm-svn: 142354
2011-10-18 15:13:14 +00:00
Argyrios Kyrtzidis 321e30216a [libclang] Index method references.
llvm-svn: 142353
2011-10-18 15:13:11 +00:00
Nick Lewycky 1d617acef9 Wire up support for the controlling the extended dwarf .file directive. With
r142300 but not this patch, clang -S may emit .s files that assemblers other
than llvm-mc can't parse.

llvm-svn: 142301
2011-10-17 23:05:52 +00:00
Matt Beaumont-Gay cb6e5c16ef Silence a -Wc++0x-narrowing warning
llvm-svn: 142292
2011-10-17 22:19:09 +00:00
Argyrios Kyrtzidis 317ebfe18e Try fixing MSVC compiler errors.
llvm-svn: 142289
2011-10-17 22:12:24 +00:00
Argyrios Kyrtzidis dc199a3152 [libclang] Introduce a new high level API for indexing clients that assumes
more of the work involved in indexing a translation unit and simplifies client
implementations.

Only C/ObjC for now, C++ (and comments) to come.

llvm-svn: 142233
2011-10-17 19:48:19 +00:00
John McCall 8a6b59ad97 Add a new placeholder type to represent "unbridged"
casts in ARC.

No semantic analysis yet.

llvm-svn: 142208
2011-10-17 18:09:15 +00:00
Anton Korobeynikov f0c267e6e0 Provide half floating point support as a storage only type.
Lack of half FP was a regression compared to llvm-gcc.

llvm-svn: 142016
2011-10-14 23:23:15 +00:00
Benjamin Kramer b89514a9b8 Change operator<< for raw_ostream and NamedDecl to take a reference instead of a pointer.
Passing a pointer was a bad idea as it collides with the overload for void*.

llvm-svn: 141971
2011-10-14 18:45:37 +00:00
Erik Verbruggen 98ea7f6737 Added clang_getCompletionAnnotation and clang_getCompletionNumAnnotations to
retrieve annotations from completion string.

llvm-svn: 141953
2011-10-14 15:31:08 +00:00
Erik Verbruggen ca98f2a63f Allow for annotate attributes after access specifiers. When such
attributes are found, propagate them to subsequent declarations.

llvm-svn: 141861
2011-10-13 09:41:32 +00:00
Argyrios Kyrtzidis e454986617 [libclang] Allow using getDeclCursorUSR function with a Decl* and not a cursor.
llvm-svn: 141770
2011-10-12 07:07:36 +00:00
Argyrios Kyrtzidis 769c7bcd9a [libclang] Make MakeCXTranslationUnit usable outside CIndex.cpp.
llvm-svn: 141769
2011-10-12 07:07:33 +00:00
Eli Friedman df14b3a837 Initial implementation of __atomic_* (everything except __atomic_is_lock_free).
llvm-svn: 141632
2011-10-11 02:20:01 +00:00
Douglas Gregor e442fe3db9 Make sure we initialize the "extra" data within the libclang code
completion context, in case we end up having no code-completion
callback. Individual instances of this problem are always bugs that
need to be fixed, but it's better to make sure we have initialized
data here.

llvm-svn: 141598
2011-10-10 23:37:54 +00:00
Argyrios Kyrtzidis ffd530f2c0 [libclang] Do ConcurrencyCheck for clang_getLocation as well.
llvm-svn: 141583
2011-10-10 21:57:15 +00:00
John McCall f937c023bf Rename TagDecl::isDefinition -> isCompleteDefinition
for better self-documenting code, since the semantics
are subtly different from getDefinition().

llvm-svn: 141355
2011-10-07 06:10:15 +00:00
Eli Friedman 0dfb889575 Support for C1x _Atomic specifier (see testcase). This is primarily being committed at the moment to help support C++0x <atomic>, but it should be a solid base for implementing the full specification of C1x _Atomic.
Thanks to Jeffrey Yasskin for the thorough review!

llvm-svn: 141330
2011-10-06 23:00:33 +00:00
Erik Verbruggen 338b55cc73 Fixed GCC (C90) and Clang warnings.
llvm-svn: 141281
2011-10-06 11:38:08 +00:00
Erik Verbruggen 2e657ffd8e Added CXAvailability_NotAccessible to indicate that a declaration is available, but not accessible from the current code completion context.
llvm-svn: 141278
2011-10-06 07:27:49 +00:00
Argyrios Kyrtzidis cddafd3969 [libclang] Introduce clang_findReferencesInFile which accepts a cursor, a file,
and a callback and finds all identifier references of the cursor in the file.

rdar://7948304

llvm-svn: 141277
2011-10-06 07:00:54 +00:00
Argyrios Kyrtzidis 3b947f72da [libclang] Move the bulk of clang_getOverriddenCursors into
a cxcursor::getOverriddenCursors C++ function, because SmallVectors
are groovier that malloc'ing buffers.

llvm-svn: 141276
2011-10-06 07:00:46 +00:00
Douglas Gregor 4c362d5310 Expose more statement, expression, and declaration kinds in libclang,
from Manuel Holtgrewe!

llvm-svn: 141200
2011-10-05 19:00:14 +00:00
Bob Wilson 05de0298d2 Rip out flags for controlling C++ "production mode" separately.
This is old leftover cruft from the days when C++ was not yet ready
for prime time.

llvm-svn: 141063
2011-10-04 05:34:14 +00:00
Argyrios Kyrtzidis 52f53fb303 Improve location fidelity of objc decls.
-Add the location of the class name to all objc container decls, not just ObjCInterfaceDecl.
-Make objc decls consistent with the rest of the NamedDecls and have getLocation() point to the
 class name, not the location of '@'.

llvm-svn: 141061
2011-10-04 04:48:02 +00:00
Argyrios Kyrtzidis 12afd70370 [libclang] Introduce CXCursor_CXXAccessSpecifier for C++'s public:/private:/protected: specifiers.
Patch by Paolo Capriotti!

llvm-svn: 140864
2011-09-30 17:58:23 +00:00
Argyrios Kyrtzidis e7e4291448 [libclang] Introduce clang_Range_isNull.
llvm-svn: 140706
2011-09-28 18:14:21 +00:00
NAKAMURA Takumi 37a4674fdc Install c-index-test also on CMake build, following up r140681.
llvm-svn: 140694
2011-09-28 10:50:23 +00:00
Ted Kremenek 7f01c7b5f1 Install c-index-test as part of install-clang-c Makefile rule.
llvm-svn: 140681
2011-09-28 04:39:41 +00:00
Douglas Gregor c0b07286cf When 'bool' is not a built-in type but is defined as a macro, print
'bool' rather than '_Bool' within types, to make things a bit more
readable. Fixes <rdar://problem/10063263>.

llvm-svn: 140650
2011-09-27 22:38:19 +00:00
Argyrios Kyrtzidis 2b0cf60df3 [libclang] Expose array size and element type, patch by Vinay Sajip!
llvm-svn: 140614
2011-09-27 17:44:34 +00:00
Argyrios Kyrtzidis a1bcb6adb5 MSVC is stuck in the 80s.
llvm-svn: 140597
2011-09-27 04:14:36 +00:00
Argyrios Kyrtzidis fd51520d5f [libclang] Refactor the important stuff in clang_getCursor into a cxcursor::getCursor(CXTranslationUnit, SourceLocation) function.
llvm-svn: 140588
2011-09-27 00:30:33 +00:00
Argyrios Kyrtzidis d6e9fa55eb [libclang] Introduce clang_Cursor_isNull and clang_Cursor_getTranslationUnit functions.
llvm-svn: 140587
2011-09-27 00:30:30 +00:00
Argyrios Kyrtzidis a4fa0d8be7 [libclang] Report implicit objc methods for properties when indexing.
Related to rdar://10087069.

llvm-svn: 140551
2011-09-26 19:05:37 +00:00
Argyrios Kyrtzidis 4cdfcae75d Don't map a file:line:col triplet that is inside the preamble range to
a "loaded" location of the precompiled preamble.

Instead, handle specially locations of preprocessed entities:
-When looking up for preprocessed entities, map main file locations inside the
 preamble range to a preamble loaded location.
-When getting the source range of a preprocessing cursor, map preamble loaded
 locations back to main file locations.

Fixes rdar://10175093 & http://llvm.org/PR10999

llvm-svn: 140519
2011-09-26 08:01:41 +00:00
David Blaikie 69609dcead Rename VerifyDiagnosticsClient to VerifyDiagnosticConsumer as per issue 5397
llvm-svn: 140489
2011-09-26 00:38:03 +00:00
David Blaikie e2eefaecc8 Rename DiagnosticClient to DiagnosticConsumer as per issue 5397
llvm-svn: 140479
2011-09-25 23:39:51 +00:00
David Blaikie 9c902b5502 Rename Diagnostic to DiagnosticsEngine as per issue 5397
llvm-svn: 140478
2011-09-25 23:23:43 +00:00
David Blaikie aa347f9392 Removing a bunch of dead returns/breaks after llvm_unreachables.
llvm-svn: 140407
2011-09-23 20:26:49 +00:00
David Blaikie 83d382b1ca Switch assert(0/false) llvm_unreachable.
llvm-svn: 140367
2011-09-23 05:06:16 +00:00