llvm.org GIT mirror llvm / 314790b
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319796 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 2 years ago
2 changed file(s) with 10 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
9090 for (const auto &G : M.globals()) {
9191 if (!G.hasInitializer() && G.hasExternalLinkage()) {
9292 uint16_t Size = M.getDataLayout().getTypeAllocSize(G.getValueType());
93 getTargetStreamer()->emitGlobalImport(G.getGlobalIdentifier());
93 if (TM.getTargetTriple().isOSBinFormatELF())
94 getTargetStreamer()->emitGlobalImport(G.getGlobalIdentifier());
9495 OutStreamer->emitELFSize(getSymbol(&G),
9596 MCConstantExpr::create(Size, OutContext));
9697 }
33 target triple = "wasm32-unknown-unknown-wasm"
44
55 ; CHECK: .globl foo
6 ; CHECK: .type foo,@function
67 ; CHECK-LABEL: foo:
7 define void @foo() {
8 ret void
8 ; CHECK: .size foo,
9 define i32* @foo() {
10 ret i32* @bar
911 }
1012
11 ; Check import directives - must be at the end of the file
12 ; CHECK: .import_global bar{{$}}
13 @bar = external global i32
13 ; CHECK: .type bar,@object
14 ; CHECK: .globl bar
15 ; CHECK: .size bar, 4
16 @bar = global i32 2