aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-10 20:35:22 +0000
committerChris Lattner <sabre@nondot.org>2007-02-10 20:35:22 +0000
commit829621c59e9e4e2f4e15cd562688fae9f82ea549 (patch)
tree5a71cbf324c82f7bbf05b8151cee89d8d3b4583d
parent309f87e34a12e3398932e4c2c9e3c47cad0e8f0f (diff)
downloadexternal_llvm-829621c59e9e4e2f4e15cd562688fae9f82ea549.zip
external_llvm-829621c59e9e4e2f4e15cd562688fae9f82ea549.tar.gz
external_llvm-829621c59e9e4e2f4e15cd562688fae9f82ea549.tar.bz2
eliminate use of TargetData::getIndexedOffset that takes a vector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34163 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Analysis/BasicAliasAnalysis.cpp16
-rw-r--r--lib/ExecutionEngine/ExecutionEngine.cpp5
2 files changed, 14 insertions, 7 deletions
diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp
index e6b81be..e65c173 100644
--- a/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/lib/Analysis/BasicAliasAnalysis.cpp
@@ -436,7 +436,9 @@ BasicAliasAnalysis::alias(const Value *V1, unsigned V1Size,
GEPOperands[i] =
Constant::getNullValue(GEPOperands[i]->getType());
int64_t Offset =
- getTargetData().getIndexedOffset(BasePtr->getType(), GEPOperands);
+ getTargetData().getIndexedOffset(BasePtr->getType(),
+ &GEPOperands[0],
+ GEPOperands.size());
if (Offset >= (int64_t)V2Size || Offset <= -(int64_t)V1Size)
return NoAlias;
@@ -617,11 +619,13 @@ BasicAliasAnalysis::CheckGEPInstructions(
// Okay, now get the offset. This is the relative offset for the full
// instruction.
const TargetData &TD = getTargetData();
- int64_t Offset1 = TD.getIndexedOffset(GEPPointerTy, GEP1Ops);
+ int64_t Offset1 = TD.getIndexedOffset(GEPPointerTy, &GEP1Ops[0],
+ GEP1Ops.size());
// Now crop off any constants from the end...
GEP1Ops.resize(MinOperands);
- int64_t Offset2 = TD.getIndexedOffset(GEPPointerTy, GEP1Ops);
+ int64_t Offset2 = TD.getIndexedOffset(GEPPointerTy, &GEP1Ops[0],
+ GEP1Ops.size());
// If the tail provided a bit enough offset, return noalias!
if ((uint64_t)(Offset2-Offset1) >= SizeMax)
@@ -731,8 +735,10 @@ BasicAliasAnalysis::CheckGEPInstructions(
}
if (GEPPointerTy->getElementType()->isSized()) {
- int64_t Offset1 = getTargetData().getIndexedOffset(GEPPointerTy, GEP1Ops);
- int64_t Offset2 = getTargetData().getIndexedOffset(GEPPointerTy, GEP2Ops);
+ int64_t Offset1 =
+ getTargetData().getIndexedOffset(GEPPointerTy,&GEP1Ops[0],GEP1Ops.size());
+ int64_t Offset2 =
+ getTargetData().getIndexedOffset(GEPPointerTy,&GEP2Ops[0],GEP2Ops.size());
assert(Offset1<Offset2 && "There is at least one different constant here!");
if ((uint64_t)(Offset2-Offset1) >= SizeMax) {
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp
index 6878f89..28b515e 100644
--- a/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -334,9 +334,10 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
case Instruction::GetElementPtr: {
// Compute the index
Result = getConstantValue(CE->getOperand(0));
- std::vector<Value*> Indexes(CE->op_begin()+1, CE->op_end());
+ SmallVector<Value*, 8> Indices(CE->op_begin()+1, CE->op_end());
uint64_t Offset =
- TD->getIndexedOffset(CE->getOperand(0)->getType(), Indexes);
+ TD->getIndexedOffset(CE->getOperand(0)->getType(),
+ &Indices[0], Indices.size());
if (getTargetData()->getPointerSize() == 4)
Result.Int32Val += Offset;