From: Argyrios Kyrtzidis Date: Fri, 6 Dec 2013 18:55:45 +0000 (+0000) Subject: [libclang] Rename CXSkippedRanges to CXSourceRangeList to make it more future-proof. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2e8977fb3fb6211b392d83c0e6f650fbcdb95bab;p=clang [libclang] Rename CXSkippedRanges to CXSourceRangeList to make it more future-proof. Suggested by Alp Toker. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196591 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h index 3ca92d83dc..04c3a652bd 100644 --- a/include/clang-c/Index.h +++ b/include/clang-c/Index.h @@ -599,31 +599,30 @@ 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. + * \brief Identifies an array of ranges. */ 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. + * \brief An array of \c CXSourceRanges. */ CXSourceRange *ranges; -} CXSkippedRanges; +} CXSourceRangeList; /** * \brief Retrieve all 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. */ -CINDEX_LINKAGE CXSkippedRanges *clang_getSkippedRanges(CXTranslationUnit tu, CXFile file); +CINDEX_LINKAGE CXSourceRangeList *clang_getSkippedRanges(CXTranslationUnit tu, + CXFile file); /** - * \brief Destroy the given \c CXSkippedRanges. + * \brief Destroy the given \c CXSourceRangeList. */ -CINDEX_LINKAGE void clang_disposeSkippedRanges(CXSkippedRanges *skipped); +CINDEX_LINKAGE void clang_disposeSourceRangeList(CXSourceRangeList *ranges); /** * @} diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c index 39cdcc149e..9288f92d17 100644 --- a/tools/c-index-test/c-index-test.c +++ b/tools/c-index-test/c-index-test.c @@ -3183,7 +3183,7 @@ int perform_token_annotation(int argc, const char **argv) { CXSourceLocation startLoc, endLoc; CXFile file = 0; CXCursor *cursors = 0; - CXSkippedRanges *skipped_ranges = 0; + CXSourceRangeList *skipped_ranges = 0; unsigned i; input += strlen("-test-annotate-tokens="); @@ -3283,7 +3283,7 @@ int perform_token_annotation(int argc, const char **argv) { PrintExtent(stdout, start_line, start_column, end_line, end_column); printf("\n"); } - clang_disposeSkippedRanges(skipped_ranges); + clang_disposeSourceRangeList(skipped_ranges); for (i = 0; i != num_tokens; ++i) { const char *kind = ""; diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index c8bff73935..e7da9620dc 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -6494,8 +6494,8 @@ void clang_disposeCXTUResourceUsage(CXTUResourceUsage usage) { delete (MemUsageEntries*) usage.data; } -CXSkippedRanges *clang_getSkippedRanges(CXTranslationUnit TU, CXFile file) { - CXSkippedRanges *skipped = new CXSkippedRanges; +CXSourceRangeList *clang_getSkippedRanges(CXTranslationUnit TU, CXFile file) { + CXSourceRangeList *skipped = new CXSourceRangeList; skipped->count = 0; skipped->ranges = 0; @@ -6528,10 +6528,10 @@ CXSkippedRanges *clang_getSkippedRanges(CXTranslationUnit TU, CXFile file) { return skipped; } -void clang_disposeSkippedRanges(CXSkippedRanges *skipped) { - if (skipped) { - delete[] skipped->ranges; - delete skipped; +void clang_disposeSourceRangeList(CXSourceRangeList *ranges) { + if (ranges) { + delete[] ranges->ranges; + delete ranges; } } diff --git a/tools/libclang/libclang.exports b/tools/libclang/libclang.exports index 896228ad3c..809cf03a10 100644 --- a/tools/libclang/libclang.exports +++ b/tools/libclang/libclang.exports @@ -101,7 +101,7 @@ clang_disposeDiagnosticSet clang_disposeIndex clang_disposeOverriddenCursors clang_disposeCXPlatformAvailability -clang_disposeSkippedRanges +clang_disposeSourceRangeList clang_disposeString clang_disposeTokens clang_disposeTranslationUnit