Anonymous View
LLVM 23.0.0git
ModuleUtils.h File Reference

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.

Typedefs

using llvm::GlobalCtorTransformFn = llvm::function_ref<Constant *(Constant *)>
 Apply 'Fn' to the list of global ctors of module M and replace contructor record with the one returned by Fn.

Functions

LLVM_ABI void llvm::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.
LLVM_ABI void llvm::appendToGlobalDtors (Module &M, Function *F, int Priority, Constant *Data=nullptr)
 Same as appendToGlobalCtors(), but for global dtors.
LLVM_ABI void llvm::transformGlobalCtors (Module &M, const GlobalCtorTransformFn &Fn)
LLVM_ABI void llvm::transformGlobalDtors (Module &M, const GlobalCtorTransformFn &Fn)
LLVM_ABI void llvm::setKCFIType (Module &M, Function &F, StringRef MangledType)
 Sets the KCFI type for the function.
LLVM_ABI FunctionCallee llvm::declareSanitizerInitFunction (Module &M, StringRef InitName, ArrayRef< Type * > InitArgTypes, bool Weak=false)
LLVM_ABI Functionllvm::createSanitizerCtor (Module &M, StringRef CtorName)
 Creates sanitizer constructor function.
LLVM_ABI std::pair< Function *, FunctionCalleellvm::createSanitizerCtorAndInitFunctions (Module &M, StringRef CtorName, StringRef InitName, ArrayRef< Type * > InitArgTypes, ArrayRef< Value * > InitArgs, StringRef VersionCheckName=StringRef(), bool Weak=false)
 Creates sanitizer constructor function, and calls sanitizer's init function from it.
LLVM_ABI std::pair< Function *, FunctionCalleellvm::getOrCreateSanitizerCtorAndInitFunctions (Module &M, StringRef CtorName, StringRef InitName, ArrayRef< Type * > InitArgTypes, ArrayRef< Value * > InitArgs, function_ref< void(Function *, FunctionCallee)> FunctionsCreatedCallback, StringRef VersionCheckName=StringRef(), bool Weak=false)
 Creates sanitizer constructor function lazily.
LLVM_ABI bool llvm::nameUnamedGlobals (Module &M)
 Rename all the anon globals in the module using a hash computed from the list of public globals in the module.
LLVM_ABI void llvm::appendToUsed (Module &M, ArrayRef< GlobalValue * > Values)
 Adds global values to the llvm.used list.
LLVM_ABI void llvm::appendToCompilerUsed (Module &M, ArrayRef< GlobalValue * > Values)
 Adds global values to the llvm.compiler.used list.
LLVM_ABI void llvm::removeFromUsedLists (Module &M, function_ref< bool(Constant *)> ShouldRemove)
 Removes global values from the llvm.used and llvm.compiler.used arrays.
LLVM_ABI void llvm::filterDeadComdatFunctions (SmallVectorImpl< Function * > &DeadComdatFunctions)
 Filter out potentially dead comdat functions where other entries keep the entire comdat group alive.
LLVM_ABI std::string llvm::getUniqueModuleId (Module *M)
 Produce a unique identifier for this module by taking the MD5 sum of the names of the module's strong external symbols that are not comdat members.
LLVM_ABI void llvm::embedBufferInModule (Module &M, MemoryBufferRef Buf, StringRef SectionName, Align Alignment=Align(1))
 Embed the memory buffer Buf into the module M as a global using the specified section name.
LLVM_ABI bool llvm::lowerGlobalIFuncUsersAsGlobalCtor (Module &M, ArrayRef< GlobalIFunc * > IFuncsToLower={})
 Lower all calls to ifuncs by replacing uses with indirect calls loaded out of a global table initialized in a global constructor.