[PATCH] D151419: [DebugInfo][RemoveDIs] Eliminate some debug-intrinsics-affect-codegen errors

J. Ryan Stinnett via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 30 04:27:34 PDT 2023


jryans added inline comments.


================
Comment at: llvm/lib/IR/BasicBlock.cpp:423-425
   DebugLoc Loc = I->getDebugLoc();
+  if (isa<DbgInfoIntrinsic>(&*I))
+    Loc = I->getNextNonDebugInstruction()->getDebugLoc();
----------------
It might be to structure this as an `if ... else ...` so we always test `isa<DbgInfoIntrinsic>(&*I)` first, instead of unconditionally calling `I->getDebugLoc()` and then potentially replacing it...? (If you agree, then the same comment applies to quite a few other changes here.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151419/new/

https://reviews.llvm.org/D151419



More information about the llvm-commits mailing list