llvm-project/llvm/lib/ObjectYAML
Heejin Ahn 3ec1760d91 [WebAssembly] Remove WasmTagType
This removes `WasmTagType`. `WasmTagType` contained an attribute and a
signature index:
```
struct WasmTagType {
  uint8_t Attribute;
  uint32_t SigIndex;
};
```

Currently the attribute field is not used and reserved for future use,
and always 0. And that this class contains `SigIndex` as its property is
a little weird in the place, because the tag type's signature index is
not an inherent property of a tag but rather a reference to another
section that changes after linking. This makes tag handling in the
linker also weird that tag-related methods are taking both `WasmTagType`
and `WasmSignature` even though `WasmTagType` contains a signature
index. This is because the signature index changes in linking so it
doesn't have any info at this point. This instead moves `SigIndex` to
`struct WasmTag` itself, as we did for `struct WasmFunction` in D111104.

In this CL, in lib/MC and lib/Object, this now treats tag types in the
same way as function types. Also in YAML, this removes `struct Tag`,
because now it only contains the tag index. Also tags set `SigIndex` in
`WasmImport` union, as functions do.

I think this makes things simpler and makes tag handling more in line
with function handling. These two shares similar properties in that both
of them have signatures, but they are kind of nominal so having the same
signature doesn't mean they are the same element.

Also a drive-by fix: the reserved 'attirubute' part's encoding changed
from uleb32 to uint8 a while ago. This was fixed in lib/MC and
lib/Object but not in YAML. This doesn't change object files because the
field's value is always 0 and its encoding is the same for the both
encoding.

This is effectively NFC; I didn't mark it as such just because it
changed YAML test results.

Reviewed By: sbc100, tlively

Differential Revision: https://reviews.llvm.org/D111086
2021-10-05 17:11:22 -07:00
..
ArchiveEmitter.cpp [yaml2obj][obj2yaml] - Teach tools to work with regular archives. 2020-10-28 15:27:11 +03:00
ArchiveYAML.cpp [yaml2obj][obj2yaml] - Teach tools to work with regular archives. 2020-10-28 15:27:11 +03:00
CMakeLists.txt [yaml2obj] Initial the support of yaml2obj for 32-bit XCOFF. 2021-06-07 04:14:44 +00:00
COFFEmitter.cpp [yaml2obj][COFF] Allow variable number of directories 2021-09-09 11:16:56 +01:00
COFFYAML.cpp [yaml2obj][COFF] Allow variable number of directories 2021-09-09 11:16:56 +01:00
CodeViewYAMLDebugSections.cpp
CodeViewYAMLSymbols.cpp [COFF][ARM] Fix CodeView for Windows on 32bit ARM targets. 2020-10-19 22:16:16 -07:00
CodeViewYAMLTypeHashing.cpp
CodeViewYAMLTypes.cpp [lld] Fixed CodeView GuidAdapter::format to handle GUID bytes in the right order. 2021-04-09 05:29:14 +04:00
DWARFEmitter.cpp [llvm] Populate std::vector at construction time (NFC) 2021-01-18 10:16:33 -08:00
DWARFYAML.cpp Reland "[yaml2obj][ELF] - Simplify the code that performs sections validation." 2020-10-20 16:25:33 +03:00
ELFEmitter.cpp [LLD][LLVM] CG Graph profile using relocations 2021-06-24 09:09:33 -07:00
ELFYAML.cpp [llvm-objdump/llvm-readobj/obj2yaml/yaml2obj] Support STO_RISCV_VARIANT_CC and DT_RISCV_VARIANT_CC 2021-09-29 16:56:52 -07:00
MachOEmitter.cpp [llvm-objcopy][MachO] Ignore all LC_SUB_* commands. 2021-07-28 17:35:26 -07:00
MachOYAML.cpp [llvm-objcopy][MachO] Ignore all LC_SUB_* commands. 2021-07-28 17:35:26 -07:00
MinidumpEmitter.cpp
MinidumpYAML.cpp Reland "[yaml2obj][ELF] - Simplify the code that performs sections validation." 2020-10-20 16:25:33 +03:00
ObjectYAML.cpp [yaml2obj] Initial the support of yaml2obj for 32-bit XCOFF. 2021-06-07 04:14:44 +00:00
WasmEmitter.cpp [WebAssembly] Remove WasmTagType 2021-10-05 17:11:22 -07:00
WasmYAML.cpp [WebAssembly] Remove WasmTagType 2021-10-05 17:11:22 -07:00
XCOFFEmitter.cpp [yaml2obj][XCOFF] add the SectionIndex field for symbol. 2021-09-14 06:18:03 +00:00
XCOFFYAML.cpp [yaml2obj][XCOFF] add the SectionIndex field for symbol. 2021-09-14 06:18:03 +00:00
YAML.cpp
yaml2obj.cpp [yaml2obj] Initial the support of yaml2obj for 32-bit XCOFF. 2021-06-07 04:14:44 +00:00