aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure/Local.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-08-22 23:37:24 +0000
committerChris Lattner <sabre@nondot.org>2002-08-22 23:37:24 +0000
commit3bb8ad27a81661865400fcff5e07d0461860faf7 (patch)
treee2ebb5e3ebf8e913bc98f367f36909dfe3526c4a /lib/Analysis/DataStructure/Local.cpp
parentcc63f1c67456f41b25e8ccb8c1dce72067ddbadf (diff)
Eliminated the MemAccessInst class, folding contents into GEP class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3488 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/Local.cpp')
-rw-r--r--lib/Analysis/DataStructure/Local.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp
index d5c488f05c..e561aca210 100644
--- a/lib/Analysis/DataStructure/Local.cpp
+++ b/lib/Analysis/DataStructure/Local.cpp
@@ -101,7 +101,7 @@ namespace {
// getSubscriptedNode - Perform the basic getelementptr functionality that
// must be factored out of gep, load and store while they are all MAI's.
//
- DSNode *getSubscriptedNode(MemAccessInst &MAI, DSNode *Ptr);
+ DSNode *getSubscriptedNode(GetElementPtrInst &GEP, DSNode *Ptr);
};
}
@@ -218,16 +218,15 @@ DSNode *GraphBuilder::getLink(DSNode *Node, unsigned Link) {
// getSubscriptedNode - Perform the basic getelementptr functionality that must
// be factored out of gep, load and store while they are all MAI's.
//
-DSNode *GraphBuilder::getSubscriptedNode(MemAccessInst &MAI, DSNode *Ptr) {
- for (unsigned i = MAI.getFirstIndexOperandNumber(), e = MAI.getNumOperands();
- i != e; ++i)
- if (MAI.getOperand(i)->getType() == Type::UIntTy)
+DSNode *GraphBuilder::getSubscriptedNode(GetElementPtrInst &GEP, DSNode *Ptr) {
+ for (unsigned i = 1, e = GEP.getNumOperands(); i != e; ++i)
+ if (GEP.getOperand(i)->getType() == Type::UIntTy)
Ptr = getLink(Ptr, 0);
- else if (MAI.getOperand(i)->getType() == Type::UByteTy)
- Ptr = getLink(Ptr, cast<ConstantUInt>(MAI.getOperand(i))->getValue());
+ else if (GEP.getOperand(i)->getType() == Type::UByteTy)
+ Ptr = getLink(Ptr, cast<ConstantUInt>(GEP.getOperand(i))->getValue());
- if (MAI.getFirstIndexOperandNumber() == MAI.getNumOperands())
- Ptr = getLink(Ptr, 0); // All MAI's have an implicit 0 if nothing else.
+ if (GEP.getNumOperands() == 1)
+ Ptr = getLink(Ptr, 0); // All GEP's have an implicit 0 if nothing else.
return Ptr;
}