[llvm] [GlobalOpt] Update debug info when changing CC to Fast (PR #144303)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 8 10:52:21 PDT 2025


================
@@ -1920,6 +1920,14 @@ static void RemovePreallocated(Function *F) {
   }
 }
 
+static unsigned char GetDebugInfoFastCC(const Triple &Triple) {
+  if (Triple.isOSWindows() && Triple.isArch32Bit()) {
+    return llvm::dwarf::DW_CC_BORLAND_msfastcall;
+  }
+
+  return llvm::dwarf::DW_CC_normal;
+}
+
----------------
dwblaikie wrote:

We do - the subprogram data is attached to the llvm::Function (so, technically, you could be looking at a subprogram without knowing what function it came from, but that's fixable)

I guess in the case where a DWARF function declaration is emitted with no associated LLVM IR, it might be a problem - in theory we could/may need to still carry a calling convention down through the debug info metadata to handle cases like that.

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


More information about the llvm-commits mailing list