From 35bcba4fae8ae2637589772c3cd7e132de2caee6 Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen Date: Fri, 28 Jun 2019 21:53:11 +0000 Subject: [PATCH] [WebAssembly] Allow @object in .type directives. Reviewers: sbc100 Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63955 llvm-svn: 364688 --- llvm/lib/MC/MCParser/WasmAsmParser.cpp | 2 ++ llvm/test/MC/WebAssembly/basic-assembly.s | 1 + 2 files changed, 3 insertions(+) diff --git a/llvm/lib/MC/MCParser/WasmAsmParser.cpp b/llvm/lib/MC/MCParser/WasmAsmParser.cpp index 141e7fc36f93..b19647793fac 100644 --- a/llvm/lib/MC/MCParser/WasmAsmParser.cpp +++ b/llvm/lib/MC/MCParser/WasmAsmParser.cpp @@ -187,6 +187,8 @@ public: WasmSym->setType(wasm::WASM_SYMBOL_TYPE_FUNCTION); else if (TypeName == "global") WasmSym->setType(wasm::WASM_SYMBOL_TYPE_GLOBAL); + else if (TypeName == "object") + WasmSym->setType(wasm::WASM_SYMBOL_TYPE_DATA); else return error("Unknown WASM symbol type: ", Lexer->getTok()); Lex(); diff --git a/llvm/test/MC/WebAssembly/basic-assembly.s b/llvm/test/MC/WebAssembly/basic-assembly.s index 404fa44fa157..40c50d52ae2e 100644 --- a/llvm/test/MC/WebAssembly/basic-assembly.s +++ b/llvm/test/MC/WebAssembly/basic-assembly.s @@ -91,6 +91,7 @@ test0: .section .rodata..L.str,"",@ .hidden .L.str + .type .L.str,@object .L.str: .int8 'H' .asciz "ello, World!"