]> granicus.if.org Git - clang/commitdiff
[libclang] Introduce clang_Range_isNull.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 28 Sep 2011 18:14:21 +0000 (18:14 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 28 Sep 2011 18:14:21 +0000 (18:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140706 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang-c/Index.h
tools/libclang/CIndex.cpp
tools/libclang/libclang.exports

index f1e62ae42079e985bca301bcdab13816005e85b5..e37779ce06628dfa86fe7dd07209e79a61eecd83 100644 (file)
@@ -335,6 +335,11 @@ CINDEX_LINKAGE CXSourceRange clang_getRange(CXSourceLocation begin,
 CINDEX_LINKAGE unsigned clang_equalRanges(CXSourceRange range1,
                                           CXSourceRange range2);
 
+/**
+ * \brief Returns non-zero if \arg range is null.
+ */
+int clang_Range_isNull(CXSourceRange range);
+
 /**
  * \brief Retrieve the file, line, column, and offset represented by
  * the given source location.
index 73718174177647cc14e09c030de565f3357dc11f..a8126315ca5a6eabb4a6c706b15b3a01d07b4ff7 100644 (file)
@@ -2758,6 +2758,11 @@ unsigned clang_equalRanges(CXSourceRange range1, CXSourceRange range2)
       && range1.begin_int_data == range2.begin_int_data
       && range1.end_int_data == range2.end_int_data;
 }
+
+int clang_Range_isNull(CXSourceRange range) {
+  return clang_equalRanges(range, clang_getNullRange());
+}
+
 } // end: extern "C"
 
 static void createNullLocation(CXFile *file, unsigned *line,
index 4ebbf9ebd6920d57176ffb810ab017e2eb2908a4..89d41318d944c9853794043b4a056f20b1e435a2 100644 (file)
@@ -142,6 +142,7 @@ clang_isUnexposed
 clang_isVirtualBase
 clang_isVolatileQualifiedType
 clang_parseTranslationUnit
+clang_Range_isNull
 clang_remap_dispose
 clang_remap_getFilenames
 clang_remap_getNumFiles