51 std::unique_ptr<Module> New =
66 I->isConstant(),
I->getLinkage(),
69 I->getThreadLocalMode(),
70 I->getType()->getAddressSpace());
79 I.getAddressSpace(),
I.getName(), New.get());
87 if (!ShouldCloneDefinition(&*
I)) {
93 if (
I->getValueType()->isFunctionTy())
96 I->getAddressSpace(),
I->getName(), New.get());
100 nullptr,
I->getName(),
nullptr,
101 I->getThreadLocalMode(),
I->getType()->getAddressSpace());
109 I->getType()->getPointerAddressSpace(),
110 I->getLinkage(),
I->getName(), New.get());
121 if (
I->isDeclaration())
125 if (!ShouldCloneDefinition(&*
I)) {
130 if (
I->hasInitializer())
134 I->getAllMetadata(MDs);
145 if (
I.isDeclaration())
149 if (!ShouldCloneDefinition(&
I)) {
161 VMap[&*J] = &*DestI++;
167 if (
I.hasPersonalityFn())
177 if (!ShouldCloneDefinition(&*
I))
186 E = M.named_metadata_end();
const std::string & getTargetTriple() const
Get the target triple which is a string describing the target host.
This class represents an incoming formal argument to a Function.
MDNode * getOperand(unsigned i) const
This class represents lattice values for constants.
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
A Module instance is used to store all the information related to an LLVM module. ...
void addOperand(MDNode *M)
An efficient, type-erasing, non-owning reference to a callable.
Externally visible function.
Metadata * MapMetadata(const Metadata *MD, ValueToValueMapTy &VM, RemapFlags Flags=RF_None, ValueMapTypeRemapper *TypeMapper=nullptr, ValueMaterializer *Materializer=nullptr)
Lookup or compute a mapping for a piece of metadata.
void CloneFunctionInto(Function *NewFunc, const Function *OldFunc, ValueToValueMapTy &VMap, bool ModuleLevelChanges, SmallVectorImpl< ReturnInst *> &Returns, const char *NameSuffix="", ClonedCodeInfo *CodeInfo=nullptr, ValueMapTypeRemapper *TypeMapper=nullptr, ValueMaterializer *Materializer=nullptr)
Clone OldFunc into NewFunc, transforming the old arguments into references to VMap values...
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
static ManagedStatic< DebugCounter > DC
Attribute unwrap(LLVMAttributeRef Attr)
void copyAttributesFrom(const GlobalValue *Src)
void setInitializer(Constant *InitVal)
setInitializer - Sets the initializer for this global variable, removing any existing initializer if ...
LLVMContext & getContext() const
Get the global data context.
unsigned getNumOperands() const
void setName(const Twine &Name)
Change the name of the value.
global_iterator global_begin()
Instruct the remapper to move distinct metadata instead of duplicating it when there are module-level...
void setComdat(Comdat *C)
const std::string & getSourceFileName() const
Get the module's original source file name.
std::unique_ptr< Module > CloneModule(const Module &M)
Return an exact copy of the specified module.
StringRef getName() const
static Function * Create(FunctionType *Ty, LinkageTypes Linkage, unsigned AddrSpace, const Twine &N="", Module *M=nullptr)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This is an important base class in LLVM.
void copyAttributesFrom(const Function *Src)
copyAttributesFrom - copy all additional attributes (those not needed to create a Function) from the ...
LLVMModuleRef LLVMCloneModule(LLVMModuleRef M)
Return an exact copy of the specified module.
static void copyComdat(GlobalObject *Dst, const GlobalObject *Src)
Comdat * getOrInsertComdat(StringRef Name)
Return the Comdat in the module with the specified name.
const std::string & getModuleIdentifier() const
Get the module identifier which is, essentially, the name of the module.
Value * MapValue(const Value *V, ValueToValueMapTy &VM, RemapFlags Flags=RF_None, ValueMapTypeRemapper *TypeMapper=nullptr, ValueMaterializer *Materializer=nullptr)
Look up or compute a value in the value map.
global_iterator global_end()
Iterator for intrusive lists based on ilist_node.
void setSelectionKind(SelectionKind Val)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Module.h This file contains the declarations for the Module class.
void addMetadata(unsigned KindID, MDNode &MD)
Add a metadata attachment.
CHAIN = SC CHAIN, Imm128 - System call.
void setLinkage(LinkageTypes LT)
StringRef getName() const
const Comdat * getComdat() const
LLVMAttributeRef wrap(Attribute Attr)
void copyAttributesFrom(const GlobalVariable *Src)
copyAttributesFrom - copy all additional attributes (those not needed to create a GlobalVariable) fro...
const std::string & getModuleInlineAsm() const
Get any module-scope inline assembly blocks.
Module * getParent()
Get the module that this global value is contained inside of...
void setPersonalityFn(Constant *Fn)
static GlobalAlias * create(Type *Ty, unsigned AddressSpace, LinkageTypes Linkage, const Twine &Name, Constant *Aliasee, Module *Parent)
If a parent module is specified, the alias is automatically inserted into the end of the specified mo...
void setAliasee(Constant *Aliasee)
These methods retrieve and set alias target.
SelectionKind getSelectionKind() const