24 "ignore-redundant-instrumentation",
29 if (!M.getModuleFlag(Flag)) {
35 std::string diagInfo =
36 "Redundant instrumentation detected, with module flag: " +
38 M.getContext().diagnose(
64 for (
auto I = IP, E = BB.
end();
I != E; ++
I) {
65 bool KeepInEntry =
false;
67 if (AI->isStaticAlloca())
70 if (
II->getIntrinsicID() == llvm::Intrinsic::localescape)
97 if (
auto Comdat =
F.getComdat())
105 Comdat *
C = M->getOrInsertComdat(
F.getName());
106 if (
T.isOSBinFormatELF() || (
T.isOSBinFormatCOFF() && !
F.isWeakForLinker()))
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Module.h This file contains the declarations for the Module class.
static cl::opt< bool > ClIgnoreRedundantInstrumentation("ignore-redundant-instrumentation", cl::desc("Ignore redundant instrumentation"), cl::Hidden, cl::init(false))
static BasicBlock::iterator moveBeforeInsertPoint(BasicBlock::iterator I, BasicBlock::iterator IP)
Moves I before IP. Returns new insert point.
uint64_t IntrinsicInst * II
LLVM Basic Block Representation.
const Function * getParent() const
Return the enclosing method, or null if none.
InstListType::iterator iterator
Instruction iterators...
@ NoDeduplicate
No deduplication is performed.
static LLVM_ABI Constant * getString(LLVMContext &Context, StringRef Initializer, bool AddNull=true)
This method constructs a CDS and initializes it with a text string.
This is an important base class in LLVM.
Diagnostic information for IR instrumentation reporting.
const BasicBlock & getEntryBlock() const
void setUnnamedAddr(UnnamedAddr Val)
Module * getParent()
Get the module that this global value is contained inside of...
@ PrivateLinkage
Like Internal, but omit from symbol table.
LLVM_ABI void setCodeModel(CodeModel::Model CM)
Change the code model for this global.
void setAlignment(Align Align)
Sets the alignment attribute of the GlobalVariable.
A Module instance is used to store all the information related to an LLVM module.
@ Override
Uses the specified value, regardless of the behavior or value of the other module.
std::optional< CodeModel::Model > getCodeModel() const
Returns the code model (tiny, small, kernel, medium or large model)
StringRef - Represent a constant reference to a string, i.e.
Triple - Helper class for working with autoconf configuration names.
ObjectFormatType getObjectFormat() const
Get the object format for this triple.
ArchType getArch() const
Get the parsed architecture type of this triple.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Type * getType() const
All values are typed, get the type of this value.
@ C
The default llvm calling convention, compatible with C.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI GlobalVariable * createPrivateGlobalForString(Module &M, StringRef Str, bool AllowMerging, Twine NamePrefix="")
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
LLVM_ABI Comdat * getOrCreateFunctionComdat(Function &F, Triple &T)
LLVM_ABI void setGlobalVariableLargeSection(const Triple &TargetTriple, GlobalVariable &GV)
LLVM_ABI BasicBlock::iterator PrepareToSplitEntryBlock(BasicBlock &BB, BasicBlock::iterator IP)
Instrumentation passes often insert conditional checks into entry blocks.
LLVM_ABI bool checkIfAlreadyInstrumented(Module &M, StringRef Flag)
Check if module has flag attached, if not add the flag.
This struct is a compact representation of a valid (non-zero power of two) alignment.