aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2025-04-08 19:44:40 -0700
committerGitHub <noreply@github.com>2025-04-08 19:44:40 -0700
commit50428fb5e90b8318148abdf67eefe99bf8fd310b (patch)
treecb0d95bc0c46822a4082c2d145dc5913f7081e1d /llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
parenta1f1bbf0534f57990c13a0bf0e6645da011f1d9d (diff)
downloadllvm-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/Target/WebAssembly/WebAssemblyAsmPrinter.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
index ded7052..22803ff 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
@@ -14,6 +14,7 @@
//===----------------------------------------------------------------------===//
#include "WebAssemblyAsmPrinter.h"
+#include "MCTargetDesc/WebAssemblyMCExpr.h"
#include "MCTargetDesc/WebAssemblyMCTargetDesc.h"
#include "MCTargetDesc/WebAssemblyTargetStreamer.h"
#include "TargetInfo/WebAssemblyTargetInfo.h"
@@ -590,8 +591,7 @@ void WebAssemblyAsmPrinter::EmitFunctionAttributes(Module &M) {
for (auto &Sym : Symbols) {
OutStreamer->emitValue(
- MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_WASM_FUNCINDEX,
- OutContext),
+ MCSymbolRefExpr::create(Sym, WebAssembly::S_FUNCINDEX, OutContext),
4);
}
OutStreamer->popSection();