- // GetElementPtr Expression
- assert(CE->getOpcode() == Instruction::GetElementPtr);
- Value *Ptr = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap);
- std::vector<Constant*> Indices;
- Indices.reserve(CE->getNumOperands()-1);
- for (unsigned i = 1, e = CE->getNumOperands(); i != e; ++i)
- Indices.push_back(cast<Constant>(RemapOperand(CE->getOperand(i),
- LocalMap, GlobalMap)));
-
- Result = ConstantExpr::get(CE->getOpcode(), cast<Constant>(Ptr),
- Indices, CE->getType());