summaryrefslogtreecommitdiff
path: root/lib/Analysis/IPA
diff options
context:
space:
mode:
authorVictor Hernandez <vhernandez@apple.com>2009-10-23 21:09:37 +0000
committerVictor Hernandez <vhernandez@apple.com>2009-10-23 21:09:37 +0000
commit7b929dad59785f62a66f7c58615082f98441e95e (patch)
treefe3eb2cd3b56e7c3e89454d73e56986f3ce12ba2 /lib/Analysis/IPA
parent4ab74cdc124af6b4f57c2d2d09548e01d64a1f34 (diff)
downloadllvm-7b929dad59785f62a66f7c58615082f98441e95e.tar.gz
llvm-7b929dad59785f62a66f7c58615082f98441e95e.tar.bz2
llvm-7b929dad59785f62a66f7c58615082f98441e95e.tar.xz
Remove AllocationInst. Since MallocInst went away, AllocaInst is the only subclass of AllocationInst, so it no longer is necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84969 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA')
-rw-r--r--lib/Analysis/IPA/Andersens.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/Analysis/IPA/Andersens.cpp b/lib/Analysis/IPA/Andersens.cpp
index 1c9159dfbf..b5129a7d3b 100644
--- a/lib/Analysis/IPA/Andersens.cpp
+++ b/lib/Analysis/IPA/Andersens.cpp
@@ -594,11 +594,12 @@ namespace {
void visitReturnInst(ReturnInst &RI);
void visitInvokeInst(InvokeInst &II) { visitCallSite(CallSite(&II)); }
void visitCallInst(CallInst &CI) {
- if (isMalloc(&CI)) visitAllocationInst(CI);
+ if (isMalloc(&CI)) visitAlloc(CI);
else visitCallSite(CallSite(&CI));
}
void visitCallSite(CallSite CS);
- void visitAllocationInst(Instruction &I);
+ void visitAllocaInst(AllocaInst &I);
+ void visitAlloc(Instruction &I);
void visitLoadInst(LoadInst &LI);
void visitStoreInst(StoreInst &SI);
void visitGetElementPtrInst(GetElementPtrInst &GEP);
@@ -792,7 +793,7 @@ void Andersens::IdentifyObjects(Module &M) {
// object.
if (isa<PointerType>(II->getType())) {
ValueNodes[&*II] = NumObjects++;
- if (AllocationInst *AI = dyn_cast<AllocationInst>(&*II))
+ if (AllocaInst *AI = dyn_cast<AllocaInst>(&*II))
ObjectNodes[AI] = NumObjects++;
else if (isMalloc(&*II))
ObjectNodes[&*II] = NumObjects++;
@@ -1167,7 +1168,11 @@ void Andersens::visitInstruction(Instruction &I) {
}
}
-void Andersens::visitAllocationInst(Instruction &I) {
+void Andersens::visitAllocaInst(AllocaInst &I) {
+ visitAlloc(I);
+}
+
+void Andersens::visitAlloc(Instruction &I) {
unsigned ObjectIndex = getObject(&I);
GraphNodes[ObjectIndex].setValue(&I);
Constraints.push_back(Constraint(Constraint::AddressOf, getNodeValue(I),
@@ -2819,7 +2824,7 @@ void Andersens::PrintNode(const Node *N) const {
else
errs() << "(unnamed)";
- if (isa<GlobalValue>(V) || isa<AllocationInst>(V) || isMalloc(V))
+ if (isa<GlobalValue>(V) || isa<AllocaInst>(V) || isMalloc(V))
if (N == &GraphNodes[getObject(V)])
errs() << "<mem>";
}