Fix bug with printing due to uneven handling of bool types

This commit is contained in:
jbrodman
2014-02-04 08:12:02 -08:00
parent 720975dff4
commit 98cfc17843

View File

@@ -3003,6 +3003,14 @@ lProcessPrintArg(Expr *expr, FunctionEmitContext *ctx, std::string &argTypes) {
return NULL;
}
else {
if (Type::Equal(baseType, AtomicType::UniformBool)) {
// Blast bools to ints, but do it here to preserve encoding for
// printing 'true' or 'false'
expr = new TypeCastExpr(type->IsUniformType() ? AtomicType::UniformInt32 :
AtomicType::VaryingInt32,
expr, expr->pos);
type = expr->GetType();
}
argTypes.push_back(t);
llvm::Type *llvmExprType = type->LLVMType(g->ctx);