aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2019-02-22 22:29:34 +0000
committerSam Clegg <sbc@chromium.org>2019-02-22 22:29:34 +0000
commit8fffa1dfa3bddf44b73a6f622eafa752347202f5 (patch)
treee7f2e6050d2c9510bbc54a770b87e6b882985006 /llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
parent1e4f0735824abc9d618ae19b40b57dad2a5c5149 (diff)
downloadllvm-8fffa1dfa3bddf44b73a6f622eafa752347202f5.zip
llvm-8fffa1dfa3bddf44b73a6f622eafa752347202f5.tar.gz
llvm-8fffa1dfa3bddf44b73a6f622eafa752347202f5.tar.bz2
[WebAssembly] Remove unneeded MCSymbolRefExpr variants
We record the type of the symbol (event/function/data/global) in the MCWasmSymbol and so it should always be clear how to handle a relocation based on the symbol itself. The exception is a function which still needs the special @TYPEINDEX then the relocation contains the signature rather than the address of the functions. Differential Revision: https://reviews.llvm.org/D58472 llvm-svn: 354697
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
index 054fe54..e357842 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
@@ -122,13 +122,8 @@ MCOperand WebAssemblyMCInstLower::lowerSymbolOperand(MCSymbol *Sym,
int64_t Offset,
bool IsFunc, bool IsGlob,
bool IsEvent) const {
- MCSymbolRefExpr::VariantKind VK =
- IsFunc ? MCSymbolRefExpr::VK_WebAssembly_FUNCTION
- : IsGlob ? MCSymbolRefExpr::VK_WebAssembly_GLOBAL
- : IsEvent ? MCSymbolRefExpr::VK_WebAssembly_EVENT
- : MCSymbolRefExpr::VK_None;
-
- const MCExpr *Expr = MCSymbolRefExpr::create(Sym, VK, Ctx);
+ const MCExpr *Expr =
+ MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, Ctx);
if (Offset != 0) {
if (IsFunc)