Commit Graph

388 Commits

Author SHA1 Message Date
NAKAMURA Takumi b538ac6830 c-index-test/Makefile: Use -isystem instead of -I on $(LIBXML2_INC) with -Wdocumentation.
-Wdocumentation won't seek -isystem. LIBXML2's headers in a certain distro might be incompatible to -Wdocumentation.

FIXME: Could autoconf detect clang or availability of -isystem?
llvm-svn: 185927
2013-07-09 11:14:24 +00:00
Argyrios Kyrtzidis 7b50fc520f [libclang] Introduce clang_Cursor_isObjCOptional, which returns whether the declaration was affected by "@optional"
rdar://14348525.

llvm-svn: 185722
2013-07-05 20:44:37 +00:00
Reid Kleckner 898229ab4b [Driver] Refactor clang driver to use LLVM's Option library
The big changes are:
- Deleting Driver/(Arg|Opt)*
- Rewriting includes to llvm/Option/ and re-sorting
- 'using namespace llvm::opt' in clang::driver
- Fixing the autoconf build by adding option everywhere

As discussed in the review, this change includes using directives in
header files.  I'll make follow up changes to remove those in favor of
name specifiers.

Reviewers: espindola

Differential Revision: http://llvm-reviews.chandlerc.com/D975

llvm-svn: 183989
2013-06-14 17:17:23 +00:00
Dmitri Gribenko 62770bea4b libclang: add a function to check whether a member function is pure virtual
Patch by Seth Fowler.

llvm-svn: 182139
2013-05-17 18:38:35 +00:00
Argyrios Kyrtzidis 12fdb9e34b [libclang] Introduce clang_Module_getASTFile function that returns the module file where a module object came from.
rdar://13743084

llvm-svn: 180643
2013-04-26 22:47:49 +00:00
Argyrios Kyrtzidis d3afa0c7fb [PCH/modules] Require the preprocessing record option to match the used PCH, if modules are enabled.
The preprocessing record becomes important when modules are enabled, since it is used to calculate the
module cache hash.

llvm-svn: 180635
2013-04-26 21:33:40 +00:00
Argyrios Kyrtzidis 23814e4f49 [libclang] Introduce clang_Cursor_isVariadic, which returns non-zero if the given cursor is a variadic function or method.
rdar://13667150

llvm-svn: 179819
2013-04-18 23:53:05 +00:00
Argyrios Kyrtzidis 9d9bc01e42 [libclang] Introduce clang_Cursor_getObjCDeclQualifiers, to query for 'ObjC Qualifiers' written next to the return and
parameter types in an ObjC method declarations.

rdar://13676977

llvm-svn: 179816
2013-04-18 23:29:12 +00:00
Argyrios Kyrtzidis 9adfd8aabb [libclang] Introduce clang_Cursor_getObjCPropertyAttributes to query the written attributes in a property declaration.
rdar://13684512

llvm-svn: 179803
2013-04-18 22:15:49 +00:00
Argyrios Kyrtzidis 1ab09cc883 [libclang] Have clang_getCXXAccessSpecifier() also return the access control of a C++ declaration within its parent scope.
Suggested by Stefan Seefeld.

llvm-svn: 179297
2013-04-11 17:02:10 +00:00
Argyrios Kyrtzidis e822f58db4 [libclang] Expose record layout info via new libclang functions:
clang_Type_getAlignOf
clang_Type_getSizeOf
clang_Type_getOffsetOf
clang_Cursor_isBitField

Patch by Loïc Jaquemet!

llvm-svn: 179251
2013-04-11 01:20:11 +00:00
Argyrios Kyrtzidis bcc8a5a70a [c-index-test] Enable 'display diagnostics' when using the -test-load functionality.
llvm-svn: 179123
2013-04-09 20:29:24 +00:00
Argyrios Kyrtzidis 3c5305c15e [Modules] Resolve top-headers of modules lazily.
This allows resolving top-header filenames of modules to FileEntries when
we need them, not eagerly.

Note that that this breaks ABI for libclang functions
clang_Module_getTopLevelHeader / clang_Module_getNumTopLevelHeaders
but this is fine because they are experimental and not widely used yet.

llvm-svn: 176975
2013-03-13 21:13:43 +00:00
Argyrios Kyrtzidis 1b5b1ce4f8 [libclang] Fix a test and a warning on windows.
Patch by Guy Benyei!

