13 #ifndef LLVM_TRANSFORMS_UTILS_MODULEUTILS_H 14 #define LLVM_TRANSFORMS_UTILS_MODULEUTILS_H 22 template <
typename T>
class ArrayRef;
45 ArrayRef<Type *> InitArgTypes);
52 Module &M, StringRef CtorName, StringRef InitName,
53 ArrayRef<Type *> InitArgTypes, ArrayRef<Value *> InitArgs,
54 StringRef VersionCheckName = StringRef());
64 Module &M, StringRef CtorName, StringRef InitName,
65 ArrayRef<Type *> InitArgTypes, ArrayRef<Value *> InitArgs,
66 function_ref<
void(Function *, FunctionCallee)> FunctionsCreatedCallback,
67 StringRef VersionCheckName = StringRef());
79 void appendToUsed(Module &M, ArrayRef<GlobalValue *> Values);
98 Module &M, SmallVectorImpl<Function *> &DeadComdatFunctions);
117 const SmallVector<std::string, 8> &VariantMappings);
121 #endif // LLVM_TRANSFORMS_UTILS_MODULEUTILS_H void appendToCompilerUsed(Module &M, ArrayRef< GlobalValue *> Values)
Adds global values to the llvm.compiler.used list.
void appendToGlobalDtors(Module &M, Function *F, int Priority, Constant *Data=nullptr)
Same as appendToGlobalCtors(), but for global dtors.
Function * getOrCreateInitFunction(Module &M, StringRef Name)
This class represents lattice values for constants.
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
bool nameUnamedGlobals(Module &M)
Rename all the anon globals in the module using a hash computed from the list of public globals in th...
void appendToUsed(Module &M, ArrayRef< GlobalValue *> Values)
Adds global values to the llvm.used list.
std::pair< Function *, FunctionCallee > getOrCreateSanitizerCtorAndInitFunctions(Module &M, StringRef CtorName, StringRef InitName, ArrayRef< Type *> InitArgTypes, ArrayRef< Value *> InitArgs, function_ref< void(Function *, FunctionCallee)> FunctionsCreatedCallback, StringRef VersionCheckName=StringRef())
Creates sanitizer constructor function lazily.
std::string getUniqueModuleId(Module *M)
Produce a unique identifier for this module by taking the MD5 sum of the names of the module's strong...
void appendToGlobalCtors(Module &M, Function *F, int Priority, Constant *Data=nullptr)
Append F to the list of global ctors of module M with the given Priority.
FunctionCallee declareSanitizerInitFunction(Module &M, StringRef InitName, ArrayRef< Type *> InitArgTypes)
void filterDeadComdatFunctions(Module &M, SmallVectorImpl< Function *> &DeadComdatFunctions)
Filter out potentially dead comdat functions where other entries keep the entire comdat group alive...
std::pair< Function *, FunctionCallee > createSanitizerCtorAndInitFunctions(Module &M, StringRef CtorName, StringRef InitName, ArrayRef< Type *> InitArgTypes, ArrayRef< Value *> InitArgs, StringRef VersionCheckName=StringRef())
Creates sanitizer constructor function, and calls sanitizer's init function from it.
void setVectorVariantNames(CallInst *CI, const SmallVector< std::string, 8 > &VariantMappings)
Overwrite the Vector Function ABI variants attribute with the names provide in VariantMappings.