MachineFunction: Return reference from getFunction(); NFC
The Function can never be nullptr so we can return a reference.
llvm-svn: 320884
diff --git a/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp b/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp
index 2c336e4..3459a9f 100644
--- a/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp
+++ b/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp
@@ -224,14 +224,14 @@
Optional<uint64_t> MachineBlockFrequencyInfo::getBlockProfileCount(
const MachineBasicBlock *MBB) const {
- const Function *F = MBFI->getFunction()->getFunction();
- return MBFI ? MBFI->getBlockProfileCount(*F, MBB) : None;
+ const Function &F = MBFI->getFunction()->getFunction();
+ return MBFI ? MBFI->getBlockProfileCount(F, MBB) : None;
}
Optional<uint64_t>
MachineBlockFrequencyInfo::getProfileCountFromFreq(uint64_t Freq) const {
- const Function *F = MBFI->getFunction()->getFunction();
- return MBFI ? MBFI->getProfileCountFromFreq(*F, Freq) : None;
+ const Function &F = MBFI->getFunction()->getFunction();
+ return MBFI ? MBFI->getProfileCountFromFreq(F, Freq) : None;
}
bool