Better way to check if a CallInst is a debug inst (#3997)

This commit is contained in:
Adam Yang 2021-10-11 22:16:12 -07:00 коммит произвёл GitHub
Родитель 029634871a
Коммит ac1683bb94
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -40,6 +40,7 @@
#include "llvm/IR/Constants.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/DiagnosticPrinter.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Verifier.h"
#include "llvm/IR/ModuleSlotTracker.h"
#include "llvm/ADT/BitVector.h"
@ -746,8 +747,7 @@ struct ValidationContext {
}
bool IsDebugFunctionCall(Instruction *I) {
CallInst *CI = dyn_cast<CallInst>(I);
return CI && CI->getCalledFunction()->getName().startswith("llvm.dbg.");
return isa<DbgInfoIntrinsic>(I);
}
Instruction *GetDebugInstr(Instruction *I) {