[flang-commits] [flang] [flang][debug] Emit debug info for named constants (PR #213974)

Abid Qadeer via flang-commits flang-commits at lists.llvm.org
Thu Aug 6 03:54:28 PDT 2026


================
@@ -518,12 +544,20 @@ void AddDebugInfoPass::handleGlobalOp(fir::GlobalOp globalOp,
   if (modOpt)
     scope = *modOpt;
 
+  // An entity with internal linkage, such as a constant or a SAVE variable
+  // declared inside a procedure, is not visible outside this compilation unit.
+  // It also needs no linkage name because there is no external symbol for a
+  // debugger to match it against.
+  bool isLocalToUnit = globalOp.getLinkName() == "internal";
----------------
abidh wrote:

Done.

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


More information about the flang-commits mailing list