hanchenye-llvm-project/lld
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
..
COFF [lld] Use checkError more 2021-10-04 11:46:16 -04:00
Common [lld] Fix small error in previous commit 2021-09-17 17:47:21 -07:00
ELF [lld] Use checkError more 2021-10-04 11:46:16 -04:00
MachO [lld] Use checkError more 2021-10-04 11:46:16 -04:00
MinGW [LLD] [MinGW] Add more options for disabling flags in the executable 2021-08-12 13:27:09 +03:00
cmake/modules [cmake] Add support for multiple distributions 2021-05-12 11:13:18 -07:00
docs [ELF] Add --why-extract= to query why archive members/lazy object files are extracted 2021-09-20 09:52:30 -07:00
include/lld [WebAssembly] Remove WasmTagType 2021-10-05 17:11:22 -07:00
lib [CMake][gn] lldMachO=>lldMachOOld, lldMachO2=>lldMachO 2021-08-04 18:52:41 -07:00
test [WebAssembly] Remove WasmTagType 2021-10-05 17:11:22 -07:00
tools/lld [lld] Enable ANSI escape code for Windows 2021-09-09 16:51:11 -07:00
unittests [CMake][gn] lldMachO=>lldMachOOld, lldMachO2=>lldMachO 2021-08-04 18:52:41 -07:00
utils
wasm [WebAssembly] Remove WasmTagType 2021-10-05 17:11:22 -07:00
.clang-format
.clang-tidy NFC: .clang-tidy: Inherit configs from parents to improve maintainability 2021-06-08 08:25:59 -07:00
.gitignore
CMakeLists.txt [LLVM][CMake][NFC] Resolve FIXME: Rename LLVM_CMAKE_PATH to LLVM_CMAKE_DIR throughout the project 2021-09-16 18:29:57 +02:00
CODE_OWNERS.TXT
LICENSE.TXT
README.md [doc] Place sha256 in lld/README.md into backticks 2021-01-12 10:19:40 -08:00

README.md

LLVM Linker (lld)

This directory and its subdirectories contain source code for the LLVM Linker, a modular cross platform linker which is built as part of the LLVM compiler infrastructure project.

lld is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt.

Benchmarking

In order to make sure various developers can evaluate patches over the same tests, we create a collection of self contained programs.

It is hosted at https://s3-us-west-2.amazonaws.com/linker-tests/lld-speed-test.tar.xz

The current sha256 is 10eec685463d5a8bbf08d77f4ca96282161d396c65bd97dc99dbde644a31610f.