summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-09-28 18:14:21 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-09-28 18:14:21 +0000
commite7e42914484ae1f01240d7430353f1578f909ae0 (patch)
treefde4d11bdde1894f0bed33b850a2159569f522bb
parent6f37b4a5a5d0a2dcf443a3cf065de88f3bcf5284 (diff)
downloadbcm5719-llvm-e7e42914484ae1f01240d7430353f1578f909ae0.tar.gz
bcm5719-llvm-e7e42914484ae1f01240d7430353f1578f909ae0.zip
[libclang] Introduce clang_Range_isNull.
llvm-svn: 140706
-rw-r--r--clang/include/clang-c/Index.h5
-rw-r--r--clang/tools/libclang/CIndex.cpp5
-rw-r--r--clang/tools/libclang/libclang.exports1
3 files changed, 11 insertions, 0 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h
index f1e62ae4207..e37779ce066 100644
--- a/clang/include/clang-c/Index.h
+++ b/clang/include/clang-c/Index.h
@@ -336,6 +336,11 @@ 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.
*
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index 73718174177..a8126315ca5 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -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,
diff --git a/clang/tools/libclang/libclang.exports b/clang/tools/libclang/libclang.exports
index 4ebbf9ebd69..89d41318d94 100644
--- a/clang/tools/libclang/libclang.exports
+++ b/clang/tools/libclang/libclang.exports
@@ -142,6 +142,7 @@ clang_isUnexposed
clang_isVirtualBase
clang_isVolatileQualifiedType
clang_parseTranslationUnit
+clang_Range_isNull
clang_remap_dispose
clang_remap_getFilenames
clang_remap_getNumFiles
OpenPOWER on IntegriCloud