llvm-svn: 176806
2013-03-11 16:03:17 +00:00
Argyrios Kyrtzidis 503c83ad81 [libclang] Introduce clang_findIncludesInFile, that can be used to retrieve all #import/#include directives in a specific file.
It passes to the visitor, that the caller provides, CXCursor_InclusionDirective cursors for
all the include directives in a particular file.

llvm-svn: 176682
2013-03-08 02:32:34 +00:00
Stefanus Du Toit b331850194 Fix typos: [Dd]iagnosic -> [Dd]iagnostic
These all appear in comments or (ironically) diagnostics output.

llvm-svn: 176383
2013-03-01 21:41:22 +00:00
Dmitri Gribenko 0035372bb7 libclang: add clang_getTypeSpelling(CXType CT)
Adds a function clang_getTypeSpelling(CXType CT) that returns
a CXString containing the underlying type.

Patch by Ben Gertzfield.

llvm-svn: 175299
2013-02-15 21:15:49 +00:00
NAKAMURA Takumi 873a63ce19 libclang: Update comment about USEDLIBS in c-*-test/Makefile.
"Note that 'USEDLIBS' must include all of the core clang libraries when -static is given to linker on cygming."

llvm-svn: 173124
2013-01-22 04:11:33 +00:00
NAKAMURA Takumi a589b96041 Add bitreader to LINK_COMPONENTS in users of libclang, c-arcmt-test and c-index-test.
They don't link cygclang.dll, but libclang.a on cygwin.

llvm-svn: 172980
2013-01-20 14:53:49 +00:00
NAKAMURA Takumi f827eb629d c-index-test/Makefile: Add clangFormat to USEDLIBS for libclang-unavailable hosts.
llvm-svn: 170693
2012-12-20 13:30:10 +00:00
NAKAMURA Takumi 393bf4c3c8 c-index-test/Makefile: Reformat.
llvm-svn: 170692
2012-12-20 13:30:05 +00:00
Argyrios Kyrtzidis fdea813c4a [c-index-test] Fix warnings about unused results from chdir().
Patch from Edwin Vane!

llvm-svn: 170366
2012-12-17 20:19:56 +00:00
NAKAMURA Takumi 92eb254c3c [CMake] Move libxml2 stuff from clang to llvm/cmake.
llvm-svn: 170225
2012-12-14 18:30:20 +00:00
Argyrios Kyrtzidis 8b71bc7d6b [libclang] Introduce a new indexing mode where we skip function bodies
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
2012-12-06 19:41:16 +00:00
Argyrios Kyrtzidis f75d498a3c [c-index-test] Introduce '-index-compile-db' which accepts a compilation database file
and does an '-index-file' for all compile commands in the database.

llvm-svn: 169430
2012-12-05 21:53:37 +00:00
NAKAMURA Takumi dfaed1bfde c-index-test.c: Make C89-compliant.
llvm-svn: 169277
2012-12-04 15:32:03 +00:00
Dmitri Gribenko b506ba1d79 libclang: Add a function to libclang for retrieving the bit width value
Patch by Jyun-Yan You.

llvm-svn: 169276
2012-12-04 15:13:46 +00:00
Dmitri Gribenko 9fcad0947c Force C89 for c-index-test.c
MSVC supports only C89, so it is important to keep c-index-test.c
buildable with C89.  However, Clang defaults to C99, so while building
Clang with Clang one can introduce C99 constructs into c-index-test.c
without noticing.

Thanks to Nakamura Takumi for helping with MSVC bits.

llvm-svn: 167561
2012-11-07 23:52:25 +00:00
Argyrios Kyrtzidis 58a1d90d6a [c-index-test] Do install c-index-test because it's not just for tests,
it's also setup as 'INTERNAL_TOOL'.

llvm-svn: 167432
2012-11-06 02:12:21 +00:00
Argyrios Kyrtzidis b26a24cca2 [libclang] Introduce clang_Cursor_getReceiverType which returns the CXType for
the receiver of an ObjC message expression.

rdar://12578643

llvm-svn: 167201
2012-11-01 02:01:34 +00:00
NAKAMURA Takumi 4deb9a9b11 c-index-test.c: Split a format string. [-Woverlength-strings]
FIXME: They are still long strings without formatter in printf(3)!
llvm-svn: 166636
2012-10-24 22:52:04 +00:00
Argyrios Kyrtzidis e26c5571b2 [libclang] Add "-index-file-full" option that recursively indexes any imported
modules/PCH files.

