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

Roman Tereshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 29 10:10:09 PDT 2018


rtereshin added inline comments.


================
Comment at: lib/CodeGen/MIRParser/MIParser.cpp:1389
+  case MIToken::IntegerLiteral:
+    if (parseIRConstant(Loc, C))
+      return true;
----------------
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`.


Repository:
  rL LLVM

https://reviews.llvm.org/D47424





More information about the llvm-commits mailing list