[llvm] [llvm][YAML] Support aliases (anchors) in YAMLIO (PR #146371)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 9 00:50:35 PDT 2026


https://github.com/jh7370 commented:

Just trying to wrap my head around this, which I think is mostly confused by the YAML terminology rather than anything else: am I right in thinking that this could be used with yaml2obj to, for example, simplify a YAML doc that contained a series of identical sections, so that you'd describe it in the first case, then reference the alias thereafter? Something like:

```
---!ELF
<snip>
Sections:
  - Name: .sec
    Type: SHT_PROGBITS
  - Name: .sec
    Type: SHT_PROGBITS
  - Name: .sec
    Type: SHT_PROGBITS
```
could become
```
---!ELF
<snip>
Sections:
  - &section
    Name: .sec
    Type: SHT_PROGBITS
  - *section
  - *section
```

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


More information about the llvm-commits mailing list