summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2017-12-05 17:21:57 +0000
committerDan Gohman <dan433584@gmail.com>2017-12-05 17:21:57 +0000
commitf7172f4ab095c641c36ce205d6c7e965b2b5b67c (patch)
treeb9b317b0b1e6403a5ac8fdbc3358ca0a6d77e539 /llvm/lib/Target/WebAssembly
parent06be6debbc005a45493c81643729b32bd3754f38 (diff)
downloadbcm5719-llvm-f7172f4ab095c641c36ce205d6c7e965b2b5b67c.tar.gz
bcm5719-llvm-f7172f4ab095c641c36ce205d6c7e965b2b5b67c.zip
[WebAssembly] Don't emit .import_global for the wasm target.
.import_global is used by the ELF-based target and not needed by the wasm target. llvm-svn: 319796
Diffstat (limited to 'llvm/lib/Target/WebAssembly')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
index ee60c8f3a7a..5f7f3d694cd 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
@@ -91,7 +91,8 @@ void WebAssemblyAsmPrinter::EmitEndOfAsmFile(Module &M) {
for (const auto &G : M.globals()) {
if (!G.hasInitializer() && G.hasExternalLinkage()) {
uint16_t Size = M.getDataLayout().getTypeAllocSize(G.getValueType());
- getTargetStreamer()->emitGlobalImport(G.getGlobalIdentifier());
+ if (TM.getTargetTriple().isOSBinFormatELF())
+ getTargetStreamer()->emitGlobalImport(G.getGlobalIdentifier());
OutStreamer->emitELFSize(getSymbol(&G),
MCConstantExpr::create(Size, OutContext));
}
OpenPOWER on IntegriCloud