if (!isa<PointerType>($2->get()))
ThrowException("Can't load from nonpointer type: " +
(*$2)->getDescription());
- if (LoadInst::getIndexedType(*$2, *$4) == 0)
+ if (GetElementPtrInst::getIndexedType(*$2, *$4) == 0)
ThrowException("Invalid indices for load instruction!");
Value *Src = getVal(*$2, $3);
if (!isa<PointerType>($4->get()))
ThrowException("Can't store to a nonpointer type: " +
(*$4)->getDescription());
- const Type *ElTy = StoreInst::getIndexedType(*$4, *$6);
+ const Type *ElTy = GetElementPtrInst::getIndexedType(*$4, *$6);
if (ElTy == 0)
ThrowException("Can't store into that field list!");
if (ElTy != $2->getType())
} else { // Performing array indexing. Just skip the 0
++I;
}
- } else if (HasImplicitAddress) {
-
}
-
+
for (; I != E; ++I)
if ((*I)->getType() == Type::UIntTy) {
Out << "[";
}
void CWriter::visitLoadInst(LoadInst &I) {
- printIndexingExpression(I.getPointerOperand(), I.idx_begin(), I.idx_end());
+ Out << "*";
+ writeOperand(I.getOperand(0));
}
void CWriter::visitStoreInst(StoreInst &I) {
- printIndexingExpression(I.getPointerOperand(), I.idx_begin(), I.idx_end());
+ Out << "*";
+ writeOperand(I.getPointerOperand());
Out << " = ";
writeOperand(I.getOperand(0));
}
} else { // Performing array indexing. Just skip the 0
++I;
}
- } else if (HasImplicitAddress) {
-
}
-
+
for (; I != E; ++I)
if ((*I)->getType() == Type::UIntTy) {
Out << "[";
}
void CWriter::visitLoadInst(LoadInst &I) {
- printIndexingExpression(I.getPointerOperand(), I.idx_begin(), I.idx_end());
+ Out << "*";
+ writeOperand(I.getOperand(0));
}
void CWriter::visitStoreInst(StoreInst &I) {
- printIndexingExpression(I.getPointerOperand(), I.idx_begin(), I.idx_end());
+ Out << "*";
+ writeOperand(I.getPointerOperand());
Out << " = ";
writeOperand(I.getOperand(0));
}