From 683aaef9c7a20fd10f132ae2fb118f5edd1c0b58 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 28 Mar 2014 10:39:48 -0700 Subject: expand constantExprs for all illegal values, not just >=64bit, so that things like nested i24 CEs are fixed up by promoteIntegers --- lib/Transforms/NaCl/ExpandConstantExpr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Transforms/NaCl/ExpandConstantExpr.cpp b/lib/Transforms/NaCl/ExpandConstantExpr.cpp index 75098a1572..c4cf75279b 100644 --- a/lib/Transforms/NaCl/ExpandConstantExpr.cpp +++ b/lib/Transforms/NaCl/ExpandConstantExpr.cpp @@ -58,7 +58,10 @@ static Value *expandConstantExpr(Instruction *InsertPt, ConstantExpr *Expr) { // XXX Emscripten: Utilities for illegal expressions. static bool isIllegal(Type *T) { - return T->isIntegerTy() && T->getIntegerBitWidth() > 32; + if (!T->isIntegerTy()) return false; + unsigned Bits = T->getIntegerBitWidth(); + // we need to expand out not just 64-bit and larger values, but also i24s, so PromoteIntegers can process them + return Bits != 1 && Bits != 8 && Bits != 16 && Bits != 32; } static bool ContainsIllegalTypes(const Value *Expr) { if (isIllegal(Expr->getType())) -- cgit v1.2.3-18-g5258