aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/NaCl/ExpandConstantExpr.cpp5
1 files changed, 4 insertions, 1 deletions
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()))