llvm_mode: lower llvm version reqs to 3.4 (LLInsTrim will not be

available)
This commit is contained in:
hexcoder-
2020-05-15 01:55:33 +02:00
parent 97bddc8cfa
commit 182b8a4582
8 changed files with 40 additions and 16 deletions

View File

@ -33,7 +33,10 @@ char *getBBName(const llvm::BasicBlock *BB) {
std::string Str;
raw_string_ostream OS(Str);
#if LLVM_VERSION_MAJOR >= 4 || \
(LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7)
BB->printAsOperand(OS, false);
#endif
name = strdup(OS.str().c_str());
return name;
@ -171,7 +174,7 @@ bool isInWhitelist(llvm::Function *F) {
#else
if (!Loc.isUnknown()) {
DILocation cDILoc(Loc.getAsMDNode(C));
DILocation cDILoc(Loc.getAsMDNode(F->getContext()));
unsigned int instLine = cDILoc.getLineNumber();
StringRef instFilename = cDILoc.getFilename();