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

348 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor 87fb9404cd Mention libclang in the Doxygen documentation
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126316 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-23 17:45:25 +00:00
Douglas Gregor e72fb6f402 Add libclang functions to determine the const/volatile/restrict
qualifiers on a CXType. Patch from Stefan Seefeld, test by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124377 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-27 16:27:11 +00:00
David Chisnall 5389f48b24 Expose Objective-C type encodings of declarations to libclang users. This also adds a method in ASTContext which encodes FunctionDecls using the same encoding format that is used for Objective-C methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122639 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-30 14:05:53 +00:00
Douglas Gregor 3910cfd17f Teach clang_getCursorSemanticParent() and
clang_getCursorLexicalParent() to cope with class and function
templates, along with the parent of the translation unit. Fixes PR8761
and PR8766.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122324 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 07:55:45 +00:00
Ted Kremenek eca099bdb0 Add new libclang hooks for CXCursorSet, a
DenseMap-backed hashtable for doing client-side
management of CXCursors within a set.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121318 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 23:43:14 +00:00
Douglas Gregor 9ce5584553 Implement a simple hash function for libclang cursors
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119876 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-20 00:09:34 +00:00
Douglas Gregor 1a9d0503b6 Implement clang_getCanonicalCursor() in libclang, which does the obvious thing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119874 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-19 23:44:15 +00:00
Douglas Gregor aa5f135f8d Extend the libclang diagnostic API to provide information about the
option name, category ID, and category name corresponding to a diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119802 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-19 16:18:16 +00:00
Ted Kremenek 0a90d32523 Make definition of CXTranslationUnitImpl private
to libclang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119585 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 23:24:11 +00:00
Ted Kremenek a60ed47da1 Change CXTranslationUnit to not directly cast to an ASTUnit*,
but to wrap both an ASTUnit and a "string pool"
that will be used for fast USR generation.

This requires a bunch of mechanical changes, as
there was a ton of code that assumed that CXTranslationUnit
and ASTUnit* were the same.

Along with this change, introduce CXStringBuf,
which provides an llvm::SmallVector<char> backing
for repeatedly generating CXStrings without a huge
amount of malloc() traffic.  This requires making
some changes to the representation of CXString
by renaming a few fields (but keeping the size
of the object the same).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119337 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 08:15:36 +00:00
Ted Kremenek ed12273563 Move CXString creation/management routines into
their own .cpp file and make the interpretation
of its flags private.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119319 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 01:56:27 +00:00
Douglas Gregor a9b06d4c24 ntroduce clang_getSpellingLocation() into libclang, to provide the
location where we're spelling a token even within a
macro. clang_getInstantiationLocation() tells where we instantiated
the macro.

I'm still not thrilled with the CXSourceLocation/CXSourceRange APIs,
since they gloss over macro-instantiation information.

Take 2: this time, adjusted tests appropriately and used a "simple"
approach to the spelling location.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118495 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 06:24:54 +00:00
Douglas Gregor 27a31fe6fa Revert r118492, which didn't update all of its tests accordingly
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118494 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 05:52:02 +00:00
Douglas Gregor b6278715de Introduce clang_getSpellingLocation() into libclang, to provide the
location where we're spelling a token even within a
macro. clang_getInstantiationLocation() tells where we instantiated
the macro.

I'm still not thrilled with the CXSourceLocation/CXSourceRange APIs,
since they gloss over macro-instantiation information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118492 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 05:28:47 +00:00
Ted Kremenek 1ddb02cabd Clean up some of the comments in Index.h (e.g., misnamed or extra parameters in comments).
Patch by Chris Pick!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118403 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-08 04:28:51 +00:00
Daniel Dunbar 995aaf9c8f libclang: Add clang_executeOnThread, for use in c-index-test (and only there,
preferably). Good thing c-index-test is written in C!!!!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118223 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 01:26:29 +00:00
David Chisnall 3387c65a09 Added cursor visitor that takes a block as an argument. Tested compiling
libclang with both clang -fblocks and gcc (no blocks support).  Only exposed in
the header to compilers that do have blocks support.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118170 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-03 14:12:26 +00:00
Douglas Gregor 99ba202f65 Introduce libclang-level options for C++ precompiled preambles,
separating out chaining precompiled preambles from non-chaining ones.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117457 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-27 17:24:53 +00:00
Douglas Gregor ecdcb883cb Extend the preprocessing record and libclang with support for
inclusion directives, keeping track of every #include, #import,
etc. in the translation unit. We keep track of the source location and
kind of the inclusion, how the file name was spelled, and the
underlying file to which the inclusion resolved.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116952 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 22:00:55 +00:00
David Chisnall 83889a7f1f Add clang_getLocationForOffset() to libclang, for gives a source location from a character index into a file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116587 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-15 17:07:39 +00:00
Douglas Gregor e0cc52ef8a Eliminate clang_codeComplete(). libclang clients should be using the
faster, in-process, more-configurable clang_codeCompleteAt(). 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116245 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-11 21:51:20 +00:00
Douglas Gregor b10daedb8f Eliminate clang_setUseExternalASTGeneration() from libclang. Between
improvements to the compiler and the introduction of crash recovery,
it no longer makes sense to allow this mode. Moreover, this eliminates
one use of the "clang" executable from within libclang; we'd like them
all to go away.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116207 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-11 16:52:23 +00:00
Douglas Gregor 358559d8d7 Introduce a new libclang function, clang_getCursorDisplayName(), which
produces a simple "display" name that captures the
arguments/parameters for a function, function template, class
template, or class template specialization.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115428 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-02 22:49:11 +00:00
Douglas Gregor 9f59234a91 Extend libclang with an API that determines, given a C++ virtual
member function or an Objective-C method, which other member
functions/methods it overrides.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115338 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 20:25:15 +00:00
Douglas Gregor 2be5bc9ad3 Implement libclang API functions for retrieving the lexical and
semantic parents of the given cursor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114587 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 21:22:29 +00:00
Douglas Gregor 1f60d9ea52 Introduce a new kind of cursor into libclang, which covers a reference
to an "overloaded" set of declarations. This cursor kind works for
unresolved references to functions/templates (e.g., a call within a
template), using declarations, and Objective-C class and protocol
forward declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113805 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 22:52:57 +00:00
Douglas Gregor 36897b05ca Add libclang support for label statements, gotos, and taking the
address of a label (GNU extension).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113564 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 00:22:18 +00:00
Douglas Gregor a67e03fdf1 Teach libclang to walk the base and member initializers of a
constructor, in source order. Also introduces a new reference kind for
class members, which is used here (for member initializers) and will
also be used for designated initializers and offsetof.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113545 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 21:42:20 +00:00
Douglas Gregor e0329acf5c Introduce a new libclang function,
clang_getSpecializedCursorTemplate(), which determines the template
(or member thereof) that the given cursor specializes or from which it
was instantiated. This routine can be used to establish a link between
templates and their instantiations/specializations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112780 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 00:07:54 +00:00
Douglas Gregor 7e24256c95 Implement libclang support for using declarations. Clang actually uses
three different kinds of AST nodes to represent using declarations:
UsingDecl, UnresolvedUsingValueDecl, and
UnresolvedUsingTypenameDecl. These three are collapsed into a single
cursor kind for using declarations, since libclang clients don't need
the distinction.

