[libclang] Add translateCXRangeToCharRange conversion
Add new conversion with clearly specified semantics.
https://reviews.llvm.org/D86990
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index 93f9797..683b517 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -164,6 +164,12 @@
return Result;
}
+CharSourceRange cxloc::translateCXRangeToCharRange(CXSourceRange R) {
+ return CharSourceRange::getCharRange(
+ SourceLocation::getFromRawEncoding(R.begin_int_data),
+ SourceLocation::getFromRawEncoding(R.end_int_data));
+}
+
//===----------------------------------------------------------------------===//
// Cursor visitor.
//===----------------------------------------------------------------------===//