[PATCH] D43205: [WebAssembly] Fix casting MCSymbol to MCSymbolWasm on ELF
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 12 13:43:12 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL324942: [WebAssembly] Fix casting MCSymbol to MCSymbolWasm on ELF (authored by jgravelle, committed by ).
Repository:
rL LLVM
https://reviews.llvm.org/D43205
Files:
llvm/trunk/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
Index: llvm/trunk/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
===================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
@@ -84,13 +84,15 @@
SmallVector<MVT, 4> Results;
SmallVector<MVT, 4> Params;
ComputeSignatureVTs(F, TM, Params, Results);
- MCSymbolWasm *Sym = cast<MCSymbolWasm>(getSymbol(&F));
+ MCSymbol *Sym = getSymbol(&F);
getTargetStreamer()->emitIndirectFunctionType(Sym, Params, Results);
- if (F.hasFnAttribute("wasm-import-module")) {
+ if (TM.getTargetTriple().isOSBinFormatWasm() &&
+ F.hasFnAttribute("wasm-import-module")) {
+ MCSymbolWasm *WasmSym = cast<MCSymbolWasm>(Sym);
StringRef Name = F.getFnAttribute("wasm-import-module")
.getValueAsString();
- getTargetStreamer()->emitImportModule(Sym, Name);
+ getTargetStreamer()->emitImportModule(WasmSym, Name);
}
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43205.133924.patch
Type: text/x-patch
Size: 1062 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180212/b5ee5b31/attachment.bin>
More information about the llvm-commits
mailing list