add a simple helper method.
authorChris Lattner <sabre@nondot.org>
Sat, 10 Oct 2009 23:41:48 +0000 (23:41 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 10 Oct 2009 23:41:48 +0000 (23:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83745 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Transforms/Utils/SSAUpdater.h
lib/Transforms/Utils/SSAUpdater.cpp

index c697d048f1f911c91bd558cb529818e40608aa86..11b90d426778b0b7152069728beab0df1457de05 100644 (file)
@@ -60,6 +60,10 @@ public:
   /// AddAvailableValue - Indicate that a rewritten value is available at the
   /// end of the specified block with the specified value.
   void AddAvailableValue(BasicBlock *BB, Value *V);
+
+  /// HasValueForBlock - Return true if the SSAUpdater already has a value for
+  /// the specified block.
+  bool HasValueForBlock(BasicBlock *BB) const;
   
   /// GetValueAtEndOfBlock - Construct SSA form, materializing a value that is
   /// live at the end of the specified block.
index 2fb742bb4459c206773f9ee55fa20f62d908606c..780ee26389429934a75583c90c0b2e1fb3512173 100644 (file)
@@ -56,6 +56,12 @@ void SSAUpdater::Initialize(Value *ProtoValue) {
   PrototypeValue = ProtoValue;
 }
 
+/// HasValueForBlock - Return true if the SSAUpdater already has a value for
+/// the specified block.
+bool SSAUpdater::HasValueForBlock(BasicBlock *BB) const {
+  return getAvailableVals(AV).count(BB);
+}
+
 /// AddAvailableValue - Indicate that a rewritten value is available in the
 /// specified block with the specified value.
 void SSAUpdater::AddAvailableValue(BasicBlock *BB, Value *V) {