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

[ROCm/hip commit: c87ab05fc6]
This commit is contained in:
Evgeny Mankov
2019-11-06 14:30:39 +03:00
parent 93bd983bbf
commit 1776ff55d3
3 changed files with 11 additions and 1 deletions
@@ -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