- if (GetElementPtrInst::getIndexedType(*$2, *$4) == 0)
- ThrowException("Invalid indices for load instruction!");
-
- Value *Src = getVal(*$2, $3);
- if (!$4->empty()) {
- std::cerr << "WARNING: Use of index load instruction:"
- << " replacing with getelementptr/load pair.\n";
- // Create a getelementptr hack instruction to do the right thing for
- // compatibility.
- //
- Instruction *I = new GetElementPtrInst(Src, *$4);
- CurBB->getInstList().push_back(I);
- Src = I;
- }
-
- $$ = new LoadInst(Src);
- delete $4; // Free the vector...