[PATCH] D46525: [Debugify] Introduce debugify-each and DebugifyFunctionPass

Son Tuan Vu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 13 01:41:42 PDT 2018


tyb0807 added a comment.

Thank you Vedant. I do not have commit access, please commit this for me.



================
Comment at: tools/opt/Debugify.cpp:281
+  bool doInitialization(Module &M) override {
+    ShouldApply = M.getNamedMetadata("llvm.dbg.cu") == nullptr;
+    if (!ShouldApply)
----------------
vsk wrote:
> I don't think we should compute and store ShouldApply in the doInitialization() step, because it happens just once per pass. It should be done in the `applyDebugifyMetadata` function.
Oh well the reason for ShouldApply is that I don't want to print the error message for every function. I agree that this looks ugly but if you're ok with having the message printed multiple times for the same check pass then I'll remove this


================
Comment at: tools/opt/Debugify.cpp:207
+    if (Function *F = M.getFunction("llvm.dbg.value"))
+      F->eraseFromParent();
+    return true;
----------------
vsk wrote:
> I still don't understand why we need to erase the declaration of llvm.dbg.value() from the module. Shouldn't StripDebugInfo() do this for us? If not, we should just fix StripDebugInfo() in a follow-up patch.
I guess it should do this, but actually it doesn't. Removing this here and submitting another patch to fix StripDebugInfo()


Repository:
  rL LLVM

https://reviews.llvm.org/D46525





More information about the llvm-commits mailing list