[PATCH] D47424: [MIRParser] Add parser support for 'true' and 'false' i1s.
Amara Emerson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 2 03:40:39 PDT 2018
aemerson added inline comments.
================
Comment at: lib/CodeGen/MIRParser/MIParser.cpp:1379
+ !(Token.range().startswith("true") ||
+ Token.range().startswith("false")))
+ return error("expected an integer literal");
----------------
rtereshin wrote:
> Why startswith instead of direct comparisons? Is it going to parse `truee` as `true`?
It won't parse that because parseIRConstant will fail, but you're right I had startswith mistakenly because it was a stringref view onto the raw source since they're not tokens any more, which in the debugger looked like a longer string than just "true" or "false".
Repository:
rL LLVM
https://reviews.llvm.org/D47424
More information about the llvm-commits
mailing list