summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineCheckDebugify.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/MachineCheckDebugify.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineCheckDebugify.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/MachineCheckDebugify.cpp b/llvm/lib/CodeGen/MachineCheckDebugify.cpp
index bd7f0f862947..49b2c822eaeb 100644
--- a/llvm/lib/CodeGen/MachineCheckDebugify.cpp
+++ b/llvm/lib/CodeGen/MachineCheckDebugify.cpp
@@ -27,9 +27,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 +34,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 +106,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.