[PATCH] D53740: [globalisel][irtranslator] Verify that DILocations aren't lost in translation

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 29 08:29:53 PDT 2018


dsanders added inline comments.


================
Comment at: lib/CodeGen/GlobalISel/IRTranslator.cpp:124
+           "Inserted instruction without a current MI");
+    LLVM_DEBUG(dbgs() << "Checking DILocation from " << *CurrInst
+                      << " was copied to " << MI);
----------------
aemerson wrote:
> I think this debug print is probably unnecessary given it'll print for every instruction translated (and without ASSERTIONS it won't actually do anything).
I'm not sure I understand this comment. It sounds like you're suggesting its removal but the follow on implies the right thing to do is to wrap it in '#ifndef NDEBUG'.


================
Comment at: lib/CodeGen/GlobalISel/IRTranslator.cpp:1742
+#ifndef NDEBUG
+    Verifier.setCurrentInst(nullptr);
+#endif // ifndef NDEBUG
----------------
aemerson wrote:
> This is unnecessary as Verifier goes out of scope immediately after?
Good point


Repository:
  rL LLVM

https://reviews.llvm.org/D53740





More information about the llvm-commits mailing list