35 bool runOnFunction(
Function &
F)
override {
36 std::string CountingFunctionName =
38 if (CountingFunctionName.empty())
54 "Inserts calls to mcount-like functions",
false,
false)
61 return new CountingFunctionInserter();
Legacy wrapper pass to provide the GlobalsAAResult object.
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function. ...
This is the interface for a simple mod/ref and alias analysis over globals.
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
INITIALIZE_PASS(CountingFunctionInserter,"cfinserter","Inserts calls to mcount-like functions", false, false) FunctionPass *llvm
FunctionPass * createCountingFunctionInserterPass()
Insert mcount-like function calls.
void initializeCountingFunctionInserterPass(PassRegistry &)
Constant * getOrInsertFunction(StringRef Name, FunctionType *T, AttributeSet AttributeList)
Look up the specified function in the module symbol table.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important base class in LLVM.
Represent the analysis usage information of a pass.
static Type * getVoidTy(LLVMContext &C)
FunctionPass class - This class is used to implement most global optimizations.
static CallInst * Create(Value *Func, ArrayRef< Value * > Args, ArrayRef< OperandBundleDef > Bundles=None, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Module.h This file contains the declarations for the Module class.
StringRef getValueAsString() const
Return the attribute's value as a string.
Module * getParent()
Get the module that this global value is contained inside of...