[clang] [llvm] [Dwarf] Support heterogeneous DW_{OP,AT}s needed for AMDGPU CFI (PR #153883)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 3 18:27:01 PDT 2025
================
@@ -56,10 +56,19 @@ static bool printOp(const DWARFExpression::Operation *Op, raw_ostream &OS,
assert(!Name.empty() && "DW_OP has no name!");
OS << Name;
+ std::optional<unsigned> SubOpcode = Op->getSubCode();
+ if (SubOpcode) {
+ StringRef SubName = SubOperationEncodingString(Op->getCode(), *SubOpcode);
+ assert(!SubName.empty() && "DW_OP SubOp has no name!");
+ OS << ' ' << SubName;
+ }
+
if ((Op->getCode() >= DW_OP_breg0 && Op->getCode() <= DW_OP_breg31) ||
(Op->getCode() >= DW_OP_reg0 && Op->getCode() <= DW_OP_reg31) ||
Op->getCode() == DW_OP_bregx || Op->getCode() == DW_OP_regx ||
- Op->getCode() == DW_OP_regval_type)
+ Op->getCode() == DW_OP_regval_type ||
+ (SubOpcode && (*SubOpcode == DW_OP_LLVM_call_frame_entry_reg ||
+ *SubOpcode == DW_OP_LLVM_aspace_bregx)))
----------------
arsenm wrote:
```suggestion
(SubOpcode == DW_OP_LLVM_call_frame_entry_reg ||
SubOpcode == DW_OP_LLVM_aspace_bregx))
```
https://github.com/llvm/llvm-project/pull/153883
More information about the llvm-commits
mailing list