[llvm] [AMDGPU][CFI] Replace CFA expression escapes with typed directives (PR #221011)

Scott Linder via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 14 10:53:24 PDT 2026


================
@@ -4401,6 +4409,47 @@ bool AsmParser::parseDirectiveCFILLVMDefAspaceCfa(SMLoc DirectiveLoc) {
   return false;
 }
 
+/// parseDirectiveCFILLVMDefCfaConstantAddress
+/// ::= .cfi_llvm_def_cfa_constant_address value, address_space
+bool AsmParser::parseDirectiveCFILLVMDefCfaConstantAddress(SMLoc DirectiveLoc) {
+  int64_t Value = 0, AddressSpace = 0;
+  if (parseAbsoluteExpression(Value) || parseComma() ||
+      parseAbsoluteExpression(AddressSpace) || parseEOL())
+    return true;
+  if (Value < 0)
+    return Error(DirectiveLoc, "expected a non-negative constant CFA address");
+  if (!isUInt<32>(AddressSpace))
+    return Error(DirectiveLoc, "expected an unsigned CFA address space");
+
+  getStreamer().emitCFILLVMDefCfaConstantAddress(static_cast<uint64_t>(Value),
+                                                 AddressSpace, DirectiveLoc);
+  return false;
+}
+
+/// parseDirectiveCFILLVMDefCfaRegisterAddressTransform
+/// ::= .cfi_llvm_def_cfa_register_address_transform register, deref_size,
+/// scale,
+///                                                         address_space
----------------
slinder1 wrote:

Nit: weird comment formatting here

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


More information about the llvm-commits mailing list