[PATCH] D47424: [MIRParser] Add parser support for 'true' and 'false' i1s.

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 29 16:34:52 PDT 2018


aemerson added inline comments.


================
Comment at: lib/CodeGen/MIRParser/MIParser.cpp:1389
+  case MIToken::IntegerLiteral:
+    if (parseIRConstant(Loc, C))
+      return true;
----------------
rtereshin wrote:
> thegameg wrote:
> > It looks like `parseIRConstant` already handles `true` and `false`. Can we reuse that here?
> Also, `parseIRConstant` will produce a neat error message if the boolean literal isn't specified as `i1`:
> ```
> error: /Volumes/Data/llvm/test/CodeGen/MIR/AArch64/parse-integer-true-false.mir:9:32: constant expression type mismatch
>     %0:_(s32) = G_CONSTANT i32 true
> ```
> while the current version will just silently replace the type with `i1`.
Sure, that makes it a lot simpler.


Repository:
  rL LLVM

https://reviews.llvm.org/D47424





More information about the llvm-commits mailing list