aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-10 23:15:24 +0000
committerChris Lattner <sabre@nondot.org>2009-10-10 23:15:24 +0000
commitf5a1fb6b247611b92d9dec9476202b477661dbe8 (patch)
treef5ea2f5452c36cb04c0c881e94decc37be13bfd0 /lib
parentaa6aeb91b4863ab7c17df154d10ba61d265ca3da (diff)
downloadexternal_llvm-f5a1fb6b247611b92d9dec9476202b477661dbe8.zip
external_llvm-f5a1fb6b247611b92d9dec9476202b477661dbe8.tar.gz
external_llvm-f5a1fb6b247611b92d9dec9476202b477661dbe8.tar.bz2
add ability for clients of SSAUpdater to find out about the
PHI nodes inserted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83744 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Utils/SSAUpdater.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/SSAUpdater.cpp b/lib/Transforms/Utils/SSAUpdater.cpp
index 294d9aa..2fb742b 100644
--- a/lib/Transforms/Utils/SSAUpdater.cpp
+++ b/lib/Transforms/Utils/SSAUpdater.cpp
@@ -33,7 +33,8 @@ static IncomingPredInfoTy &getIncomingPredInfo(void *IPI) {
}
-SSAUpdater::SSAUpdater() : AV(0), PrototypeValue(0), IPI(0) {}
+SSAUpdater::SSAUpdater(SmallVectorImpl<PHINode*> *NewPHI)
+ : AV(0), PrototypeValue(0), IPI(0), InsertedPHIs(NewPHI) {}
SSAUpdater::~SSAUpdater() {
delete &getAvailableVals(AV);
@@ -158,6 +159,10 @@ Value *SSAUpdater::GetValueInMiddleOfBlock(BasicBlock *BB) {
InsertedPHI->eraseFromParent();
return ConstVal;
}
+
+ // If the client wants to know about all new instructions, tell it.
+ if (InsertedPHIs) InsertedPHIs->push_back(InsertedPHI);
+
DEBUG(errs() << " Inserted PHI: " << *InsertedPHI << "\n");
return InsertedPHI;
}
@@ -313,6 +318,9 @@ Value *SSAUpdater::GetValueAtEndOfBlockInternal(BasicBlock *BB) {
InsertedVal = ConstVal;
} else {
DEBUG(errs() << " Inserted PHI: " << *InsertedPHI << "\n");
+
+ // If the client wants to know about all new instructions, tell it.
+ if (InsertedPHIs) InsertedPHIs->push_back(InsertedPHI);
}
return InsertedVal;