================
@@ -760,14 +760,21 @@ Expr *SemaAMDGPU::ExpandAMDGPUPredicateBuiltIn(Expr *E) {
CallExpr *CE = cast<CallExpr>(E->IgnoreParens());
ASTContext &Ctx = getASTContext();
QualType BoolTy = Ctx.getLogicalOperationType();
- llvm::APInt False = llvm::APInt::getZero(Ctx.getIntWidth(BoolTy));
- llvm::APInt True = llvm::APInt::getAllOnes(Ctx.getIntWidth(BoolTy));
SourceLocation Loc = CE->getExprLoc();
+ // A plain IntegerLiteral whose type is _Bool/bool is not a shape any other
+ // clang producer creates, and consumers (e.g. StmtPrinter) assume it cannot
+ // occur — see issue #199563.
+ auto MakePredicateLiteral = [&](bool Val) -> Expr * {
----------------
jhuber6 wrote:
Is this trying to solve the same problem as
https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaExprObjC.cpp#L437?
Can we do something similar? I'd assume this is just a C/C++ distinction.
https://github.com/llvm/llvm-project/pull/199963
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits