OSDN Git Service

Inline this into its only use. NFC.
authorSean Silva <chisophugis@gmail.com>
Sat, 28 May 2016 04:19:40 +0000 (04:19 +0000)
committerSean Silva <chisophugis@gmail.com>
Sat, 28 May 2016 04:19:40 +0000 (04:19 +0000)
The name was out of date at this point and it seems simple enough to
have in-line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271093 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/PGOInstrumentation.cpp

index ccfdf1a..87970e6 100644 (file)
@@ -847,15 +847,6 @@ PreservedAnalyses PGOInstrumentationGen::run(Module &M,
   return PreservedAnalyses::none();
 }
 
-static void setPGOCountOnFunc(PGOUseFunc &Func,
-                              IndexedInstrProfReader *PGOReader) {
-  if (Func.readCounters(PGOReader)) {
-    Func.populateCounters();
-    Func.setBranchWeights();
-    Func.annotateIndirectCallSites();
-  }
-}
-
 static bool annotateAllFunctions(
     Module &M, StringRef ProfileFileName,
     function_ref<BranchProbabilityInfo *(Function &)> LookupBPI,
@@ -895,7 +886,11 @@ static bool annotateAllFunctions(
     auto *BPI = LookupBPI(F);
     auto *BFI = LookupBFI(F);
     PGOUseFunc Func(F, &M, BPI, BFI);
-    setPGOCountOnFunc(Func, PGOReader.get());
+    if (!Func.readCounters(PGOReader.get()))
+      continue;
+    Func.populateCounters();
+    Func.setBranchWeights();
+    Func.annotateIndirectCallSites();
     if (!Func.getProfileRecord().Counts.empty())
       Builder.addRecord(Func.getProfileRecord());
     PGOUseFunc::FuncFreqAttr FreqAttr = Func.getFuncFreqAttr();