llvm-project/lld/wasm
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
..
CMakeLists.txt Reland: "[lld][WebAssembly] Initial support merging string data" 2021-05-10 16:03:38 -07:00
Config.h [lld][WebAssembly] Add new `--import-undefined` option 2021-06-17 11:44:21 -07:00
Driver.cpp [lld][WebAssembly] Create optional internal symbols only after LTO object as been added 2021-10-05 13:31:09 -07:00
InputChunks.cpp [WebAssembly] Support R_WASM_MEMORY_ADDR_TLS_SLEB64 for wasm64 2021-07-19 10:22:43 -07:00
InputChunks.h [WebAssembly] Add explict TLS symbol flag 2021-09-09 10:03:30 -04:00
InputElement.h [WebAssembly] Remove WasmTagType 2021-10-05 17:11:22 -07:00
InputFiles.cpp [WebAssembly] Remove WasmTagType 2021-10-05 17:11:22 -07:00
InputFiles.h [Object][WebAssemlby] Report function types (signatures). NFC 2021-10-04 17:33:56 -07:00
LTO.cpp [LTO][wasm][NewPM] Allow using new pass manager for wasm LTO 2020-12-01 12:22:40 -08:00
LTO.h [Coding style change][lld] Rename variables for non-ELF ports 2019-07-11 05:40:30 +00:00
MapFile.cpp [WebAssembly][lld] Fix segfault on .bss sections in mapfile 2021-07-07 23:31:48 -07:00
MapFile.h [lld][WebAssembly] Add initial support for -Map/--print-map 2020-09-12 16:10:51 -07:00
MarkLive.cpp [WebAssembly] Rename event to tag 2021-06-17 20:34:19 -07:00
MarkLive.h
Options.td [lld][WebAssembly] Add new `--import-undefined` option 2021-06-17 11:44:21 -07:00
OutputSections.cpp [lld][WebAssembly] Cleanup output of --verbose 2021-09-10 11:35:50 -04:00
OutputSections.h [lld][WebAssembly] Cleanup output of --verbose 2021-09-10 11:35:50 -04:00
OutputSegment.cpp [lld][WebAssembly] Enable string tail merging in debug sections 2021-05-18 12:25:39 -07:00
OutputSegment.h [lld][WebAssembly] Refactor input chunk class hierarchy. NFC 2021-05-17 21:01:17 -07:00
Relocations.cpp [lld][WebAssembly] Remove redundant check for undefined global (NFC) 2021-10-05 15:11:27 -07:00
Relocations.h [Coding style change][lld] Rename variables for non-ELF ports 2019-07-11 05:40:30 +00:00
SymbolTable.cpp [WebAssembly] Remove WasmTagType 2021-10-05 17:11:22 -07:00
SymbolTable.h [WebAssembly] Rename event to tag 2021-06-17 20:34:19 -07:00
Symbols.cpp [WebAssembly] Remove WasmTagType 2021-10-05 17:11:22 -07:00
Symbols.h [WebAssembly] Remove WasmTagType 2021-10-05 17:11:22 -07:00
SyntheticSections.cpp [WebAssembly] Remove WasmTagType 2021-10-05 17:11:22 -07:00
SyntheticSections.h [WebAssembly] Allow import and export of TLS symbols between DSOs 2021-09-14 06:47:37 -07:00
Writer.cpp [WebAssembly] Allow import and export of TLS symbols between DSOs 2021-09-14 06:47:37 -07:00
Writer.h [WebAssembly] Refactor synthetic sections and relocation processing. NFC. 2019-05-21 09:13:09 +00:00
WriterUtils.cpp [WebAssembly] Remove WasmTagType 2021-10-05 17:11:22 -07:00
WriterUtils.h [WebAssembly] Remove WasmTagType 2021-10-05 17:11:22 -07:00