summaryrefslogtreecommitdiffstats
path: root/clang/include/clang-c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-10-20 22:00:55 +0000
committerDouglas Gregor <dgregor@apple.com>2010-10-20 22:00:55 +0000
commit796d76a663795d66ed5aa97a1f585514dd68b043 (patch)
tree98f71284a72e7f7714726b6ac5058e61dc56d97d /clang/include/clang-c
parent2edaa2fb24eb17fbb6b3752ddb7d06a8d6b0799e (diff)
downloadbcm5719-llvm-796d76a663795d66ed5aa97a1f585514dd68b043.tar.gz
bcm5719-llvm-796d76a663795d66ed5aa97a1f585514dd68b043.zip
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. llvm-svn: 116952
Diffstat (limited to 'clang/include/clang-c')
-rw-r--r--clang/include/clang-c/Index.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h
index 40d3bafaff3..7f569d28834 100644
--- a/clang/include/clang-c/Index.h
+++ b/clang/include/clang-c/Index.h
@@ -1190,8 +1190,9 @@ enum CXCursorKind {
CXCursor_PreprocessingDirective = 500,
CXCursor_MacroDefinition = 501,
CXCursor_MacroInstantiation = 502,
+ CXCursor_InclusionDirective = 503,
CXCursor_FirstPreprocessing = CXCursor_PreprocessingDirective,
- CXCursor_LastPreprocessing = CXCursor_MacroInstantiation
+ CXCursor_LastPreprocessing = CXCursor_InclusionDirective
};
/**
@@ -1466,6 +1467,12 @@ CINDEX_LINKAGE void clang_getOverriddenCursors(CXCursor cursor,
CINDEX_LINKAGE void clang_disposeOverriddenCursors(CXCursor *overridden);
/**
+ * \brief Retrieve the file that is included by the given inclusion directive
+ * cursor.
+ */
+CINDEX_LINKAGE CXFile clang_getIncludedFile(CXCursor cursor);
+
+/**
* @}
*/
OpenPOWER on IntegriCloud