mirror of
https://github.com/RPCS3/llvm.git
synced 2025-03-02 07:37:02 +00:00
Add null checks before using a pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272359 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7f8e1c60de
commit
fc34cc4521
@ -84,9 +84,13 @@ bool ProfileSummaryInfo::isHotFunction(const Function *F) {
|
||||
// example, no profile data is available).
|
||||
bool ProfileSummaryInfo::isColdFunction(const Function *F) {
|
||||
computeSummary();
|
||||
if (!F)
|
||||
return false;
|
||||
if (F->hasFnAttribute(Attribute::Cold)) {
|
||||
return true;
|
||||
}
|
||||
if (!Summary)
|
||||
return false;
|
||||
auto FunctionCount = F->getEntryCount();
|
||||
// FIXME: The heuristic used below for determining coldness is based on
|
||||
// preliminary SPEC tuning for inliner. This will eventually be a
|
||||
|
Loading…
x
Reference in New Issue
Block a user