X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;ds=sidebyside;f=include%2Fllvm%2FCodeGen%2FMachineBlockFrequencyInfo.h;h=feb394e7a69e0026dd7fa40c611503883acf0b84;hb=56a8a2731eae03b594ba10c0a52bc5dbb15f820f;hp=d779dc38860ba1b51ba000e8eba7220973831880;hpb=9f998de8918c1dd5a8b8ec564af00107859898e0;p=oota-llvm.git diff --git a/include/llvm/CodeGen/MachineBlockFrequencyInfo.h b/include/llvm/CodeGen/MachineBlockFrequencyInfo.h index d779dc38860..feb394e7a69 100644 --- a/include/llvm/CodeGen/MachineBlockFrequencyInfo.h +++ b/include/llvm/CodeGen/MachineBlockFrequencyInfo.h @@ -1,4 +1,4 @@ -//====-- MachineBlockFrequencyInfo.h - MBB Frequency Analysis -*- C++ -*--====// +//===- MachineBlockFrequencyInfo.h - MBB Frequency Analysis -*- C++ -*-----===// // // The LLVM Compiler Infrastructure // @@ -22,27 +22,27 @@ namespace llvm { class MachineBasicBlock; class MachineBranchProbabilityInfo; -template -class BlockFrequencyImpl; +template class BlockFrequencyInfoImpl; -/// MachineBlockFrequencyInfo pass uses BlockFrequencyImpl implementation to estimate -/// machine basic block frequencies. +/// MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation +/// to estimate machine basic block frequencies. class MachineBlockFrequencyInfo : public MachineFunctionPass { - - BlockFrequencyImpl *MBFI; + typedef BlockFrequencyInfoImpl ImplType; + std::unique_ptr MBFI; public: static char ID; MachineBlockFrequencyInfo(); - ~MachineBlockFrequencyInfo(); + ~MachineBlockFrequencyInfo() override; void getAnalysisUsage(AnalysisUsage &AU) const override; bool runOnMachineFunction(MachineFunction &F) override; + void releaseMemory() override; + /// getblockFreq - Return block frequency. Return 0 if we don't have the /// information. Please note that initial frequency is equal to 1024. It means /// that we should not rely on the value itself, but only on the comparison to @@ -50,7 +50,7 @@ public: /// BlockFrequency getBlockFreq(const MachineBasicBlock *MBB) const; - MachineFunction *getFunction() const; + const MachineFunction *getFunction() const; void view() const; // Print the block frequency Freq to OS using the current functions entry