llvm-svn: 166605
2012-10-24 18:29:15 +00:00
Argyrios Kyrtzidis 5e2ec486bb [libclang] Invoke a ppIncludedFile callback when indexing implicit module imports.
llvm-svn: 166161
2012-10-18 00:17:05 +00:00
NAKAMURA Takumi e259d912ab c-index-test.c: /* Use C style comment. */
llvm-svn: 165797
2012-10-12 14:25:52 +00:00
Argyrios Kyrtzidis 8585f140bf [libclang] Make sure the index_data.main_filename field is initialized
in c-index-test. index_enteredMainFile is not invoked when indexing a
module file.

llvm-svn: 165735
2012-10-11 19:38:23 +00:00
Argyrios Kyrtzidis 9f57186983 [libclang] Add tests for indexing modules and PCHs using modules.
llvm-svn: 165732
2012-10-11 19:00:44 +00:00
Argyrios Kyrtzidis 0db720f0dc [libclang] Improve AST serialization done by ASTUnit::Save().
The ASTUnit needs to initialize an ASTWriter at the beginning of
parsing to fully handle serialization of a translation unit that
imports modules. Do this by introducing an option to enable it, which
corresponds to CXTranslationUnit_ForSerialization on the C API side.

llvm-svn: 165717
2012-10-11 16:05:00 +00:00
Argyrios Kyrtzidis dc78f3e7a9 [libclang] Now that we have a CXModule object, pass it to the
importedASTFile indexing callback.

llvm-svn: 165281
2012-10-05 00:22:40 +00:00
Argyrios Kyrtzidis 2b9b5bb697 [libclang] Introduce new C functions that provide information about modules:
clang_Cursor_getModule
clang_Module_getParent
clang_Module_getName
clang_Module_getFullName
clang_Module_getNumTopLevelHeaders
clang_Module_getTopLevelHeader

llvm-svn: 165280
2012-10-05 00:22:37 +00:00
Argyrios Kyrtzidis 184b14428e [libclang] Simplify indexing of module imports by handling implicit
imports via ImportDecls.

llvm-svn: 165160
2012-10-03 21:05:44 +00:00
Argyrios Kyrtzidis b36ee5c592 [libclang] Even though we disable the preprocessing record during indexing,
make sure that it gets enabled for when a module needs to be created.

llvm-svn: 165021
2012-10-02 16:10:41 +00:00
Argyrios Kyrtzidis 472eda06b0 [libclang] Implement the importedASTFile indexing callback to provide
info about imported modules.

llvm-svn: 165020
2012-10-02 16:10:38 +00:00
Dmitri Gribenko 7acbf00f96 Comment AST: TableGen'ize all command lists in CommentCommandTraits.cpp.
Now we have a list of all commands.  This is a good thing in itself, but it
also enables us to easily implement typo correction for command names.

With this change we have objects that contain information about each command,
so it makes sense to resolve command name just once during lexing (currently we
store command names as strings and do a linear search every time some property
value is needed).  Thus comment token and AST nodes were changed to contain a
command ID -- index into a tables of builtin and registered commands.  Unknown
commands are registered during parsing and thus are also uniformly assigned an
ID.  Using an ID instead of a StringRef is also a nice memory optimization
since ID is a small integer that fits into a common bitfield in Comment class.

This change implies that to get any information about a command (even a command
name) we need a CommandTraits object to resolve the command ID to CommandInfo*.
Currently a fresh temporary CommandTraits object is created whenever it is
needed since it does not have any state.  But with this change it has state --
new commands can be registered, so a CommandTraits object was added to
ASTContext.

Also, in libclang CXComment has to be expanded to include a CXTranslationUnit
so that all functions working on comment AST nodes can get a CommandTraits
object.  This breaks binary compatibility of CXComment APIs.

Now clang_FullComment_getAsXML(CXTranslationUnit TU, CXComment CXC) doesn't
need TU parameter anymore, so it was removed.  This is a source-incompatible
change for this C API.

llvm-svn: 163540
2012-09-10 20:32:42 +00:00
David Blaikie dcefd95d84 Fix the build (-Wswitch violation introduced by r163013).
llvm-svn: 163025
2012-08-31 21:55:26 +00:00
Michael Liao b94f47a8f5 Fix C++ comment in C source
llvm-svn: 162887
2012-08-30 00:45:32 +00:00
Argyrios Kyrtzidis 079ff5c6da [libclang] c-index-test: Make the printing of the overrides list of a cursor in
a deterministic order, to avoid random test failures.

