summaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/PHITransAddr.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Analysis/PHITransAddr.h')
-rw-r--r--include/llvm/Analysis/PHITransAddr.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/llvm/Analysis/PHITransAddr.h b/include/llvm/Analysis/PHITransAddr.h
index c88e4013aa..b612316057 100644
--- a/include/llvm/Analysis/PHITransAddr.h
+++ b/include/llvm/Analysis/PHITransAddr.h
@@ -106,10 +106,13 @@ private:
BasicBlock *PredBB, const DominatorTree &DT,
SmallVectorImpl<Instruction*> &NewInsts);
- /// ReplaceInstWithValue - Remove any instruction inputs in the InstInputs
- /// array that are due to the specified instruction that is about to be
- /// removed from the address, and add any corresponding to V. This returns V.
- Value *ReplaceInstWithValue(Instruction *I, Value *V);
+ /// AddAsInput - If the specified value is an instruction, add it as an input.
+ Value *AddAsInput(Value *V) {
+ // If V is an instruction, it is now an input.
+ if (Instruction *VI = dyn_cast<Instruction>(V))
+ InstInputs.push_back(VI);
+ return V;
+ }
};