From ef8dedc79ce02710ffba6a3005e05672702f555f Mon Sep 17 00:00:00 2001 From: Rahman Lavaee Date: Tue, 18 Apr 2023 21:19:28 +0000 Subject: [PATCH] Refactor BasicBlockSectionsProfileReader::getBBClusterInfoForFunction. --- llvm/lib/CodeGen/BasicBlockSectionsProfileReader.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/llvm/lib/CodeGen/BasicBlockSectionsProfileReader.cpp b/llvm/lib/CodeGen/BasicBlockSectionsProfileReader.cpp index 5bc8d82..8929955 100644 --- a/llvm/lib/CodeGen/BasicBlockSectionsProfileReader.cpp +++ b/llvm/lib/CodeGen/BasicBlockSectionsProfileReader.cpp @@ -35,13 +35,10 @@ bool BasicBlockSectionsProfileReader::isFunctionHot(StringRef FuncName) const { std::pair> BasicBlockSectionsProfileReader::getBBClusterInfoForFunction( StringRef FuncName) const { - std::pair> cluster_info(false, {}); auto R = ProgramBBClusterInfo.find(getAliasName(FuncName)); - if (R != ProgramBBClusterInfo.end()) { - cluster_info.second = R->second; - cluster_info.first = true; - } - return cluster_info; + return R != ProgramBBClusterInfo.end() + ? std::pair(true, R->second) + : std::pair(false, SmallVector{}); } // Basic Block Sections can be enabled for a subset of machine basic blocks. -- 2.7.4