49 I->getType()->getElementType(),
50 I->isConstant(),
I->getLinkage(),
53 I->getThreadLocalMode(),
54 I->getType()->getAddressSpace());
63 I->getLinkage(),
I->getName(), New);
71 auto *PTy = cast<PointerType>(
I->getType());
84 if (
I->hasInitializer())
92 if (!
I->isDeclaration()) {
96 DestI->setName(J->getName());
105 if (
I->hasPersonalityFn())
void setPersonalityFn(Constant *C)
StringRef getName() const
virtual void copyAttributesFrom(const GlobalValue *Src)
Copy all additional attributes (those not needed to create a GlobalValue) from the GlobalValue Src to...
Module * CloneModule(const Module *M)
CloneModule - Return an exact copy of the specified module.
A Module instance is used to store all the information related to an LLVM module. ...
void addOperand(MDNode *M)
named_metadata_iterator named_metadata_end()
NamedMDNode * getOrInsertNamedMetadata(StringRef Name)
Return the named MDNode in the module with the specified name.
void setDataLayout(StringRef Desc)
Set the data layout.
const std::string & getTargetTriple() const
Get the target triple which is a string describing the target host.
void setInitializer(Constant *InitVal)
setInitializer - Sets the initializer for this global variable, removing any existing initializer if ...
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...
void setModuleInlineAsm(StringRef Asm)
Set the module-scope inline assembly blocks.
const std::string & getModuleIdentifier() const
Get the module identifier which is, essentially, the name of the module.
global_iterator global_begin()
LLVMTargetDataRef wrap(const DataLayout *P)
DataLayout * unwrap(LLVMTargetDataRef P)
alias_iterator alias_end()
static GlobalAlias * create(PointerType *Ty, 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...
This is an important base class in LLVM.
Metadata * MapMetadata(const Metadata *MD, ValueToValueMapTy &VM, RemapFlags Flags=RF_None, ValueMapTypeRemapper *TypeMapper=nullptr, ValueMaterializer *Materializer=nullptr)
LLVMModuleRef LLVMCloneModule(LLVMModuleRef M)
Return an exact copy of the specified module.
Value * MapValue(const Value *V, ValueToValueMapTy &VM, RemapFlags Flags=RF_None, ValueMapTypeRemapper *TypeMapper=nullptr, ValueMaterializer *Materializer=nullptr)
MDNode * getOperand(unsigned i) const
void copyAttributesFrom(const GlobalValue *Src) override
copyAttributesFrom - copy all additional attributes (those not needed to create a Function) from the ...
const std::string & getModuleInlineAsm() const
Get any module-scope inline assembly blocks.
global_iterator global_end()
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.
alias_iterator alias_begin()
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
void setTargetTriple(StringRef T)
Set the target triple.
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
void copyAttributesFrom(const GlobalValue *Src) override
copyAttributesFrom - copy all additional attributes (those not needed to create a GlobalVariable) fro...
unsigned getNumOperands() const
static Function * Create(FunctionType *Ty, LinkageTypes Linkage, const Twine &N="", Module *M=nullptr)
void setAliasee(Constant *Aliasee)
These methods retrive and set alias target.
named_metadata_iterator named_metadata_begin()
LLVMContext & getContext() const
Get the global data context.