[llvm] [DebugInfo] Make DIExpression inherit from Metadata and it always should be unique (PR #79335)

Stephen Tozer via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 24 13:26:35 PST 2024


================
@@ -173,6 +174,7 @@ class MachineOperand {
     int64_t ImmVal;          // For MO_Immediate.
     const uint32_t *RegMask; // For MO_RegisterMask and MO_RegisterLiveOut.
     const MDNode *MD;        // For MO_Metadata.
+    const Metadata* Expr;
----------------
SLTozer wrote:

For the MachineOperand implementation, I think it would be better to change the existing field to `Metadata*` if possible - although we don't lose any space by having the extra field since this is part of a union, we also don't gain much by having one field for `Metadata*` and one field for `MDNode*`, since the former can hold the latter without issue (and for most or all of the cases where we use MDNode we need to check type info and cast anyway).

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


More information about the llvm-commits mailing list