diff options
| author | Amara Emerson <aemerson@apple.com> | 2018-06-05 00:17:13 +0000 |
|---|---|---|
| committer | Amara Emerson <aemerson@apple.com> | 2018-06-05 00:17:13 +0000 |
| commit | d496cc8ffb2145f8305c0d03a1817541d25fe67a (patch) | |
| tree | e69bb2f2e356fafe85e6a7707d148edbb05d6c3a /llvm/lib/CodeGen | |
| parent | 293c2691e519c8293ea5960b14c589a6bce5adf6 (diff) | |
| download | bcm5719-llvm-d496cc8ffb2145f8305c0d03a1817541d25fe67a.tar.gz bcm5719-llvm-d496cc8ffb2145f8305c0d03a1817541d25fe67a.zip | |
[MIRParser] Add parser support for 'true' and 'false' i1s.
We already output true and false in the printer, but the parser isn't able to
read it.
Differential Revision: https://reviews.llvm.org/D47424
llvm-svn: 333970
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/MIRParser/MIParser.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp index c1c93575e35..3532b42fa64 100644 --- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp @@ -1373,8 +1373,11 @@ bool MIParser::parseTypedImmediateOperand(MachineOperand &Dest) { auto Loc = Token.location(); lex(); - if (Token.isNot(MIToken::IntegerLiteral)) - return error("expected an integer literal"); + if (Token.isNot(MIToken::IntegerLiteral)) { + if (Token.isNot(MIToken::Identifier) || + !(Token.range() == "true" || Token.range() == "false")) + return error("expected an integer literal"); + } const Constant *C = nullptr; if (parseIRConstant(Loc, C)) return true; |

