[llvm-commits] [llvm] r83745 - in /llvm/trunk: include/llvm/Transforms/Utils/SSAUpdater.h lib/Transforms/Utils/SSAUpdater.cpp
Chris Lattner
sabre at nondot.org
Sat Oct 10 16:41:49 PDT 2009
Author: lattner
Date: Sat Oct 10 18:41:48 2009
New Revision: 83745
URL: http://llvm.org/viewvc/llvm-project?rev=83745&view=rev
Log:
add a simple helper method.
Modified:
llvm/trunk/include/llvm/Transforms/Utils/SSAUpdater.h
llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp
Modified: llvm/trunk/include/llvm/Transforms/Utils/SSAUpdater.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/SSAUpdater.h?rev=83745&r1=83744&r2=83745&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/Utils/SSAUpdater.h (original)
+++ llvm/trunk/include/llvm/Transforms/Utils/SSAUpdater.h Sat Oct 10 18:41:48 2009
@@ -60,6 +60,10 @@
/// 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.
Modified: llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp?rev=83745&r1=83744&r2=83745&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp Sat Oct 10 18:41:48 2009
@@ -56,6 +56,12 @@
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) {
More information about the llvm-commits
mailing list