Several related changes here:
  - Cursor visitation of the three AST nodes for using declarations
  - Proper source-range computation for these AST nodes
  - Using declarations have no USRs, since they don't actually declare
    any entities.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112730 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 19:52:22 +00:00
Douglas Gregor 2ef6944d52 Make it clear that libclang does not modify the command-line arguments
it is given.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112717 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 16:43:19 +00:00
Douglas Gregor 0a35bceb77 Implement libclang support for using directives (cursor + visitation +
suppressing USRs). Also, fix up the source location information for
using directives so that the declaration location refers to the
namespace name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112693 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 03:07:18 +00:00
Douglas Gregor 6931900f43 Add libclang support for namespace aliases (visitation + USRs) along
with a new cursor kind for a reference to a namespace. 

There's still some oddities in the source location information for
NamespaceAliasDecl that I'll address with a separate commit, so the
source locations displayed in the load-namespaces.cpp test will
change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112676 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 23:48:11 +00:00
Douglas Gregor 49f6f54894 Add a new libclang function clang_getTemplateCursorKind(), which
determines the kind of declaration that would be generated if the
given template were instantiated. This allows a client to distinguish
among class/struct/union templates and function/member function/static
member function templates.

Also, teach clang_CXXMethod_isStatic() about function templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112655 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 22:12:17 +00:00
Douglas Gregor 0b36e614aa Extend libclang with a new cursor kind that indicates a reference to a
template. Such cursors occur, for example, in template specialization
types such as vector<int>. Note that we do not handle the
super-interesting case where the template name is unresolved, e.g.,
within a template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112636 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 20:37:03 +00:00
Douglas Gregor 74dbe64002 Add libclang support for class template partial specializations,
including a cursor kind, visitation, and USRs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112629 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 19:31:58 +00:00
Douglas Gregor 39d6f07b05 Add a libclang cursor kind, visitation support and USR support for C++
class templates. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112627 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 19:02:00 +00:00
Douglas Gregor fe72e9ceea Implement basic support for indexing function templates in
libclang. This includes:
  - Cursor kind for function templates, with visitation logic
  - Cursor kinds for template parameters, with visitation logic
  - Visitation logic for template specialization types, qualified type
  locations
  - USR generation for function templates, template specialization
  types, template parameter types.

Also happens to fix PR7804, which I tripped across while testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112604 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 17:01:39 +00:00
Douglas Gregor 01829d3afa libclang indexing support for C++ constructors, destructors, and
conversion functions. This introduces new cursor kinds for these three
C++ entities, and reworks visitation of function declarations so that
we get type-source information for the names.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112600 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 14:41:23 +00:00
Ted Kremenek 3064ef9e60 Implement CXCursor support for walking C++ base specifiers. This includes adding the API hooks clang_isVirtualBase() and clang_getCXXAccessSpecifier() to query properties of the base specifier.
Implements <rdar://problem/8274883>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112296 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-27 21:34:58 +00:00
Ted Kremenek ad72f4dad4 Fix copy-paste in doxygen comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112295 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-27 21:34:51 +00:00
Douglas Gregor 1e5e6684b0 Move the sorting of code-completion results out of the main path and
into the clients, e.g., the printing code-completion consumer and
c-index-test. Clients may want to re-sort the results anyway.

Provide a libclang function that sorts the results.

3rd try. How embarrassing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112180 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 13:48:20 +00:00
Daniel Dunbar 1cb237fbf9 Revert r112149, "Move the sorting of code-completion results out of the main
path and ...", it is failing tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112161 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 03:53:50 +00:00
Douglas Gregor be13afea6d Move the sorting of code-completion results out of the main path and
into the clients, e.g., the printing code-completion consumer and
c-index-test. Clients may want to re-sort the results anyway.

Provide a libclang function that sorts the results.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112149 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 02:23:45 +00:00
Ted Kremenek 95f33555a6 Add libclang API hook "clang_getIBOutletCollectionType" to query the collection type for iboutletcollection attributes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112139 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 01:42:22 +00:00
Peter Collingbourne 076c22a99e Silence warning about C++-style comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111875 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 00:31:37 +00:00
Douglas Gregor 58ddb60f40 Introduce new libclang API functions that determine the availability
of a cursor or code-completion result, e.g., whether that result
refers to an unavailable, deleted, or deprecated declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111858 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 23:00:57 +00:00
Douglas Gregor 1999844e7a Add an options parameter to clang_saveTranslationUnit, because we'll want it later
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111016 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 15:35:05 +00:00
Douglas Gregor 7ae2faafd3 Implement clang_saveTranslationUnit(), which saves a translation unit
into a PCH/AST file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111006 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 05:36:37 +00:00
Douglas Gregor e1e13bf568 Add a (currently unused) "options" parameter to
clang_reparseTranslationUnit(), along with a function to retrieve the
default recommended reparsing options for a translation unit.

