[clang] [DebugInfo][RemoveDIs] Use iterator-inserters in clang (PR #102006)

Orlando Cazalet-Hyams via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 6 01:13:09 PDT 2024


================
@@ -295,18 +295,25 @@ void EHScopeStack::Cleanup::anchor() {}
 static void createStoreInstBefore(llvm::Value *value, Address addr,
                                   llvm::Instruction *beforeInst,
                                   CodeGenFunction &CGF) {
-  auto store = new llvm::StoreInst(value, addr.emitRawPointer(CGF), beforeInst);
+  auto store = new llvm::StoreInst(value, addr.emitRawPointer(CGF),
+                                   beforeInst->getIterator());
----------------
OCHyams wrote:

Is it worth updating the `beforeInst` parameter to a iterator instead of `->getIterator()`-ing here? That would match the `createLoadInstBefore` overload you've added in this patch too.

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


More information about the cfe-commits mailing list