[llvm] [OpenMP] Remove the LocationDescription constructor that dropped the location. (PR #221949)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 11 04:48:05 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-openmp

Author: Abid Qadeer (abidh)

<details>
<summary>Changes</summary>

LocationDescription had an implicit conversion from a bare insertion point, so     `ompBuilder->emitSomething(someInsertPoint, ...)` compiled happily and silently  produced an empty debug location. Because  updateToLocation() installs the location unconditionally, this was worse than a missing assignment: it cleared whatever the builder was carrying, and the emitted runtime call ended up with no !dbg. On the device those calls are inlinable, so the verifier rejects them once the runtime carries debug info -- which is how this kept turning up as bug reports rather than as anything visible at the callsite.
    
With the callers in OMPIRBuilder, OpenMPOpt, the MLIR translation and clang all converted, the constructor can go, and the compiler will now refuse the shape that caused the problem. Callers have to say which location they mean: pass the IRBuilder to take its current one, or spell out the insertion point and location as a pair.

---
Full diff: https://github.com/llvm/llvm-project/pull/221949.diff


1 Files Affected:

- (modified) llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h (-1) 


``````````diff
diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h b/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
index e4fffae9a7bbe..a13832d69b6a0 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
+++ b/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
@@ -744,7 +744,6 @@ class OpenMPIRBuilder {
   struct LocationDescription {
     LocationDescription(const IRBuilderBase &IRB)
         : IP(IRB.saveIP()), DL(IRB.getCurrentDebugLocation()) {}
-    LocationDescription(const InsertPointTy &IP) : IP(IP) {}
     LocationDescription(const InsertPointTy &IP, const DebugLoc &DL)
         : IP(IP), DL(DL) {}
     InsertPointTy IP;

``````````

</details>


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


More information about the llvm-commits mailing list