Also, add the CXTranslationUnit_CacheCompletionResults flag, which is
also currently unused.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110811 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 15:58:42 +00:00
Douglas Gregor b1c031be51 Instead of having a specific CXTranslationUnit_* option flag for
"editing" mode, introduce a separate function
clang_defaultEditingTranslationUnitOptions() that retrieves the set of
options. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110613 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 22:28:58 +00:00
Douglas Gregor df95a13ec7 Use precompiled preambles for in-process code completion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110596 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 20:45:32 +00:00
Douglas Gregor cee235cdf0 Give clang_codeCompleteAt() an "options" parameter, and add a new
flags enumeration + default-generating function that allows
code-completion to be customized via the libclang API.

Plus, turn on spell-checking when performing code completion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110319 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 09:09:23 +00:00
Douglas Gregor 1abc6bca3d Add code-completion support directly to ASTUnit, which performs code
completion within the translation unit using the same command-line
arguments for parsing the translation unit. Eventually, we'll reuse
the precompiled preamble to improve code-completion performance, and
this also gives us a place to cache results.

Expose this function via the new libclang function
clang_codeCompleteAt(), which performs the code completion within a
CXTranslationUnit. The completion occurs in-process
(clang_codeCompletion() runs code completion out-of-process).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110210 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 16:47:14 +00:00
Ted Kremenek 3ce9e7d270 Add clang_isPODType() for querying if the CXType is POD. Implements <rdar://problem/8250669>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109822 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 00:14:11 +00:00
Douglas Gregor 44c181aec3 Basic plumbing for generating a precompiled preamble for an
ASTUnit/CXTranslationUnit. We can't actually use this preamble yet,
however.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109202 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 00:33:23 +00:00
Douglas Gregor 5a43021ac4 Introduce a new C API function, clang_parseTranslationUnit(), which
will eventually replace
clang_createTranslationUnitFromSourceFile(). The only addition in
clang_parseTranslationUnit() is a set of flags that can control how
the translation unit is loaded. More interesting flags will be coming.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109027 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 18:52:53 +00:00
Douglas Gregor abc563f554 Introduce a new libclang API, clang_reparseTranslationUnit(), which
reparses an already-parsed translation unit. At the moment it's just a
convenience function, but we hope to use it for performance
optimizations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108756 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 21:46:24 +00:00
Ted Kremenek 9a14084543 Add CXType support for querying the return type of Objective-C methods. This is done by
adding a clang_getCursorResultType() function (which complements clang_getResultType()).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106473 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-21 20:48:56 +00:00
Ted Kremenek 04c3cf35a8 Add CXType support for FunctionNoProto and FunctionProto types. This includes adding a new
function, clang_getResultType(), which returns the result type of the function type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106459 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-21 20:15:39 +00:00
Daniel Dunbar afed099bd2 Makefile: Switch Clang Makefiles to always include the top-level Clang Makefile.
- This eliminates most dependencies on how Clang is installed relative to LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105637 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-08 20:34:18 +00:00
Ted Kremenek a7f1c008d3 Remove clang_isFromMainFile(). It doesn't work correctly with CXDiagnostics, and we shouldn't
have an API around that cannot be implemented correctly yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104849 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 16:57:42 +00:00
Douglas Gregor 12e131385e Introduce priorities into the code-completion results.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104751 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-26 22:00:08 +00:00
Ted Kremenek 47e8e399d2 Add libclang function 'clang_isFromMainFile()' (which just wraps SourceManager::isFromMainFile()).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104208 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-20 02:59:19 +00:00
Ted Kremenek 50aa6acd0b Move CXCursor_FirstDecl definition later to make the results more readable in the debugger.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104171 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-19 21:51:10 +00:00
Ted Kremenek 2bb106eeba Remove clang_isDeclarationADefinition() since its functionality is already provided by clang_isCursorDefinition().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104138 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-19 18:36:55 +00:00
Ted Kremenek 857e918a8a Add clang support for IBOutletCollection.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104135 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-19 17:38:06 +00:00
Ted Kremenek b12903e1a4 Add function 'clang_isTagDeclDefinition()' to allow clients of libclang to distinguish between
forward declarations and definitions of structs/classes/enums.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104075 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-18 22:32:15 +00:00
Ted Kremenek 9ada39a4ac Add libclang function 'clang_CXXMethod_isStatic' to query of a C++ method
is declared static.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103963 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-17 20:06:56 +00:00
Ted Kremenek 8e0ac174c8 Add CXType and an initial set of supporting functions to libclang. This exposes details of
Clang's representation of the C type system to clients.  It is nowhere near complete, and will
be expanded on demand.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103809 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-14 21:29:26 +00:00
Ted Kremenek a0536d8dd9 Add CXCursor support for LinkageSpecDecl (e.g., 'extern "C"').
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103224 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 01:04:29 +00:00
Ted Kremenek 8f06e0e9fe Add CXCursor support for C++ namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103211 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-06 23:38:21 +00:00
Daniel Dunbar 25cf7b4e91 Move include installation steps to better location, inside each include dir instead of at the top-level.
Also, don't set NO_INSTALL=1 for c-index-test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102724 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-30 17:59:38 +00:00
Ted Kremenek 6cd1e7cb04 Make CXLanguage_Invalid the first enum value (with '0' as its value) in CXLanguageKind.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101287 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-14 20:58:32 +00:00
Ted Kremenek 8bd5a69999 Add cursor kind for C++ methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101193 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 23:39:06 +00:00
Ted Kremenek 45e1dae500 Add 'clang_getCursorLanguage' to return the "language" of the AST element (e.g., distinguish between C and Objective-C language features). Currently this only returns results for declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101070 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 21:22:16 +00:00
Ted Kremenek c6f530defd Update doxygen comments about lifetime requirements of CXUnsaveFile data arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101054 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 18:47:26 +00:00
Ted Kremenek 1ee6cad59f Add CIndex support for blocks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100989 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-11 21:47:37 +00:00
Ted Kremenek ebfa339321 Make the CIndex API more resilient to being used on invalid code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98981 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 20:39:03 +00:00
Douglas Gregor 572feb2a19 Expose macro definitions as CIndex cursors. These can still only be
generated by clang_annotateTokens().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98837 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 18:04:21 +00:00
Douglas Gregor 4807231938 More token-annotation experimentation, preprocessing the annotated
token sequence to detect macro instantiations (that produce at least
token). WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98826 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 15:23:44 +00:00
Douglas Gregor 9f1e3ff3b3 Experimental stab at using relexing to identify preprocessor
directives while annotating tokens in CIndex. This functionality
should probably be factored out of this routine, but we're not there
yet. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98786 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 00:42:48 +00:00
Ted Kremenek 66ccaec737 Rename clang_constructUSR_ObjCategory to clang_constructUSR_ObjCCategory.
(there was a missing 'C').

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98554 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 17:38:58 +00:00
Ted Kremenek 896b70ffc3 Implement several CIndex functions for constructing USRs from C-strings instead of AST elements.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98421 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 02:50:34 +00:00
Ted Kremenek ad6eff611a Implement clang_isUnexposed(), a predicate function to simplify filtering out
unexposed AST elements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97985 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 21:17:29 +00:00
Ted Kremenek 16b4259aec Add clang_getCursorLinkage(), which returns the
underlying linkage for the entity referred to by a
CXCursor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97646 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 06:36:57 +00:00
Douglas Gregor c8dfe5ece0 When given unsaved files in clang_createTranslationUnitFromSourceFile,
copy the source buffers provided rather than referencing them
directly, so that the caller can free those buffers immediately after
calling clang_createTranslationUnitFromSourceFile(). Otherwise, we
risk hitting those buffers later (when building source ranges, forming
diagnostics, etc.). 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97296 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 01:32:48 +00:00
Douglas Gregor 274f1906f1 Rework the CIndex API for displaying diagnostics. Instead of printing
the diagnostics to a FILE*, return a CXString containing the formatted
diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96823 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-22 23:17:23 +00:00
Douglas Gregor 473d7019bb Simplify the CIndex fix-it API, now that we have half-open CXSourceRanges.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96685 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 18:16:06 +00:00
Douglas Gregor 0a812cf707 Re-apply my diagnostics-capture patch for CIndex, with some tweaks to
try to address the msvc failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96624 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 23:07:20 +00:00
Douglas Gregor 436f3f0400 Revert my CIndex diagnostic changes (r96603, 96606, 96607), which were
breaking the msvc9 builder for unknown reasons.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96618 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 22:27:07 +00:00
Douglas Gregor b9c8a24d04 Introduce debugging/testing hook clang_enableStackTraces() into
CIndex, so that c-index-test to use it to call
lvm::sys::PrintStackTraceOnErrorSignal().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96607 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 20:22:25 +00:00
Douglas Gregor b271071337 Resurrect the displayDiagnostics parameter to clang_createIndex(), and
display captured diagnostics when we can't return an invalid
CXTranslationUnit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96606 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 20:11:31 +00:00
Douglas Gregor 4c58923ca9 Introduce CIndex API functions for displaying a diagnostic, with some
knobs to control formatting. Eventually, I'd like to merge the
implementation of this code with the TextDiagnosticPrinter, so that
it's easy for CIndex clients to produce beautiful diagnostics like the
clang compiler does.