llvm-svn: 162408
2012-08-22 23:15:52 +00:00
Benjamin Kramer 3a913ed805 Fix a couple of pedantic gcc warnings.
llvm-svn: 161656
2012-08-10 10:06:13 +00:00
NAKAMURA Takumi 5c10810754 c-arcmt-test, c-index-test: Appease Cygwin, to link to libclang.a, not clang.dll.
llvm-svn: 161655
2012-08-10 06:10:58 +00:00
Dmitri Gribenko 815f72bac7 c-index-test Makefile: fix build on Linux. Reviewed by Eric Christopher.
llvm-svn: 161439
2012-08-07 18:36:33 +00:00
Dmitri Gribenko 740c0fbe0e libclang API for comment-to-xml conversion.
The implementation also includes a Relax NG schema and tests for the schema
itself.  The schema is used in c-index-test to verify that XML documents we
produce are valid.  In order to do the validation, we add an optional libxml2
dependency for c-index-test.

Credits for CMake part go to Doug Gregor.  Credits for Autoconf part go to Eric
Christopher.  Thanks!

llvm-svn: 161431
2012-08-07 17:54:38 +00:00
Dmitri Gribenko 34df220410 Comment parsing: add support for \tparam command on all levels.
The only caveat is renumbering CXCommentKind enum for aesthetic reasons -- this
breaks libclang binary compatibility, but should not be a problem since API is
so new.

This also fixes PR13372 as a side-effect.

