diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-12-05 08:19:32 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-12-05 08:19:32 +0000 |
commit | 9ef5775a949d2c78ba01169d0eca962f5d7c1ae7 (patch) | |
tree | b5449b4ac390544b73b20cb0b3864dab91a40150 /clang/include/clang-c | |
parent | 011e6a5f44f7085279da2afde76f7041825b8b88 (diff) | |
download | bcm5719-llvm-9ef5775a949d2c78ba01169d0eca962f5d7c1ae7.tar.gz bcm5719-llvm-9ef5775a949d2c78ba01169d0eca962f5d7c1ae7.zip |
[libclang] Record ranges skipped by the preprocessor and expose them with libclang.
Patch by Erik Verbruggen!
llvm-svn: 196487
Diffstat (limited to 'clang/include/clang-c')
-rw-r--r-- | clang/include/clang-c/Index.h | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h index 95d54c279f0..3ca92d83dce 100644 --- a/clang/include/clang-c/Index.h +++ b/clang/include/clang-c/Index.h @@ -30,7 +30,7 @@ * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable. */ #define CINDEX_VERSION_MAJOR 0 -#define CINDEX_VERSION_MINOR 20 +#define CINDEX_VERSION_MINOR 21 #define CINDEX_VERSION_ENCODE(major, minor) ( \ ((major) * 10000) \ @@ -599,6 +599,33 @@ CINDEX_LINKAGE CXSourceLocation clang_getRangeStart(CXSourceRange range); CINDEX_LINKAGE CXSourceLocation clang_getRangeEnd(CXSourceRange range); /** + * \brief Identifies an array of ranges that were skipped by the preprocessor. + * + * The preprocessor will skip lines when they are surrounded by an + * if/ifdef/ifndef directive whose condition does not evaluate to true. + */ +typedef struct { + /** \brief The number of ranges in the \c ranges array. */ + unsigned count; + /** + * \brief An array of \c CXSourceRange, where each range starts at the + * preprocessor directive after the # token, and ends at the end of the + * corresponding endif. + */ + CXSourceRange *ranges; +} CXSkippedRanges; + +/** + * \brief Retrieve all ranges that were skipped by the preprocessor. + */ +CINDEX_LINKAGE CXSkippedRanges *clang_getSkippedRanges(CXTranslationUnit tu, CXFile file); + +/** + * \brief Destroy the given \c CXSkippedRanges. + */ +CINDEX_LINKAGE void clang_disposeSkippedRanges(CXSkippedRanges *skipped); + +/** * @} */ |