[llvm] [DebugInfo][RemoveDIs] Support DPValues in HWAsan (PR #78731)

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 22 05:13:39 PST 2024


================
@@ -1532,8 +1539,8 @@ void HWAddressSanitizer::sanitizeFunction(Function &F,
 
   assert(!ShadowBase);
 
-  Instruction *InsertPt = &*F.getEntryBlock().begin();
-  IRBuilder<> EntryIRB(InsertPt);
+  BasicBlock::iterator InsertPt = F.getEntryBlock().begin();
----------------
jmorse wrote:

We're in the process of changing how debug-info variable locations are recorded -- right now they're stored as intrinsics, but in the future we'll be able to attach them directly to instructions, which has a variety of benefits (efficiency and stability) because passes won't need to take account of instructions that aren't "real". As part of that, we need to put a tiny bit of debug-info into the instruction-iterator class, and have most instruction insertions be performed with iterators, hence this particular change on these lines.

I can go into detail, but by using iterators everywhere in scenarios like this, we're able to perform all the maintenance of debug-info in the background, without LLVM passes having to perform it themselves.

(There's a meaningful change that I'll describe in a main comment in a moment,)

https://github.com/llvm/llvm-project/pull/78731


More information about the llvm-commits mailing list