[HIPIFY] Add a compatibility for CharSourceRange if LLVM < 7

This commit is contained in:
Evgeny Mankov committed 2019-11-06 14:30:39 +03:00
1 parent 6833886449
commit 3dcae8760d
3 files changed
+11 -1

No files matched your search

+8
View File
@@ -151,4 +151,12 @@ bool CheckCompatibility() {
return true;
}
clang::SourceLocation getEndOfExpansionRangeForLoc(const clang::SourceManager& SM, const clang::SourceLocation& loc) {
#if LLVM_VERSION_MAJOR > 6
return SM.getExpansionRange(loc).getEnd();
#else
return SM.getExpansionRange(loc).second;
#endif
}
} // namespace llcompat