Use this new function to display diagnostics within c-index-test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96603 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 19:08:21 +00:00
Douglas Gregor a88084b78f Rework how CIndex handles diagnostics. Rather than using a callback,
we attach diagnostics to translation units and code-completion
results, so they can be queried at any time.

To facilitate this, the new StoredDiagnostic class stores a diagnostic
in a serializable/deserializable form, and ASTUnit knows how to
capture diagnostics in this stored form. CIndex's CXDiagnostic is a
thin wrapper around StoredDiagnostic, providing a C interface to
stored or de-serialized diagnostics.

I've XFAIL'd one test case temporarily, because currently we end up
storing diagnostics in an ASTUnit that's never returned to the user
(because it contains errors). I'll introduce a temporary fix for this
soon; the real fix will be to allow us to return and query invalid ASTs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96592 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 18:08:43 +00:00
Ted Kremenek e77f443dbc Start adding cursor kinds for attributes, with first exposing
IBActionAttr and IBOutletAttr respectively.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96563 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 03:09:07 +00:00
Daniel Dunbar 7157018247 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96468 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 08:07:44 +00:00
Ted Kremenek 2ef6f8f5a3 Convert clang_getCompletionChunkText() to return a CXString.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96439 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 01:42:24 +00:00
Ted Kremenek e68fff6fc0 Change clang_getCursorKindSpelling() to return a CXString
instead of a 'const char *'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96425 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 00:41:32 +00:00
Ted Kremenek 7484407241 Change clang_getFileName() to return a 'CXString' instead of 'const char *'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96424 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 00:41:20 +00:00
Daniel Dunbar d52864bd33 CIndex: Switch CXSourceRange to proper half-open intervals.
- Doug, please review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96162 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-14 10:02:57 +00:00
Ted Kremenek a2a9d6e4e5 Make the following functions thread-safe but having them return an std::string that is reconstructed
every time they are called:

getClangRevision()
getClangFullRepositoryVersion()
getClangFullVersion()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96033 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 22:54:40 +00:00
Douglas Gregor a3890baf12 Clean up the CIndex interface to diagnostic ranges. Thanks, Daniel!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95602 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-08 23:11:56 +00:00
Douglas Gregor 0087e1a12b Note that a CXIndex cannot be destroyed until after all of its translation units have been destroyed
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95598 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-08 23:03:06 +00:00
Douglas Gregor 936ea3b590 Switch the remaining diagnostic printing in CIndex over to the
diagnostic callback mechanism, so all diagnostics now go through that
callback. Also, eliminate the displayDiagnostics flag to
clang_createIndex(), since it is no longer necessary: the client
determines whether to display diagnostics or not.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94714 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 00:56:43 +00:00
Douglas Gregor 5352ac06d8 Implement a diagnostics callback for the C interface to Clang, so that
clients can format diagnostics as they wish rather than having to
parse standard error. All of the important parts of the front end's
diagnostics are exposed: text, severity, location, source ranges, and
fix-its. The diagnostics callback is now available with
clang_createTranslationUnitFromSource() and
clang_createTranslationUnit().

As part of this change, CXSourceLocation and CXSourceRange got one
pointer larger, since we need to hold on to the SourceManager and
LangOptions structures in the source location. This is the minimum
amount of information needed for the functions that operate on source
locations and ranges (as implemented now). Previously we held on to
the ASTContext, but the diagnostics callback can end up with source
locations when there is no ASTContext (or preprocessor).

Still to do:
  - Code completion needs to support the diagnostics callback, once we
  have the ability to (de-)serialize diagnostics.
  - Eliminate the "displayDiagnostics" argument to createIndex; we'll
  always pass diagnostics to the callback and let it deal with display.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94709 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 00:27:43 +00:00
Ted Kremenek 16b55a7169 Implement 'clang_getInclusions()' in CIndex. This API allows clients to walk the set of files included in a translation unit via the C API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94575 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-26 19:31:51 +00:00
Douglas Gregor 46766dc31c Eliminate clang_getInstantiationLocationOffset(), and instead add an
offset parameter to clang_getInstantiationLocation(). 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94573 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-26 19:19:08 +00:00
Douglas Gregor 0045e9fe1f Implement clang_annotateTokens(), which associates cursors with each
of the tokens within a raw token stream. This does not even attempt to
handle macros yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94561 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-26 18:31:56 +00:00
Douglas Gregor fc8ea23eb6 Introduce a CIndex API for lexing the raw tokens within a given source
range. The token-annotation function does nothing, yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94551 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-26 17:06:03 +00:00
Douglas Gregor e69517ce61 Introduce clang_getInstantiationLocationOffset(), which decomposes a
source location in file + offset.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94497 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-26 03:07:15 +00:00
Daniel Dunbar fd9f23464b Update comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94393 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25 00:43:14 +00:00
Daniel Dunbar a57259e9d7 Tweak clang_visitChildren comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94360 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-24 04:10:31 +00:00
Daniel Dunbar 1efcf3d137 Index.h: Tweak comments, delete trailing whitespace, fix a few typos, etc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94351 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-24 02:54:26 +00:00
Ted Kremenek 23e1ad09bb Add doxygen comment to clang_getClangVersion().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94311 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-23 17:51:23 +00:00
Douglas Gregor 4db64a461c Extend clang_createTranslationUnitFromSourceFile() to support creating
translation units that include unsaved files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94258 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-23 00:14:00 +00:00
Ted Kremenek 04bb716aea Add 'clang_getClangVersion()' function to CIndex. This exposes the full Clang version string through the CIndex API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94242 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 22:44:15 +00:00
Douglas Gregor c42fefa51f Improve content and structure of the Doxygen documentation for the
CIndex API. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94234 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 22:29:16 +00:00
Douglas Gregor b979034b10 Yet more CIndex API cleanup:
- Added more routines to manipulate/compare source locations and ranges
  - Switched clang_getCursor() over to take a CXSourceLocation rather
  than file/line/column.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94226 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 21:44:22 +00:00
Douglas Gregor 7d0d40e588 Introduce type references into the C API, capturing references to
typedefs only (for now).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94078 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 16:28:34 +00:00
Douglas Gregor b2cd487561 Stash a CXXUnit pointer into each cursor. This allows us to simplify
the interface to clang_visitChildren() by eliminating the
CXTranslationUnit pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94051 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 23:57:43 +00:00
Douglas Gregor f55254472e Yet more Doxygen-comment tweaking in the CIndex library.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94044 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 22:45:41 +00:00
Douglas Gregor 7f17376e09 Improve Doxygen documentation for the CIndex library, somewhat.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94042 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 22:28:27 +00:00
Douglas Gregor 04d1dd476a Kill CXEntity and CXDecl. The first has never been used, while the
second has been wholly replaced by cursors.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94039 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 22:14:22 +00:00
Douglas Gregor 78205d4bad Kill some CXDecl-related APIs that have been superceded by
CXCursor-based APIs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94037 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 21:45:58 +00:00
Douglas Gregor 68372aa4c5 Kill CXStmt. It isn't being used anywhere, and has no future.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94036 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 21:38:07 +00:00
Douglas Gregor 002a528ab0 Kill clang_loadDeclaration() and clang_loadTranslationUnit().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94034 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 21:37:00 +00:00
Douglas Gregor b1373d03e4 Introduce a new, cursor-based traversal function that visits the
children of a given cursor, regardless of what kind of cursor it
is. This is a generalization of clang_loadDeclaration and
clang_loadTranslationUnit that will also extent to statements,
expressions, etc.

