We can't just push a uint64 unconditionally here, since on 32bit arches
we later expect a different type, e.g. uint32.
This broke e.g. these builders:
https://lab.llvm.org/buildbot#builders/171/builds/21514
https://lab.llvm.org/buildbot#builders/38/builds/6643
bool ByteCodeExprGen<Emitter>::VisitArrayInitIndexExpr(
const ArrayInitIndexExpr *E) {
assert(ArrayIndex);
- return this->emitConstUint64(*ArrayIndex, E);
+ QualType IndexType = E->getType();
+ APInt Value(getIntWidth(IndexType), *ArrayIndex);
+ return this->emitConst(classifyPrim(IndexType), 0, Value, E);
}
template <class Emitter>