Argyrios Kyrtzidis
210f29f44b
[libclang] Introduce clang_Cursor_getObjCSelectorIndex() function.
...
After getting a cursor with clang_getCursor for a particular source location,
allows querying the cursor in order to find out if the location points to a
selector identifier in an objc method or message expression, and which selector index it is.
rdar://11158946
llvm-svn: 153781
2012-03-30 22:15:48 +00:00
Argyrios Kyrtzidis
191a6a86ad
[libclang] Introduce clang_Cursor_getSpellingNameRange().
...
It retrieves a source range for a piece that forms the cursors spelling name.
Most of the times there is only one range for the complete spelling but for
objc methods and objc message expressions, there are multiple pieces for each
selector identifier.
Part of rdar://11113120
llvm-svn: 153775
2012-03-30 20:58:35 +00:00
Argyrios Kyrtzidis
7aa274fff3
[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
llvm-svn: 153707
2012-03-30 00:19:05 +00:00
Douglas Gregor
78254c8880
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>.
llvm-svn: 153545
2012-03-27 23:34:16 +00:00
Ted Kremenek
4a64230ee7
Don't include FixIts with a null replacement range. Fixes <rdar://problem/11040133>.
...
llvm-svn: 153122
2012-03-20 20:49:45 +00:00
Argyrios Kyrtzidis
a15f816e3a
[c-index-test] Make it C90 compliant.
...
llvm-svn: 152823
2012-03-15 18:48:52 +00:00
Argyrios Kyrtzidis
0abc5eb018
[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.
llvm-svn: 152821
2012-03-15 18:07:22 +00:00
Argyrios Kyrtzidis
93db2923da
[libclang] When indexing an objc property, also provide information about
...
the getter/setter objc method entities that the property is associated with.
rdar://10244558
llvm-svn: 151634
2012-02-28 17:50:33 +00:00
Argyrios Kyrtzidis
335c5a42e9
Don't record nested macro expansions in the preprocessing record,
...
it can only bring pain when dealing with preprocessor abuse (see: boost).
rdar://10898986
llvm-svn: 151427
2012-02-25 02:41:16 +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
Argyrios Kyrtzidis
fb7d1455cd
[libclang] Add CXIndexOpt_IndexFunctionLocalSymbols indexing option to indicate
...
that one wants indexing callbacks for function-local symbols as well.
llvm-svn: 148160
2012-01-14 00:11:49 +00:00
Argyrios Kyrtzidis
4d873b725e
[libclang] Indexing API: provide an attribute list inside CXIdxEntityInfo
...
so that we can access the attributes of an entity for a reference.
llvm-svn: 146616
2011-12-15 00:05:00 +00:00
Argyrios Kyrtzidis
ccdf8276a3
[libclang] Indexing API: Fix suppressing of references in macros and suppress
...
@class forward references.
rdar://10568080&10568103&10568119
llvm-svn: 146496
2011-12-13 18:47:35 +00:00
Argyrios Kyrtzidis
663c8ecda1
[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.
llvm-svn: 146069
2011-12-07 20:44:19 +00:00
Argyrios Kyrtzidis
b3c16bad20
[libclang] Fix indexing of C++ bases in a C++ class.
...
llvm-svn: 146068
2011-12-07 20:44:15 +00:00
Argyrios Kyrtzidis
520028802c
[libclang] Introduce CXIdxEntityLanguage that indicates the language
...
of an indexed entity.
llvm-svn: 146067
2011-12-07 20:44:12 +00:00
Argyrios Kyrtzidis
1a10f29b2f
[libclang] When indexing a field in a C++ class, return an entity
...
of kind CXIdxEntity_CXXInstanceVariable. rdar://10522503.
llvm-svn: 145859
2011-12-05 22:05:28 +00:00
Argyrios Kyrtzidis
f2d99b0d38
[libclang] Create a diagnostic set to pass at the end of indexing.
...
llvm-svn: 145557
2011-12-01 02:42:50 +00:00
Argyrios Kyrtzidis
b11f5a4cbb
[libclang] Indexing API: If the client requested to get a CXTranslationUnit after
...
indexing, honor all the TU options.
llvm-svn: 145229
2011-11-28 04:56:00 +00:00
Argyrios Kyrtzidis
4c910b1475
[libclang] Indexing API: Support C++ symbols.
...
llvm-svn: 145058
2011-11-22 07:24:51 +00:00
NAKAMURA Takumi
2a4859aeff
c-index-test.c: Fix syntax according to C.
...
llvm-svn: 144947
2011-11-18 00:51:03 +00:00
Argyrios Kyrtzidis
effdbf55ac
[libclang] Indexing API:
...
-For indexDeclaration, also pass the declaration attributes as an array of cursors.
-Rename CXIndexOpt_OneRefPerFile -> CXIndexOpt_SuppressRedundantRefs, and only pass
a reference if a declaration/definition does not exist in the file.
-Other fixes.
llvm-svn: 144942
2011-11-18 00:26:51 +00:00
Argyrios Kyrtzidis
df15c20979
[libclang] Indexing API: fill the objc category info for a category implementation and
...
do not crash if no client container is registered for a declaration context.
llvm-svn: 144765
2011-11-16 02:35:05 +00:00
Argyrios Kyrtzidis
e4acd23f0b
[libclang] Indexing API: if the CXIndexOpt_OneRefPerFile option is set, only report one reference
...
per file.
llvm-svn: 144763
2011-11-16 02:34:59 +00:00
Argyrios Kyrtzidis
d992e14394
[libclang] Introduce a new function to apply the indexing callbacks on an existing
...
CXTranslationUnit, mainly to be used for indexing a PCH.
llvm-svn: 144623
2011-11-15 06:20:16 +00:00
Argyrios Kyrtzidis
86acd72bd2
[libclang] Slight changes to the indexing API and bigger internal changes for it.
...
llvm-svn: 144577
2011-11-14 22:39:19 +00:00
Argyrios Kyrtzidis
70480496c8
[libclang] Move the check for errors in c-index-test before the TU gets disposed.
...
llvm-svn: 144514
2011-11-13 23:39:14 +00:00
Argyrios Kyrtzidis
e74e8222ee
[libclang] for c-index-test, check for CINDEXTEST_FAILONERROR when doing -test-load-source-reparse
...
llvm-svn: 144509
2011-11-13 22:08:33 +00:00
Argyrios Kyrtzidis
3e429e7cc4
[libclang] Further simplify the indexing API.
...
That stuff can be added later on if we need them.
Also add some const goodness.
llvm-svn: 144446
2011-11-12 02:16:30 +00:00
Benjamin Kramer
b9af5f6eff
Silence compiler warning.
...
llvm-svn: 144386
2011-11-11 14:13:03 +00:00
Ted Kremenek
a0e32fc8b6
[serialized diagnostics]: add test cases for serialized diagnostics, including a test case for no issues, multiple issues, and
...
a single issue. Along the way, tweak c-index-test -read-diagnostics output so it is easier to tell what diagnostics are
child diagnostics.
llvm-svn: 144349
2011-11-11 00:46:43 +00:00
Argyrios Kyrtzidis
7519c5e440
[libclang] Simplify the indexing API.
...
Cut down the number of callbacks to more generic ones. Clients can check
an enum to find out what kind of declaration it is and they can call functions
to get more specific information than the generic provided info.
llvm-svn: 144343
2011-11-11 00:23:36 +00:00
NAKAMURA Takumi
27dd3964ac
c-index-test.c: Fix a comment style. /* It is C source. */
...
llvm-svn: 144274
2011-11-10 10:07:57 +00:00
NAKAMURA Takumi
77d9739249
c-index-test.c: Fix syntax. It is C source.
...
llvm-svn: 144272
2011-11-10 09:30:15 +00:00
Ted Kremenek
d010ba4729
serialized diagnostics: implement full deserialization of clang diagnostics via the libclang API.
...
I've tested it on simple cases and it works. Test cases to follow as well as a few tweaks.
llvm-svn: 144269
2011-11-10 08:43:12 +00:00
Argyrios Kyrtzidis
8c25804ce1
[libclang] For "c-index-test -index-file", print out the names of the callbacks.
...
llvm-svn: 143779
2011-11-05 04:03:35 +00:00
Argyrios Kyrtzidis
7ca77357ce
[libclang] Add missing return in clang_getExpansionLocation that resulted in that function
...
always returning a null file/line/column.
Also add at least one use of clang_getExpansionLocation inside c-index-test that would have
made the tests to catch that.
llvm-svn: 143606
2011-11-03 02:20:36 +00:00
Argyrios Kyrtzidis
cb373e3f31
[libclang] For c-index-test disable caching of code completion results if
...
the CINDEXTEST_COMPLETION_NO_CACHING environment variable is present.
llvm-svn: 143604
2011-11-03 02:20:25 +00:00
Argyrios Kyrtzidis
a109e00bba
[libclang] Introduce use of CINDEXTEST_FAILONERROR environment variable which, if set,
...
will cause c-index-test to return as failed if a compiler error occurred.
llvm-svn: 143243
2011-10-28 22:54:36 +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
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
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
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
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
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
Argyrios Kyrtzidis
3405baa3f0
[libclang] Make c-index-test check CINDEXTEST_REMAP_AFTER_TRIAL environment variable,
...
which when set it determines the trial number after which the remapping of files should
take effect.
llvm-svn: 139511
2011-09-12 18:09:31 +00:00