Rename doFunction() in BFI to calculate() and change its parameters from pointers to references.

http://reviews.llvm.org/D11196

llvm-svn: 242322
This commit is contained in:
Cong Hou 2015-07-15 19:58:26 +00:00
parent b1db6e888b
commit 5e67b66640
3 changed files with 12 additions and 12 deletions

View File

@ -905,8 +905,8 @@ template <class BT> class BlockFrequencyInfoImpl : BlockFrequencyInfoImplBase {
public:
const FunctionT *getFunction() const { return F; }
void doFunction(const FunctionT *F, const BranchProbabilityInfoT *BPI,
const LoopInfoT *LI);
void calculate(const FunctionT &F, const BranchProbabilityInfoT &BPI,
const LoopInfoT &LI);
BlockFrequencyInfoImpl() : BPI(nullptr), LI(nullptr), F(nullptr) {}
using BlockFrequencyInfoImplBase::getEntryFreq;
@ -938,13 +938,13 @@ public:
};
template <class BT>
void BlockFrequencyInfoImpl<BT>::doFunction(const FunctionT *F,
const BranchProbabilityInfoT *BPI,
const LoopInfoT *LI) {
void BlockFrequencyInfoImpl<BT>::calculate(const FunctionT &F,
const BranchProbabilityInfoT &BPI,
const LoopInfoT &LI) {
// Save the parameters.
this->BPI = BPI;
this->LI = LI;
this->F = F;
this->BPI = &BPI;
this->LI = &LI;
this->F = &F;
// Clean up left-over data structures.
BlockFrequencyInfoImplBase::clear();
@ -952,8 +952,8 @@ void BlockFrequencyInfoImpl<BT>::doFunction(const FunctionT *F,
Nodes.clear();
// Initialize.
DEBUG(dbgs() << "\nblock-frequency: " << F->getName() << "\n================="
<< std::string(F->getName().size(), '=') << "\n");
DEBUG(dbgs() << "\nblock-frequency: " << F.getName() << "\n================="
<< std::string(F.getName().size(), '=') << "\n");
initializeRPOT();
initializeLoops();

View File

@ -110,7 +110,7 @@ void BlockFrequencyInfo::calculate(const Function &F,
const LoopInfo &LI) {
if (!BFI)
BFI.reset(new ImplType);
BFI->doFunction(&F, &BPI, &LI);
BFI->calculate(F, BPI, LI);
#ifndef NDEBUG
if (ViewBlockFreqPropagationDAG != GVDT_None)
view();

View File

@ -143,7 +143,7 @@ bool MachineBlockFrequencyInfo::runOnMachineFunction(MachineFunction &F) {
MachineLoopInfo &MLI = getAnalysis<MachineLoopInfo>();
if (!MBFI)
MBFI.reset(new ImplType);
MBFI->doFunction(&F, &MBPI, &MLI);
MBFI->calculate(F, MBPI, MLI);
#ifndef NDEBUG
if (ViewMachineBlockFreqPropagationDAG != GVDT_None) {
view();