diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-03-25 18:01:38 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-03-25 18:01:38 +0000 |
commit | 27e1ca8189e0c566092dd165903d0cf3f89f16a3 (patch) | |
tree | 5df62d3b7e607781055049cefae5a5bc6e7b6bf2 /include/llvm/CodeGen | |
parent | 8451e1baa9fa3921c7820d7f279fcebd5581b01d (diff) | |
download | llvm-27e1ca8189e0c566092dd165903d0cf3f89f16a3.tar.gz llvm-27e1ca8189e0c566092dd165903d0cf3f89f16a3.tar.bz2 llvm-27e1ca8189e0c566092dd165903d0cf3f89f16a3.tar.xz |
blockfreq: Implement Pass::releaseMemory()
Implement Pass::releaseMemory() in BlockFrequencyInfo and
MachineBlockFrequencyInfo. Just delete the private implementation when
not in use. Switch to a std::unique_ptr to make the logic more clear.
<rdar://problem/14292693>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204741 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r-- | include/llvm/CodeGen/MachineBlockFrequencyInfo.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/MachineBlockFrequencyInfo.h b/include/llvm/CodeGen/MachineBlockFrequencyInfo.h index 0539e35252..f3ef87cbbc 100644 --- a/include/llvm/CodeGen/MachineBlockFrequencyInfo.h +++ b/include/llvm/CodeGen/MachineBlockFrequencyInfo.h @@ -28,9 +28,9 @@ class BlockFrequencyImpl; /// MachineBlockFrequencyInfo pass uses BlockFrequencyImpl implementation to estimate /// machine basic block frequencies. class MachineBlockFrequencyInfo : public MachineFunctionPass { - - BlockFrequencyImpl<MachineBasicBlock, MachineFunction, - MachineBranchProbabilityInfo> *MBFI; + typedef BlockFrequencyImpl<MachineBasicBlock, MachineFunction, + MachineBranchProbabilityInfo> ImplType; + std::unique_ptr<ImplType> MBFI; public: static char ID; @@ -43,6 +43,8 @@ public: 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 |