From 796d76a663795d66ed5aa97a1f585514dd68b043 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 20 Oct 2010 22:00:55 +0000 Subject: 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 --- clang/include/clang-c/Index.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'clang/include/clang-c') 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 }; /** @@ -1465,6 +1466,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); + /** * @} */ -- cgit v1.2.3