From 47bdca1041aa59158feb40e89f5fbd70815b34c0 Mon Sep 17 00:00:00 2001 From: jbrodman Date: Tue, 4 Feb 2014 02:46:07 -0800 Subject: [PATCH 1/3] Modify alloy.py to put dbg llvm builds in different folders. --- alloy.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/alloy.py b/alloy.py index 57d8df1e..d3d1504c 100755 --- a/alloy.py +++ b/alloy.py @@ -105,6 +105,8 @@ def build_LLVM(version_LLVM, revision, folder, tarball, debug, selfbuild, extra, revision = "-" + revision if folder == "": folder = FOLDER_NAME + if debug == True: + folder = folder + "dbg" LLVM_SRC="llvm-" + folder LLVM_BUILD="build-" + folder LLVM_BIN="bin-" + folder From 720975dff4d75ea913e83ee74abf64ade67bf142 Mon Sep 17 00:00:00 2001 From: jbrodman Date: Tue, 4 Feb 2014 03:36:19 -0800 Subject: [PATCH 2/3] Disallow initializing void * with ptr to const. --- expr.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/expr.cpp b/expr.cpp index 1b739a9a..b5c876fd 100644 --- a/expr.cpp +++ b/expr.cpp @@ -339,7 +339,14 @@ lDoTypeConv(const Type *fromType, const Type *toType, Expr **expr, return false; } else if (PointerType::IsVoidPointer(toPointerType)) { + if (fromPointerType->GetBaseType()->IsConstType()) { + if (!failureOk) + Error(pos, "Can't convert pointer to const \"%s\" to void pointer.", + fromPointerType->GetString().c_str()); + return false; + } // any pointer type can be converted to a void * + // ...almost. #731 goto typecast_ok; } else if (PointerType::IsVoidPointer(fromPointerType) && From 98cfc17843edf26d85b1030cb4236a9469bdec46 Mon Sep 17 00:00:00 2001 From: jbrodman Date: Tue, 4 Feb 2014 08:12:02 -0800 Subject: [PATCH 3/3] Fix bug with printing due to uneven handling of bool types --- stmt.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/stmt.cpp b/stmt.cpp index 4ec63d35..52d25fe9 100644 --- a/stmt.cpp +++ b/stmt.cpp @@ -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);