Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit 683aaef

Browse files
committed
expand constantExprs for all illegal values, not just >=64bit, so that things like nested i24 CEs are fixed up by promoteIntegers
1 parent 9901f69 commit 683aaef

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/Transforms/NaCl/ExpandConstantExpr.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ static Value *expandConstantExpr(Instruction *InsertPt, ConstantExpr *Expr) {
5858

5959
// XXX Emscripten: Utilities for illegal expressions.
6060
static bool isIllegal(Type *T) {
61-
return T->isIntegerTy() && T->getIntegerBitWidth() > 32;
61+
if (!T->isIntegerTy()) return false;
62+
unsigned Bits = T->getIntegerBitWidth();
63+
// we need to expand out not just 64-bit and larger values, but also i24s, so PromoteIntegers can process them
64+
return Bits != 1 && Bits != 8 && Bits != 16 && Bits != 32;
6265
}
6366
static bool ContainsIllegalTypes(const Value *Expr) {
6467
if (isIllegal(Expr->getType()))

0 commit comments

Comments
 (0)