Skip to content

Commit 15a50e2

Browse files
committed
[WebAssembly] Fixed missing "global" symbol type in AsmParser.
Summary: These are emitted by the wasm backend for e.g. __stack_pointer@GLOBAL which previously wasn't accepted by the assembler. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, llvm-commits, sunfish Differential Revision: https://reviews.llvm.org/D52911 llvm-svn: 343830
1 parent a464ffd commit 15a50e2

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

llvm/lib/MC/MCExpr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ MCSymbolRefExpr::getVariantKindForName(StringRef Name) {
419419
.Case("hi8", VK_AVR_HI8)
420420
.Case("hlo8", VK_AVR_HLO8)
421421
.Case("function", VK_WebAssembly_FUNCTION)
422+
.Case("global", VK_WebAssembly_GLOBAL)
422423
.Case("typeindex", VK_WebAssembly_TYPEINDEX)
423424
.Case("gotpcrel32@lo", VK_AMDGPU_GOTPCREL32_LO)
424425
.Case("gotpcrel32@hi", VK_AMDGPU_GOTPCREL32_HI)

llvm/test/MC/WebAssembly/basic-assembly.s

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ test0:
4747
#i32x4.trunc_s/f32x4:sat
4848
i32.trunc_s/f32
4949
#i32.trunc_s:sat/f32
50+
get_global __stack_pointer@GLOBAL
5051
end_function
5152

5253

@@ -87,4 +88,5 @@ test0:
8788
# CHECK-NEXT: get_local 5
8889
# CHECK-NEXT: f32x4.add
8990
# CHECK-NEXT: i32.trunc_s/f32
91+
# CHECK-NEXT: get_global __stack_pointer@GLOBAL
9092
# CHECK-NEXT: end_function

0 commit comments

Comments
 (0)