[PATCH] D40512: [Debugify] Add a pass to test debug info preservation

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 5 13:26:28 PST 2017


aprantl added inline comments.


================
Comment at: tools/opt/Debugify.cpp:79
+      for (Instruction &I : BB)
+        I.setDebugLoc(DILocation::get(Ctx, NextLine++, 1, SP));
+
----------------
Sorry for having this idea so late, but: Would it make sense to combine this with the DebugIR pass, so, instead of assigning arbitrary artificial DILocations, the DILocations actually point back to the original instructions in the IR and are perhaps more useful when debugging a pass?


================
Comment at: tools/opt/Debugify.cpp:174
+
+struct DebugifyPass : public ModulePass {
+  bool runOnModule(Module &M) override { return applyDebugifyMetadata(M); }
----------------
Doxygen comment explaining the purpose of the pass?


================
Comment at: tools/opt/Debugify.cpp:186
+
+struct CheckDebugifyPass : public ModulePass {
+  bool runOnModule(Module &M) override {
----------------
comment?


https://reviews.llvm.org/D40512





More information about the llvm-commits mailing list