[HIPIFY] LLVM compatibility

+ sys::fs::make_absolute fro LLVM < 5.0
+ sys::fs::real_path for LLVM >= 5.0
This commit is contained in:
emankov
2018-12-28 01:34:35 +03:00
parent e068944154
commit 723c58afa4
3 changed files with 15 additions and 3 deletions
+9
View File
@@ -94,4 +94,13 @@ clang::SourceLocation getEndLoc(const clang::TypeLoc& typeLoc) {
#endif
}
std::error_code real_path(const Twine &path, SmallVectorImpl<char> &output,
bool expand_tilde) {
#if LLVM_VERSION_MAJOR < 5
return sys::fs::make_absolute(path, output);
#else
return sys::fs::real_path(path, output, expand_tilde);
#endif
}
} // namespace llcompat