diff options
| author | Wouter van Oortmerssen <aardappel@gmail.com> | 2018-12-26 22:46:18 +0000 |
|---|---|---|
| committer | Wouter van Oortmerssen <aardappel@gmail.com> | 2018-12-26 22:46:18 +0000 |
| commit | 29c6ce5879c0c00fca3442d5211b6e28a0b336b5 (patch) | |
| tree | ce59d6488b5202831e68d3785ba126c07b73cdc6 /llvm/lib/MC/MCParser/AsmParser.cpp | |
| parent | 82f43aab216a6b3c3a3458d5422e1d25942b31a3 (diff) | |
| download | bcm5719-llvm-29c6ce5879c0c00fca3442d5211b6e28a0b336b5.tar.gz bcm5719-llvm-29c6ce5879c0c00fca3442d5211b6e28a0b336b5.zip | |
[WebAssembly] Make assembler check for proper nesting of control flow.
Summary:
It does so using a simple nesting stack, and gives clear errors upon
violation. This is unique to wasm, since most CPUs do not have
any nested constructs.
Had to add an end of file check to the general assembler for this.
Note: if/else/end instructions are not currently supported in our
tablegen defs, so these tests will be enabled in a follow-up.
They already pass the nesting check.
Reviewers: dschuff, aheejin
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D55797
llvm-svn: 350078
Diffstat (limited to 'llvm/lib/MC/MCParser/AsmParser.cpp')
| -rw-r--r-- | llvm/lib/MC/MCParser/AsmParser.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index 545da359ea5..cf42a6f7075 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -899,6 +899,9 @@ bool AsmParser::Run(bool NoInitialTextSection, bool NoFinalize) { eatToEndOfStatement(); } + getTargetParser().onEndOfFile(); + printPendingErrors(); + // All errors should have been emitted. assert(!hasPendingError() && "unexpected error from parseStatement"); |

