r196591 - [libclang] Rename CXSkippedRanges to CXSourceRangeList to make it more future-proof.

Argyrios Kyrtzidis akyrtzi at gmail.com
Fri Dec 6 10:55:46 PST 2013


Author: akirtzidis
Date: Fri Dec  6 12:55:45 2013
New Revision: 196591

URL: http://llvm.org/viewvc/llvm-project?rev=196591&view=rev
Log:
[libclang] Rename CXSkippedRanges to CXSourceRangeList to make it more future-proof.

Suggested by Alp Toker.

Modified:
    cfe/trunk/include/clang-c/Index.h
    cfe/trunk/tools/c-index-test/c-index-test.c
    cfe/trunk/tools/libclang/CIndex.cpp
    cfe/trunk/tools/libclang/libclang.exports

Modified: cfe/trunk/include/clang-c/Index.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=196591&r1=196590&r2=196591&view=diff
==============================================================================
--- cfe/trunk/include/clang-c/Index.h (original)
+++ cfe/trunk/include/clang-c/Index.h Fri Dec  6 12:55:45 2013
@@ -599,31 +599,30 @@ CINDEX_LINKAGE CXSourceLocation clang_ge
 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);
 
 /**
  * @}

Modified: cfe/trunk/tools/c-index-test/c-index-test.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/c-index-test/c-index-test.c?rev=196591&r1=196590&r2=196591&view=diff
==============================================================================
--- cfe/trunk/tools/c-index-test/c-index-test.c (original)
+++ cfe/trunk/tools/c-index-test/c-index-test.c Fri Dec  6 12:55:45 2013
@@ -3183,7 +3183,7 @@ int perform_token_annotation(int argc, c
   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, c
     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 = "<unknown>";

Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=196591&r1=196590&r2=196591&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Fri Dec  6 12:55:45 2013
@@ -6494,8 +6494,8 @@ void clang_disposeCXTUResourceUsage(CXTU
     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(
   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;
   }
 }
 

Modified: cfe/trunk/tools/libclang/libclang.exports
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/libclang.exports?rev=196591&r1=196590&r2=196591&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/libclang.exports (original)
+++ cfe/trunk/tools/libclang/libclang.exports Fri Dec  6 12:55:45 2013
@@ -101,7 +101,7 @@ clang_disposeDiagnosticSet
 clang_disposeIndex
 clang_disposeOverriddenCursors
 clang_disposeCXPlatformAvailability
-clang_disposeSkippedRanges
+clang_disposeSourceRangeList
 clang_disposeString
 clang_disposeTokens
 clang_disposeTranslationUnit





More information about the cfe-commits mailing list