#include "llvm/Transforms/Instrumentation/CGProfile.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/Analysis/BlockFrequencyInfo.h"
#include "llvm/Analysis/LazyBlockFrequencyInfo.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/MDBuilder.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/PassManager.h"
#include "llvm/ProfileData/InstrProf.h"
#include "llvm/Transforms/Utils/Instrumentation.h"
#include <optional>
usingnamespacellvm;
static bool
addModuleFlags(Module &M,
MapVector<std::pair<Function *, Function *>, uint64_t> &Counts) { … }
static bool runCGProfilePass(Module &M, FunctionAnalysisManager &FAM,
bool InLTO) { … }
PreservedAnalyses CGProfilePass::run(Module &M, ModuleAnalysisManager &MAM) { … }