summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCParser/AsmParser.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2018-04-19 22:00:53 +0000
committerSam Clegg <sbc@chromium.org>2018-04-19 22:00:53 +0000
commitf009da24485bc792bee5272f81d4b2c83cf335d8 (patch)
treeee8085ee85658e472bf90ce3220524b67ee1e297 /llvm/lib/MC/MCParser/AsmParser.cpp
parent991c1cd5f7852adeccd9e8192ce3667bcff4af21 (diff)
downloadbcm5719-llvm-f009da24485bc792bee5272f81d4b2c83cf335d8.tar.gz
bcm5719-llvm-f009da24485bc792bee5272f81d4b2c83cf335d8.zip
[WebAssembly] Enabled -triple=wasm32-unknown-unknown-wasm path using ELF directive parser.
This is a temporary solution until a proper WASM implementation of MCAsmParserExtension is in place, but at least for now will unblock this path. Added test to make sure this path works with the WASM Assembler. Patch By Wouter van Oortmerssen! Differential Revision: https://reviews.llvm.org/D45386 llvm-svn: 330370
Diffstat (limited to 'llvm/lib/MC/MCParser/AsmParser.cpp')
-rw-r--r--llvm/lib/MC/MCParser/AsmParser.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index 69720135432..7ee8e1b3e84 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -691,7 +691,11 @@ AsmParser::AsmParser(SourceMgr &SM, MCContext &Ctx, MCStreamer &Out,
PlatformParser.reset(createELFAsmParser());
break;
case MCObjectFileInfo::IsWasm:
- llvm_unreachable("Wasm parsing not supported yet");
+ // TODO: WASM will need its own MCAsmParserExtension implementation, but
+ // for now we can re-use the ELF one, since the directives can be the
+ // same for now, and this makes the -triple=wasm32-unknown-unknown-wasm
+ // path work.
+ PlatformParser.reset(createELFAsmParser());
break;
}
@@ -1305,7 +1309,7 @@ AsmParser::applyModifierToExpr(const MCExpr *E,
/// the End argument will be filled with the last location pointed to the '>'
/// character.
-/// There is a gap between the AltMacro's documentation and the single quote implementation.
+/// There is a gap between the AltMacro's documentation and the single quote implementation.
/// GCC does not fully support this feature and so we will not support it.
/// TODO: Adding single quote as a string.
bool AsmParser::isAltmacroString(SMLoc &StrLoc, SMLoc &EndLoc) {
@@ -2204,7 +2208,7 @@ bool AsmParser::parseStatement(ParseStatementInfo &Info,
}
// Parse and erase curly braces marking block start/end
-bool
+bool
AsmParser::parseCurlyBlockScope(SmallVectorImpl<AsmRewrite> &AsmStrRewrites) {
// Identify curly brace marking block start/end
if (Lexer.isNot(AsmToken::LCurly) && Lexer.isNot(AsmToken::RCurly))
OpenPOWER on IntegriCloud