diff options
author | Fangrui Song <i@maskray.me> | 2025-04-08 19:44:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-08 19:44:40 -0700 |
commit | 50428fb5e90b8318148abdf67eefe99bf8fd310b (patch) | |
tree | cb0d95bc0c46822a4082c2d145dc5913f7081e1d /llvm/lib/MC/WasmObjectWriter.cpp | |
parent | a1f1bbf0534f57990c13a0bf0e6645da011f1d9d (diff) | |
download | llvm-50428fb5e90b8318148abdf67eefe99bf8fd310b.zip llvm-50428fb5e90b8318148abdf67eefe99bf8fd310b.tar.gz llvm-50428fb5e90b8318148abdf67eefe99bf8fd310b.tar.bz2 |
[WebAssembly] Add WebAssembly::Specifier
Move wasm-specific members outside of MCSymbolRefExpr::VariantKind (a
legacy interface I am eliminating). Most changes are mechanic and
similar to what I've done for many ELF targets (e.g. X86 #132149)
Notes:
* `fixSymbolsInTLSFixups` is replaced with `setTLS` in
`WebAssemblyWasmObjectWriter::getRelocType`, similar to what I've done
for many ELF targets.
* `SymA->setUsedInGOT()` in `recordRelocation` is moved to
`getRelocType`.
While here, rename "Modifier' to "Specifier":
> "Relocation modifier", though concise, suggests adjustments happen during the linker's relocation step rather than the assembler's expression evaluation. I landed on "relocation specifier" as the winner. It's clear, aligns with Arm and IBM’s usage, and fits the assembler's role seamlessly.
Pull Request: https://github.com/llvm/llvm-project/pull/133116
Diffstat (limited to 'llvm/lib/MC/WasmObjectWriter.cpp')
-rw-r--r-- | llvm/lib/MC/WasmObjectWriter.cpp | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/llvm/lib/MC/WasmObjectWriter.cpp b/llvm/lib/MC/WasmObjectWriter.cpp index 302ba6e..18c85c6 100644 --- a/llvm/lib/MC/WasmObjectWriter.cpp +++ b/llvm/lib/MC/WasmObjectWriter.cpp @@ -606,15 +606,6 @@ void WasmObjectWriter::recordRelocation(MCAssembler &Asm, SymA->setUsedInReloc(); } - switch (Target.getSpecifier()) { - case MCSymbolRefExpr::VK_GOT: - case MCSymbolRefExpr::VK_WASM_GOT_TLS: - SymA->setUsedInGOT(); - break; - default: - break; - } - WasmRelocationEntry Rec(FixupOffset, SymA, C, Type, &FixupSection); LLVM_DEBUG(dbgs() << "WasmReloc: " << Rec << "\n"); |