llvm-svn: 161087
2012-07-31 22:37:06 +00:00
David Blaikie 5ba8be0e9a Include clang-check as part of the clang installation.
This also tidies up a couple of other tools we were (partially) installing:
* c-index-test was being installed but shouldn't be (it's just a clang-dev tool)
* diagtool was being installed in cmake but not make (& shouldn't be installed in either)

Review by Manuel Klimek, Doug Gregor, and Chandler Carruth.

llvm-svn: 161073
2012-07-31 20:29:59 +00:00
Dmitri Gribenko ec551f67e5 c-index-test: remove dead store. Found by Clang static analyzer!
llvm-svn: 160974
2012-07-30 18:00:35 +00:00
Dmitri Gribenko d73e4ce992 Comment AST: add InlineContentComment::RenderKind to specify a default
rendering mode for clients that don't want to interpret Doxygen commands.

Also add a libclang API to query this information.

llvm-svn: 160633
2012-07-23 16:43:01 +00:00
Dmitri Gribenko f267c87e31 Fix c-index-test to compile as C89.
llvm-svn: 160582
2012-07-20 22:00:35 +00:00
Dmitri Gribenko 5e4fe00e64 Add libclang APIs to walk comments ASTs and an API to convert a comment to an
HTML fragment.

For testing, c-index-test now has even more output:
* HTML rendering of a comment
* comment AST tree dump in S-expressions like Comment::dump(), but implemented
* with libclang APIs.

llvm-svn: 160577
2012-07-20 21:34:34 +00:00
Richard Smith 1ea42eb5a3 Fix some memory leaks found by the static analyzer. Thanks to John Smith for running it over Clang.
llvm-svn: 159732
2012-07-05 08:20:49 +00:00
Arnaud A. de Grandmaison fa6d73cc90 [libclang] CompilationDatabase naming and comment fixes
llvm-svn: 159682
2012-07-03 20:38:12 +00:00
Argyrios Kyrtzidis b6df682194 [libclang] Introduce clang_Cursor_isDynamicCall which,
given a cursor pointing to a C++ method call or an ObjC message,
returns non-zero if the method/message is "dynamic", meaning:

  For a C++ method: the call is virtual.
  For an ObjC message: the receiver is an object instance, not 'super' or a
  specific class.

rdar://11779185

llvm-svn: 159627
2012-07-02 23:54:36 +00:00
Dmitri Gribenko 3292d06a1b Add a new libclang completion API to get brief documentation comment that is
attached to a declaration in the completion string.

Since extracting comments isn't free, a new code completion option is
introduced.

A new code completion option that enables including brief comments
into CodeCompletionString should be a, err, code completion option.
But because ASTUnit caches global declarations during parsing before
even completion consumer is created, the option is duplicated as a
translation unit option (in both libclang and ASTUnit, like the option
to cache code completion results).

llvm-svn: 159539
2012-07-02 17:35:10 +00:00
NAKAMURA Takumi 98346f92f2 c-index-test/Makefile: Tweak USEDLIBS for cygwin. cygclang.dll is not linked to c-index-test yet.
llvm-svn: 159499
2012-07-01 00:40:17 +00:00
NAKAMURA Takumi 1e43baa602 c-index-test.c: Fix missing semicolon(s).
llvm-svn: 159486
2012-06-30 11:47:18 +00:00
Arnaud A. de Grandmaison 0fe28a1a84 [libclang] add CompilationDatabase support
llvm-svn: 159484
2012-06-30 11:27:57 +00:00
Dmitri Gribenko 5188c4b9cc Implement a lexer for structured comments.
llvm-svn: 159223
2012-06-26 20:39:18 +00:00
Chandler Carruth 28969b4139 Remove a goofy CMake hack and use the standard CMake facilities to
express library-level dependencies within Clang.

This is no more verbose really, and plays nicer with the rest of the
CMake facilities. It should also have no change in functionality.

llvm-svn: 158888
2012-06-21 01:30:21 +00:00
Chandler Carruth 39a3e7544a Fix a big layering violation introduced by r158771.
That commit added a new library just to hold the RawCommentList. I've
started a discussion on the commit thread about whether that is really
meritted -- it certainly doesn't seem necessary at this stage.

However, the immediate problem is that the AST library has a hard
dependency on the Comment library, but the dependencies were set up
completely backward. In addition to the layering violation, this had an
unfortunate effect if scattering the Comments library dependency
throughout the build system, but inconsistently so -- several parts of
the CMake dependencies were missing and only showed up due to transitive
deps or the fact that the target wasn't being built by tho bots.

It turns out that the Comments library can't (currently) be a well
formed layer *below* the AST library either, as it has an API that
accepts an ASTContext. That parameter is currently unused, so maybe that
was a mistake?

Anyways, it really seems like this is logically part of the AST --
that's the whole point of the ASTContext providing access to it as far
as I can tell -- so I've merged it into the AST library to solve the
immediate layering violation problems and remove some of the churn from
our library dependencies.

llvm-svn: 158807
2012-06-20 09:53:52 +00:00
Dmitri Gribenko aab8383a2b Structured comment parsing, first step.
* Retain comments in the AST
* Serialize/deserialize comments
* Find comments attached to a certain Decl
* Expose raw comment text and SourceRange via libclang

llvm-svn: 158771
2012-06-20 00:34:58 +00:00
Douglas Gregor d6225d304e Introduce a new libclang API to determine the platform availability of
a given entity, so that we can tell when the entity was
introduced/deprecated/obsoleted on each platform for which we have an
annotation. Addresses <rdar://problem/11365715>.

llvm-svn: 156347
2012-05-08 00:14:45 +00:00
Benjamin Kramer af7ae314db c-index-test: dispose spelling string after use.
llvm-svn: 154738
2012-04-14 09:11:51 +00:00
Douglas Gregor 1840cc2cc6 Kill the last vestiges of clangIndex
llvm-svn: 154675
2012-04-13 17:26:32 +00:00
Erik Verbruggen 6e92251f9b Added a flag to the parser to skip method bodies.
llvm-svn: 154584
2012-04-12 10:11:59 +00:00
Ted Kremenek 26a6d498ee Implement clang_getDiagnosticCategoryText() to provide a way for a client of libclang to accurately
get the diagnostic category name from a serialized diagnostic when the version of libclang used
to read the diagnostic file is newer than the clang that emitted the diagnostic file.

llvm-svn: 154567
2012-04-12 00:03:31 +00:00
Argyrios Kyrtzidis 088041721f [libclang] Apparently it's important to build in C89, sigh..
llvm-svn: 154525
2012-04-11 19:54:09 +00:00
Argyrios Kyrtzidis 0c27e4b36b [libclang] Introduce a couple of functions to make it convenient
to get at the parameters (and their types) of a function or objc method cursor.

int clang_Cursor_getNumArguments(CXCursor C);
CXCursor clang_Cursor_getArgument(CXCursor C, unsigned i);

rdar://11201527

llvm-svn: 154523
2012-04-11 19:32:19 +00:00
NAKAMURA Takumi a7d49883bb [Cygwin] Work around to flush stdout in a thread, or stdout in threads won't be flushed at exit.
llvm-svn: 154254
2012-04-07 06:59:28 +00:00
Benjamin Kramer a61516d324 Remove unused but set variable.
llvm-svn: 153800
2012-03-31 10:23:28 +00:00
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
NAKAMURA Takumi 354589a663 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.

llvm-svn: 152539
2012-03-11 08:04:40 +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
Bob Wilson bd0fbe86c5 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.

llvm-svn: 145235
2011-11-28 08:03:54 +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