mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-02 07:41:38 +00:00
Recently changed getelementptr to use 'long' indexes for sequential types
instead of uints. This adds a translation scheme to be backwards compatible with old .ll files. llvm-svn: 3679
This commit is contained in:
parent
2d1e19f9e2
commit
a8e481b961
@ -1705,6 +1705,16 @@ MemoryInst : MALLOC Types {
|
||||
delete $4; delete $6;
|
||||
}
|
||||
| GETELEMENTPTR Types ValueRef IndexList {
|
||||
for (unsigned i = 0, e = $4->size(); i != e; ++i) {
|
||||
if ((*$4)[i]->getType() == Type::UIntTy) {
|
||||
std::cerr << "WARNING: Use of uint type indexes to getelementptr "
|
||||
<< "instruction: replacing with casts to long type.\n";
|
||||
Instruction *I = new CastInst((*$4)[i], Type::LongTy);
|
||||
CurBB->getInstList().push_back(I);
|
||||
(*$4)[i] = I;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isa<PointerType>($2->get()))
|
||||
ThrowException("getelementptr insn requires pointer operand!");
|
||||
if (!GetElementPtrInst::getIndexedType(*$2, *$4, true))
|
||||
|
Loading…
x
Reference in New Issue
Block a user