#include "llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <iomanip>
#include <sstream>
#include <string>
usingnamespacellvm;
namespace llvm {
cl::opt<InlinerFunctionImportStatsOpts> InlinerFunctionImportStats(
"inliner-function-import-stats",
cl::init(InlinerFunctionImportStatsOpts::No),
cl::values(clEnumValN(InlinerFunctionImportStatsOpts::Basic, "basic",
"basic statistics"),
clEnumValN(InlinerFunctionImportStatsOpts::Verbose, "verbose",
"printing of statistics for each inlined function")),
cl::Hidden, cl::desc("Enable inliner stats for imported functions"));
}
ImportedFunctionsInliningStatistics::InlineGraphNode &
ImportedFunctionsInliningStatistics::createInlineGraphNode(const Function &F) { … }
void ImportedFunctionsInliningStatistics::recordInline(const Function &Caller,
const Function &Callee) { … }
void ImportedFunctionsInliningStatistics::setModuleInfo(const Module &M) { … }
static std::string getStatString(const char *Msg, int32_t Fraction, int32_t All,
const char *PercentageOfMsg,
bool LineEnd = true) { … }
void ImportedFunctionsInliningStatistics::dump(const bool Verbose) { … }
void ImportedFunctionsInliningStatistics::calculateRealInlines() { … }
void ImportedFunctionsInliningStatistics::dfs(InlineGraphNode &GraphNode) { … }
ImportedFunctionsInliningStatistics::SortedNodesTy
ImportedFunctionsInliningStatistics::getSortedNodes() { … }