As proof-of-concept, switched clang_loadDeclaration() from its own
visitor over to an instance of this traversal function internally.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94022 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 20:59:29 +00:00
Douglas Gregor 20d416c36b Attempt to improve CIndex Doxygen organization, although I can't actually test this locally
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93961 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 01:10:47 +00:00
Douglas Gregor e0356b1083 Kill off clang_getDeclColumn, clang_getDeclExtent, clang_getDeclLine,
clang_getDeclSource, and clang_getDeclSourceFile; the cursor
equivalents are the way of the future.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93955 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 00:26:57 +00:00
Douglas Gregor 7eaa8ae869 Introduce a special cursor kind for the translation unit, to serve as
the root of the conceptual cursor hierarchy (just like we do with
declarations). This will be used when we get to unify
clang_loadTranslationUnit() and clang_loadDeclaration() into something
more generally useful.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93954 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 00:23:15 +00:00
Douglas Gregor 36103f4d8b CXCursor_UnexposedDecl to the first declaration kind
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93952 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 00:07:45 +00:00
Douglas Gregor e0ca4baa1d Kill CXCursor_ObjCSelectorRef, CXCursor_VarRef, CXCursor_FunctionRef,
and CXCursor_EnumConstantRef; they've been subsumed by expression
references, which do a much nicer job.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93947 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 23:25:01 +00:00
Douglas Gregor 97b9872d57 Extend the CIndex API with direct support for expressions and
statements, moving some of the more unnatural kinds of references
(VarRef, EnumConstantRef, etc.) over to the expressions. We can now
poke at arbitrary expressions and statements with, e.g.,
clang_getCursor() and get back useful information (e.g., source
ranges).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93946 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 23:20:36 +00:00
Douglas Gregor e8c7043f6c Kill the unused and unnecessary CXCursor_MemberRef, twin to the
now-dead CXCursor_ObjCIvarRef.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93928 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 22:15:34 +00:00
Douglas Gregor 5a5ec3a318 Kill CXCursor_ObjCIvarRef. Such cursors could never be created, and
have been marked for death for a while.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93927 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 22:11:32 +00:00
Douglas Gregor 301221313b Introduce the notion of an "unexposed" declaration into the CIndex
API. This is a catch-all for any declaration known to Clang but not
specifically part of the CIndex API. We'll use the same approach with
expressions, statements, references, etc., as needed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93924 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 22:07:56 +00:00
Douglas Gregor 1db19dea8d Rework the CXSourceLocation and CXSourceRange APIs. They are now
opaque data structures accessed through the new functions
clang_getInstantiationLocation(), clang_getRangeStart(), and
clang_getRangeEnd(). The new API permits later extensions to introduce
new functions to allow CIndex clients to walk macro instantiations, if
we ever care.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93915 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 21:36:55 +00:00
Douglas Gregor b699866820 Eliminate cursor kinds used to express definitions. Instead, provide
CIndex functions that (1) map from a reference or declaration to the
corresponding definition, if available, and (2) determine whether a
given declaration cursor is also a definition. This eliminates a lot
of duplication in the cursor kinds, and maps more closely to the Clang
ASTs.

This is another API + ABI breaker with no deprecation. Yay, progress.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93893 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 19:34:47 +00:00
Douglas Gregor c5d1e9375d Introduce clang_getCursorReferenced, to get a cursor pointing at the
entity that a particular cursor references.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93830 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 01:20:04 +00:00
Douglas Gregor a7bde20f8c Implement clang_getCursorExtent, which provides a source range for the
cursor itself. In particular, for references this returns the source
range of the reference rather than the source range of the thing it
refers to.

Switch c-index-test from clang_getDeclExtent (which will eventually be
deprecated and removed) over to clang_getCursorExtent. The source
ranges we print for references now make sense; fix up the tests
appropriately.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93823 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 00:34:46 +00:00
Douglas Gregor 547836fad9 Now that a reasonable deprecation cycle has passed, kill
clang_getCursorLine(), clang_getCursorColumn(),
clang_getCursorSource(), and clang_getCursorSourceFile() outright.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93801 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:48:04 +00:00
Douglas Gregor 98258afae6 Introduce clang_getCursorLocation(), which supercedes
clang_getCursorLine(), clang_getCursorColumn(),
clang_getCursorSource(), and clang_getCursorSourceFile(). Mark those 4
functions as deprecated and stop using them ourselves.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93800 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:46:11 +00:00
Douglas Gregor 3c7313d96c Clean up the CIndex API slightly.
Renamed CXSourceFileLine to CXSourceLocation and added a CXFile, to
better match Clang's SourceLocation. Teach clang_getDeclExtent to fill
in the CXFile properly.

Renamed CXSourceExtent to CXSourceRange, to better match Clang's
SourceLocation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93783 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:13:09 +00:00
Ted Kremenek cf84aa46de Replace clang_getDeclUSR() with clang_getCursorUSR(). Also remove printing 'contexts' from c-index-test output; it wasn't helpful and was extremely brittle.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93760 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 20:23:29 +00:00
Ted Kremenek deb06bd356 Remove 'default' case in switch statement in clang_getCursorKindSpelling(). This identified a missing case (warned by the compiler) and identified that CXCursor_FirstDecl didn't actually correspond to the first decl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93622 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 02:02:09 +00:00
Douglas Gregor 283cae37b0 Make CXCursor's data opaque.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93561 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 21:56:13 +00:00
Ted Kremenek b89e8f64e6 Add 'referringDecl' field to CXCursor to prepare the way to better model declaration references from other delcarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93343 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 19:59:20 +00:00
Ted Kremenek c50277f748 Rename clang_getUSR() -> clang_getDeclUSR(). For now we take a CXDecl instead of a CXEntity.
Enhance USR generation a bit with support for records.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93267 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 23:33:42 +00:00
Ted Kremenek 1fc00e6e49 Change clang_getUSR() to return a CXString instead of a 'const char *'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93213 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 00:38:53 +00:00
Ted Kremenek 3172383341 CIndex:
- Remove unused (and unimplemented) clang_getDeclarationName().
- Remove unused (and unimplemented) clang_getEntity().
- Add clang_getEntityFromDecl(): maps from a CXDecl to a CXEntity)
- Add clang_getDeclaration(): maps from a (CXEntity, CXTranslationUnit) to a CXDecl).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93209 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 23:56:39 +00:00
Douglas Gregor 01dfea02d1 Improve code completion by introducing patterns for the various C and
C++ grammatical constructs that show up in top-level (namespace-level)
declarations, member declarations, template declarations, statements,
expressions, conditions, etc. For example, we now provide a pattern
for

  static_cast<type>(expr)

