diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-10-10 23:41:48 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-10-10 23:41:48 +0000 |
| commit | 9c382cebc5ec8ff2f81840967f7acf0de4e3ceca (patch) | |
| tree | e09c985409e9d209187a412c06d39e459ec75b85 | |
| parent | 249265de06c3287a48f701c830e4a01f91bd9886 (diff) | |
| download | bcm5719-llvm-9c382cebc5ec8ff2f81840967f7acf0de4e3ceca.tar.gz bcm5719-llvm-9c382cebc5ec8ff2f81840967f7acf0de4e3ceca.zip | |
add a simple helper method.
llvm-svn: 83745
| -rw-r--r-- | llvm/include/llvm/Transforms/Utils/SSAUpdater.h | 4 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Utils/SSAUpdater.cpp | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/llvm/include/llvm/Transforms/Utils/SSAUpdater.h b/llvm/include/llvm/Transforms/Utils/SSAUpdater.h index c697d048f1f..11b90d42677 100644 --- a/llvm/include/llvm/Transforms/Utils/SSAUpdater.h +++ b/llvm/include/llvm/Transforms/Utils/SSAUpdater.h @@ -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. diff --git a/llvm/lib/Transforms/Utils/SSAUpdater.cpp b/llvm/lib/Transforms/Utils/SSAUpdater.cpp index 2fb742bb445..780ee263894 100644 --- a/llvm/lib/Transforms/Utils/SSAUpdater.cpp +++ b/llvm/lib/Transforms/Utils/SSAUpdater.cpp @@ -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) { |

