#include "llvm/Transforms/Utils/EntryExitInstrumenter.h"
#include "llvm/Analysis/GlobalsModRef.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
#include "llvm/InitializePasses.h"
#include "llvm/TargetParser/Triple.h"
#include "llvm/Pass.h"
#include "llvm/Transforms/Utils.h"
usingnamespacellvm;
static void insertCall(Function &CurFn, StringRef Func,
BasicBlock::iterator InsertionPt, DebugLoc DL) { … }
static bool runOnFunction(Function &F, bool PostInlining) { … }
namespace {
struct PostInlineEntryExitInstrumenter : public FunctionPass { … };
char PostInlineEntryExitInstrumenter::ID = …;
}
INITIALIZE_PASS_BEGIN(
PostInlineEntryExitInstrumenter, "post-inline-ee-instrument",
"Instrument function entry/exit with calls to e.g. mcount() "
"(post inlining)",
false, false)
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
INITIALIZE_PASS_END(
PostInlineEntryExitInstrumenter, "post-inline-ee-instrument",
"Instrument function entry/exit with calls to e.g. mcount() "
"(post inlining)",
false, false)
FunctionPass *llvm::createPostInlineEntryExitInstrumenterPass() { … }
PreservedAnalyses
llvm::EntryExitInstrumenterPass::run(Function &F, FunctionAnalysisManager &AM) { … }
void llvm::EntryExitInstrumenterPass::printPipeline(
raw_ostream &OS, function_ref<StringRef(StringRef)> MapClassName2PassName) { … }