when we can have an expression, or

  using namespace identifier;

when we can have a using directive.

Also, improves the results of code completion at the beginning of a
top-level declaration. Previously, we would see value names (function
names, global variables, etc.); now we see types, namespace names,
etc., but no values.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93134 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-10 23:08:15 +00:00
Ted Kremenek 6ab9db10c5 For now, add back clang_getDeclSource().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93003 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-08 17:11:32 +00:00
Ted Kremenek d8210650ed Change clang_getDeclExtent() to have the endpoint point to the last character in the last token.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92869 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 23:43:31 +00:00
Daniel Dunbar 3aacd53816 Add missing CINDEX_LINKAGE.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92827 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 06:51:48 +00:00
Ted Kremenek 817db7cb9b Remove deprecated function 'clang_getDeclSource()'. Use 'clang_getDeclFile()' instead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92803 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 23:21:30 +00:00
Ted Kremenek fe6fd3d41a Add C API hook 'clang_getDeclExtent()', which returns the source extent of a declaration. This implements <rdar://problem/7280072>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92802 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 23:18:49 +00:00
Ted Kremenek 1b6869a183 Split (mostly nonexistent) USR code out from the main CIndex logic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92789 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 22:06:45 +00:00
Douglas Gregor ff5ce6eefc Extend code-completion results with the type of each result
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91702 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 18:53:37 +00:00
Douglas Gregor ec6762c709 Change clang_codeComplete API to return the results in a structure on
the heap, so that clients are not forced to copy the results during
the initial iteration. A separate clang_disposeCodeCompleteResults
function frees the returned results.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91690 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 16:20:58 +00:00
Chandler Carruth 3d31560343 Include <time.h> in order to use 'time_t'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91597 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 09:27:29 +00:00
Daniel Dunbar 8506dde586 Switch clang_createTranslationUnitFromSourceFile to use ASTUnit::LoadFromCommandLine.
- This is much faster, as it avoids the overhead of dumping an AST file to disk and reloading it.
 - For debugging purposes, there is a clang_setUseExternalASTGeneration hook which can be used to disable this.

On the Sketch Cocoa app, the speedup is pretty nice, especially when using a PCH file while scanning the source:

Wall time to c-index-test all files (no PCH):
Old: 23.4221
New: 12.3884

