From: Jordan Rupprecht Date: Mon, 4 Mar 2019 22:54:44 +0000 (+0000) Subject: [NFC] Fix PGO link error in shared libs build X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6005be2936a5f9f0dbfab13c7a5e56db0c02a90b;p=llvm [NFC] Fix PGO link error in shared libs build git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355346 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h b/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h index e59d1ba64cf..21cf291d82d 100644 --- a/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h +++ b/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h @@ -17,7 +17,6 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/IR/PassManager.h" -#include "llvm/ProfileData/InstrProf.h" #include #include @@ -38,11 +37,7 @@ class PGOInstrumentationGenCreateVar public: PGOInstrumentationGenCreateVar(std::string CSInstrName = "") : CSInstrName(CSInstrName) {} - PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM) { - createProfileFileNameVar(M, CSInstrName); - createIRLevelProfileFlagVar(M, /* IsCS */ true); - return PreservedAnalyses::all(); - } + PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); private: std::string CSInstrName; diff --git a/lib/Transforms/Instrumentation/PGOInstrumentation.cpp b/lib/Transforms/Instrumentation/PGOInstrumentation.cpp index 3cf3d90620f..ac97f7fb9b2 100644 --- a/lib/Transforms/Instrumentation/PGOInstrumentation.cpp +++ b/lib/Transforms/Instrumentation/PGOInstrumentation.cpp @@ -47,7 +47,6 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Transforms/Instrumentation/PGOInstrumentation.h" #include "CFGMST.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/ArrayRef.h" @@ -107,6 +106,7 @@ #include "llvm/Support/JamCRC.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Transforms/Instrumentation.h" +#include "llvm/Transforms/Instrumentation/PGOInstrumentation.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include #include @@ -1477,6 +1477,13 @@ static bool InstrumentAllFunctions( return true; } +PreservedAnalyses +PGOInstrumentationGenCreateVar::run(Module &M, ModuleAnalysisManager &AM) { + createProfileFileNameVar(M, CSInstrName); + createIRLevelProfileFlagVar(M, /* IsCS */ true); + return PreservedAnalyses::all(); +} + bool PGOInstrumentationGenLegacyPass::runOnModule(Module &M) { if (skipModule(M)) return false;