[PATCH] D40042: Make salvageDebugInfo of casts work for dbg.declare and dbg.addr

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 13:20:16 PST 2017


aprantl accepted this revision.
aprantl added a comment.

That looks even better!



================
Comment at: llvm/lib/Transforms/Utils/Local.cpp:1296
 
+static void findDbgUsers(SmallVectorImpl<DbgInfoIntrinsic *> &DbgUsers,
+                         Value *V) {
----------------
Is there a point in keeping findDbgValues or should we just rename it?
It seems like every case where currently use it  would also apply to dbg.addr.


================
Comment at: llvm/lib/Transforms/Utils/Local.cpp:1387
 
   if (isa<BitCastInst>(&I) || isa<IntToPtrInst>(&I)) {
+    // Bitcasts are entirely irrelevant for debug info. Rewrite dbg.value,
----------------
By the way, can you find a way to turn this into a switch? I don't like this massive if-cascade, but it wasn't immediately obvious to me how to convert it.


https://reviews.llvm.org/D40042





More information about the llvm-commits mailing list