================
@@ -246,8 +246,14 @@ class ScalarExprEmitter : public 
StmtVisitor<ScalarExprEmitter, mlir::Value> {
 
   mlir::Value VisitCharacterLiteral(const CharacterLiteral *e) {
     mlir::Type ty = cgf.convertType(e->getType());
-    auto init = cir::IntAttr::get(ty, e->getValue());
-    return cir::ConstantOp::create(builder, cgf.getLoc(e->getExprLoc()), init);
+    // Character literals are always stored in an unsigned (even for signed
+    // char), so allow implicit truncation here.  Mirrors classic CodeGen
----------------
adams381 wrote:

Dropped the "Mirrors classic CodeGen" lines.  Kept the two preceding lines 
explaining why `isSigned=false, implicitTrunc=true` is needed.

https://github.com/llvm/llvm-project/pull/197269
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to