rename GetValueInBlock -> GetValueAtEndOfBlock to better reflect

what it does.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83740 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2009-10-10 22:41:58 +00:00
parent 8f8e9f0830
commit 5fb107287f
2 changed files with 15 additions and 15 deletions

View File

@ -52,16 +52,16 @@ public:
/// specified block with the specified value. /// specified block with the specified value.
void AddAvailableValue(BasicBlock *BB, Value *V); void AddAvailableValue(BasicBlock *BB, Value *V);
/// GetValueInBlock - Construct SSA form, materializing a value in the /// GetValueAtEndOfBlock - Construct SSA form, materializing a value that is
/// specified block. /// live at the end of the specified block.
Value *GetValueInBlock(BasicBlock *BB); Value *GetValueAtEndOfBlock(BasicBlock *BB);
/// RewriteUse - Rewrite a use of the symbolic value. This handles PHI nodes, /// RewriteUse - Rewrite a use of the symbolic value. This handles PHI nodes,
/// which use their value in the corresponding predecessor. /// which use their value in the corresponding predecessor.
void RewriteUse(Use &U); void RewriteUse(Use &U);
private: private:
Value *GetValueInBlockInternal(BasicBlock *BB); Value *GetValueAtEndOfBlockInternal(BasicBlock *BB);
void operator=(const SSAUpdater&); // DO NOT IMPLEMENT void operator=(const SSAUpdater&); // DO NOT IMPLEMENT
SSAUpdater(const SSAUpdater&); // DO NOT IMPLEMENT SSAUpdater(const SSAUpdater&); // DO NOT IMPLEMENT
}; };

View File

@ -64,11 +64,11 @@ void SSAUpdater::AddAvailableValue(BasicBlock *BB, Value *V) {
getAvailableVals(AV)[BB] = V; getAvailableVals(AV)[BB] = V;
} }
/// GetValueInBlock - Construct SSA form, materializing a value in the /// GetValueAtEndOfBlock - Construct SSA form, materializing a value in the
/// specified block. /// specified block.
Value *SSAUpdater::GetValueInBlock(BasicBlock *BB) { Value *SSAUpdater::GetValueAtEndOfBlock(BasicBlock *BB) {
assert(getIncomingPredInfo(IPI).empty() && "Unexpected Internal State"); assert(getIncomingPredInfo(IPI).empty() && "Unexpected Internal State");
Value *Res = GetValueInBlockInternal(BB); Value *Res = GetValueAtEndOfBlockInternal(BB);
assert(getIncomingPredInfo(IPI).empty() && "Unexpected Internal State"); assert(getIncomingPredInfo(IPI).empty() && "Unexpected Internal State");
return Res; return Res;
} }
@ -81,16 +81,16 @@ void SSAUpdater::RewriteUse(Use &U) {
if (PHINode *UserPN = dyn_cast<PHINode>(User)) if (PHINode *UserPN = dyn_cast<PHINode>(User))
UseBB = UserPN->getIncomingBlock(U); UseBB = UserPN->getIncomingBlock(U);
U.set(GetValueInBlock(UseBB)); U.set(GetValueAtEndOfBlock(UseBB));
} }
/// GetValueInBlock - Check to see if AvailableVals has an entry for the /// GetValueAtEndOfBlockInternal - Check to see if AvailableVals has an entry
/// specified BB and if so, return it. If not, construct SSA form by walking /// for the specified BB and if so, return it. If not, construct SSA form by
/// predecessors inserting PHI nodes as needed until we get to a block where the /// walking predecessors inserting PHI nodes as needed until we get to a block
/// value is available. /// where the value is available.
/// ///
Value *SSAUpdater::GetValueInBlockInternal(BasicBlock *BB) { Value *SSAUpdater::GetValueAtEndOfBlockInternal(BasicBlock *BB) {
AvailableValsTy &AvailableVals = getAvailableVals(AV); AvailableValsTy &AvailableVals = getAvailableVals(AV);
// Query AvailableVals by doing an insertion of null. // Query AvailableVals by doing an insertion of null.
@ -138,7 +138,7 @@ Value *SSAUpdater::GetValueInBlockInternal(BasicBlock *BB) {
if (PHINode *SomePhi = dyn_cast<PHINode>(BB->begin())) { if (PHINode *SomePhi = dyn_cast<PHINode>(BB->begin())) {
for (unsigned i = 0, e = SomePhi->getNumIncomingValues(); i != e; ++i) { for (unsigned i = 0, e = SomePhi->getNumIncomingValues(); i != e; ++i) {
BasicBlock *PredBB = SomePhi->getIncomingBlock(i); BasicBlock *PredBB = SomePhi->getIncomingBlock(i);
Value *PredVal = GetValueInBlockInternal(PredBB); Value *PredVal = GetValueAtEndOfBlockInternal(PredBB);
IncomingPredInfo.push_back(std::make_pair(PredBB, PredVal)); IncomingPredInfo.push_back(std::make_pair(PredBB, PredVal));
// Compute SingularValue. // Compute SingularValue.
@ -151,7 +151,7 @@ Value *SSAUpdater::GetValueInBlockInternal(BasicBlock *BB) {
bool isFirstPred = true; bool isFirstPred = true;
for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI) { for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI) {
BasicBlock *PredBB = *PI; BasicBlock *PredBB = *PI;
Value *PredVal = GetValueInBlockInternal(PredBB); Value *PredVal = GetValueAtEndOfBlockInternal(PredBB);
IncomingPredInfo.push_back(std::make_pair(PredBB, PredVal)); IncomingPredInfo.push_back(std::make_pair(PredBB, PredVal));
// Compute SingularValue. // Compute SingularValue.