diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/CodeGen/MachineCheckDebugify.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/CodeGen/MachineCheckDebugify.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/MachineCheckDebugify.cpp b/contrib/llvm-project/llvm/lib/CodeGen/MachineCheckDebugify.cpp index bd7f0f862947..1e5b8dd0bbb0 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/MachineCheckDebugify.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/MachineCheckDebugify.cpp @@ -11,13 +11,14 @@ /// DILocalVariable which mir-debugifiy generated before. //===----------------------------------------------------------------------===// -#include "llvm/CodeGen/MachineFunctionPass.h" +#include "llvm/CodeGen/MachineBasicBlock.h" +#include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/Passes.h" -#include "llvm/IR/DebugInfo.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/DebugInfoMetadata.h" #include "llvm/InitializePasses.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Transforms/Utils/Debugify.h" +#include "llvm/Pass.h" #define DEBUG_TYPE "mir-check-debugify" @@ -27,9 +28,6 @@ namespace { struct CheckDebugMachineModule : public ModulePass { bool runOnModule(Module &M) override { - MachineModuleInfo &MMI = - getAnalysis<MachineModuleInfoWrapperPass>().getMMI(); - NamedMDNode *NMD = M.getNamedMetadata("llvm.mir.debugify"); if (!NMD) { errs() << "WARNING: Please run mir-debugify to generate " @@ -37,6 +35,9 @@ struct CheckDebugMachineModule : public ModulePass { return false; } + MachineModuleInfo &MMI = + getAnalysis<MachineModuleInfoWrapperPass>().getMMI(); + auto getDebugifyOperand = [&](unsigned Idx) -> unsigned { return mdconst::extract<ConstantInt>(NMD->getOperand(Idx)->getOperand(0)) ->getZExtValue(); @@ -106,8 +107,7 @@ struct CheckDebugMachineModule : public ModulePass { void getAnalysisUsage(AnalysisUsage &AU) const override { AU.addRequired<MachineModuleInfoWrapperPass>(); - AU.addPreserved<MachineModuleInfoWrapperPass>(); - AU.setPreservesCFG(); + AU.setPreservesAll(); } static char ID; // Pass identification. |