Wall time to c-index-test all files (with a PCH, and "local" mode):
Old: 10.9233
New:  1.9038

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90385 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 01:54:28 +00:00
Douglas Gregor 735df88a38 Extend the CIndex code-completion API to perform code completion
involving unsaved files, using the -remap-file= functionality recently
added to clang-cc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90314 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 09:21:34 +00:00
Ted Kremenek 7388555543 Add clang_getNullCursor() and clang_equalCursors() (the latter for comparing cursors).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89131 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 19:28:59 +00:00
Ted Kremenek 4633d1b269 Allow "source_filename" to be an optional argument (the client can provide NULL). This allows the client to put the source_filename in the command_line_args without fear of the file being named twice.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89118 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 18:18:02 +00:00
Steve Naroff ef0cef6cec Introduce CXString type and associated functions clang_getCString() and clang_disposeString().
This abstraction will help us manage string memory for complex names that cross the C++/C boundary (e.g. ObjC methods, selectors). This patch also uses it in clang_getTranslationUnitSpelling (which I'm not sure is necessary). Will investigate later...since the extra malloc() can't hurt (for now).

Patch by John Thompson.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86562 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 17:45:52 +00:00
Douglas Gregor 0c8296dfb4 Various improvements to Clang's code-completion infrastructure:
- Introduce more code-completion string "chunk" kinds that describe
  symbols, the actual text that the user is expected to type, etc.
  - Make the generation of macro results optional, since it can be
  slow
  - Make code-completion accessible through the C API, marshalling the
  code-completion results through a temporary file (ick) to maintain
  process separation.

The last doesn't have tests yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86306 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 00:00:49 +00:00
Douglas Gregor 08b0e8daeb Add two missing CINDEX_LINKAGE uses, in libCIndex, from Kovarththanan
Rajaratnam!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85665 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 15:48:08 +00:00
Steve Naroff f96b524306 Remove _clang_initCXLookupHint() and _clang_getCursorWithHint(). Related to <rdar://problem/7310688>.
Localize the optimization to ResolveLocationInAST(). The last valid AST location is now stored with ASTUnit. There still isn't optimal, however it's an improvement (with a much cleaner API). Having the client manage an "hint" is error prone and complex.

I wanted to land the major changes before finishing up the optimizations. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85425 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 20:44:47 +00:00
Steve Naroff 8814503469 Add support for 'CXFile' (<rdar://problem/7303360>).
- 4 new functions (clang_getCursorSourceFile, clang_getDeclSourceFile, clang_getFileName, clang_getFileTime).

- Should remove clang_getDeclSource() and clang_getCursorSource(). For now, just put 'deprecate' comment in header. 

- Also changed CXX style comment to C style (to eliminate warning).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85238 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 14:35:18 +00:00
John Thompson 2e06fc877a Changes for building as a Windows DLL
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85234 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 13:42:56 +00:00
Ted Kremenek fbcb2b716b Split clang_getCursor() into clang_getCursor() and clang_getCursorWithHint().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84873 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 17:22:53 +00:00
Ted Kremenek 139ba86a36 Enhance 'clang_createTranslationUnitFromSourceFile()' in two ways:
(1) Allow the source file to be specified in the actual command line arguments by allowing the
    caller to set 'source_filename' to NULL.

(2) Automatically strip off the arguments '-emit-ast', '-fsyntax-only', and '-c'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84802 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 00:03:57 +00:00
Steve Naroff 6a6de8b4fc Extend clang_getCursor() to take a 'relativeDecl' argument (so speed up searching). Without a 'relativeDecl', the algorithm is n-squared. For example, running the following command on 'Large.m' takes hours without a 'relatvieDecl'.
snaroff% time ../../Debug/bin/c-index-test Large.ast all > Large.out
snaroff% cat Large.m
#import <Cocoa/Cocoa.h>
#import <QuickTime/QuickTime.h>
#import <OpenGL/OpenGL.h>

With a 'relativeDecl', it takes <30 seconds:-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84760 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 13:56:23 +00:00
Steve Naroff b4ece6377d Add an example to help claify the process/assumptions...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84642 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 16:36:34 +00:00
Steve Naroff e56b4baeba - Extend clang_createIndex() to support PCH and diagnostic 'filtering'. This seems cleaner to me without sacrificing much flexibility.
- Remove clang_wantOnlyLocalDeclarations().

- Remove 'displayDiagnostics' arguments to clang_createTranslationUnitFromSourceFile() and clang_createTranslationUnit().

- Have clang_createTranslationUnitFromSourceFile() strip the '-o <outfile>' command line arguments if they exist. Document this semantic in the header. Also verify we have a valid ASTUnit before telling it to 'unlinkTemporaryFile()'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84634 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 14:46:24 +00:00
Ted Kremenek 1374598619 Really fix <rdar://problem/7312058> by adding a 'displayDiagnostics' option to
clang_createTranslationUnit() and clang_createTranslationUnitFromSourceFile(). The user can now
specify if the diagnostics from Clang are printed to stderr or are silenced completely. We can
obviously evolve this API to be more general in the future.

Note: Added a FIXME since I wasn't certain what was the best way to redirect to something analogous
to '/dev/null' on Windows.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84548 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:15:09 +00:00
Douglas Gregor 7d1d49d297 Keep track of whether declararions were loaded from a precompiled
header or not via a new "PCHLevel" field in Decl. We currently use
this information to help CIndex filter out declarations that came from
a precompiled header (rather than from an AST file). Further down the
road, it can be used to help implement multi-level precompiled
headers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84267 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 20:01:17 +00:00
Steve Naroff 5b7d8e254f Implement <rdar://problem/7303432> [Clang/Index] In-memory-style AST generation API (initial API implementation).
Added clang_createTranslationUnitFromSourceFile().
Changed clang_createIndex() to lookup the location of clang (using dladdr).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84198 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 20:04:39 +00:00
Steve Naroff ee9405e807 Add clang_getDeclSource().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82807 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 21:45:39 +00:00
Steve Naroff 699a07d8a0 Add clang_getDeclLine and clang_getDeclColumn
Fix clang_getCursorDecl to do the right thing for expr refs
Fixup test file to accommodate new output (which includes the line/column for the referenced decl)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82798 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 21:32:34 +00:00
Steve Naroff 4ade6d6eae More work to enable more exhaustive testing of the indexing API.
Next step: Add actual some test cases:-)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82636 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 17:52:52 +00:00
Steve Naroff fb5704295c - Implement support for various types of "refs" (initially to help test clang_getCursor()).
- Add missing prototypes for dispose functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82564 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 19:25:29 +00:00
Chris Lattner 459789b8d2 fit in 80 cols
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82073 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 20:18:54 +00:00
Steve Naroff 77128ddd30 - clang_getCursor(): Replace asserts with error codes (CXCursor_InvalidFile, CXCursor_NoDeclFound).
- Add predicate clang_isInvalid().
- Implement clang_getCursorFromDecl().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81908 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 20:25:34 +00:00
Steve Naroff af08ddc8f1 - Add back some harmless code that part of a reverted commit (r80859). I'll investigate the lifetime snafu (with ASTUnit) separately.
- Traverse category methods, add a "class ref" and make the little test harness a bit more flexible.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80921 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 15:49:00 +00:00
Daniel Dunbar bce6f62ae7 Revert "Visit function/method bodies and issue callback for parameters and local
variables.", this is breaking x86_64-apple-darwin10 and Linux tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80896 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 05:59:50 +00:00
Steve Naroff 23d8bea705 Visit function/method bodies and issue callback for parameters and local variables.
Add clang_getTranslationUnitSpelling().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80859 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 00:32:06 +00:00
Steve Naroff f334b4e3ed Start issuing callback for references (add some predicates, refactor some code).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80810 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 18:26:48 +00:00
Steve Naroff c857ea4d22 Flesh out CXCursorKind...
- More declaration types (distinguish between struct/union/class, instance/class methods).
- Add definition types (class, category, function, instance/class method, etc.).

Add client data to clang_loadDeclaration() and implement.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80787 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 13:28:54 +00:00
Steve Naroff b7cd17cfd2 Tweak comment based on Daniel's recently added '-emit-ast' option.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80684 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 17:13:31 +00:00
Steve Naroff 2b8ee6c299 Add explicit "blind" client data to callback function (since we aren't using blocks).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80673 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 15:55:40 +00:00
Steve Naroff 2d4d629d8a Implement source/line/column hooks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80585 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 14:26:51 +00:00
Steve Naroff 89922f86f4 More fleshing out the C-based indexing API (under construction).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80529 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 00:59:03 +00:00
Steve Naroff 50398199fb Lot's of little changes to get the C-based indexing API going...
Work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80367 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 15:28:48 +00:00
Steve Naroff 7e8f8189d0 Add CX prefix to Cursor and move a comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80359 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 12:07:44 +00:00
Steve Naroff 600866cc7d Fill in Index.h header file and add stubs to implementation file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80279 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 19:51:58 +00:00
Ted Kremenek d2fa56687f Add initial boilerplate for CIndex, a shared library that will vend high-level
source symbol information (harvested by Clang) through a C API.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80166 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 22:36:44 +00:00