summaryrefslogtreecommitdiffstats
path: root/tools/libclang/CXSourceLocation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/libclang/CXSourceLocation.cpp')
-rw-r--r--tools/libclang/CXSourceLocation.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/libclang/CXSourceLocation.cpp b/tools/libclang/CXSourceLocation.cpp
index bc8d575..b7c7622 100644
--- a/tools/libclang/CXSourceLocation.cpp
+++ b/tools/libclang/CXSourceLocation.cpp
@@ -198,6 +198,17 @@ static void createNullLocation(CXString *filename, unsigned *line,
extern "C" {
+int clang_Location_isInSystemHeader(CXSourceLocation location) {
+ const SourceLocation Loc =
+ SourceLocation::getFromRawEncoding(location.int_data);
+ if (Loc.isInvalid())
+ return 0;
+
+ const SourceManager &SM =
+ *static_cast<const SourceManager*>(location.ptr_data[0]);
+ return SM.isInSystemHeader(Loc);
+}
+
void clang_getExpansionLocation(CXSourceLocation location,
CXFile *file,
unsigned *line,
OpenPOWER on IntegriCloud