Fix llvm api so it works with older LLVM version (#1964)
* aa * fix * fix * fmt * fmt
This commit is contained in:
parent
91778961da
commit
cd12546748
@ -93,7 +93,11 @@ class CtxPass : public ModulePass {
|
|||||||
private:
|
private:
|
||||||
bool isLLVMIntrinsicFn(StringRef &n) {
|
bool isLLVMIntrinsicFn(StringRef &n) {
|
||||||
// Not interested in these LLVM's functions
|
// Not interested in these LLVM's functions
|
||||||
|
#if LLVM_VERSION_MAJOR >= 18
|
||||||
|
if (n.starts_with("llvm.")) {
|
||||||
|
#else
|
||||||
if (n.startswith("llvm.")) {
|
if (n.startswith("llvm.")) {
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
@ -101,12 +101,18 @@ class DumpCfgPass : public ModulePass {
|
|||||||
private:
|
private:
|
||||||
bool isLLVMIntrinsicFn(StringRef &n) {
|
bool isLLVMIntrinsicFn(StringRef &n) {
|
||||||
// Not interested in these LLVM's functions
|
// Not interested in these LLVM's functions
|
||||||
|
#if LLVM_VERSION_MAJOR >= 18
|
||||||
|
if (n.starts_with("llvm.")) {
|
||||||
|
#else
|
||||||
if (n.startswith("llvm.")) {
|
if (n.startswith("llvm.")) {
|
||||||
return true;
|
#endif
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
Loading…
x
Reference in New Issue
Block a user