Go to the documentation of this file.
28 Comdat *
DC = Dst->getParent()->getOrInsertComdat(
SC->getName());
29 DC->setSelectionKind(
SC->getSelectionKind());
53 std::unique_ptr<Module> New =
54 std::make_unique<Module>(
M.getModuleIdentifier(),
M.getContext());
55 New->setSourceFileName(
M.getSourceFileName());
56 New->setDataLayout(
M.getDataLayout());
57 New->setTargetTriple(
M.getTargetTriple());
58 New->setModuleInlineAsm(
M.getModuleInlineAsm());
66 *New,
I.getValueType(),
I.isConstant(),
I.getLinkage(),
68 I.getThreadLocalMode(),
I.getType()->getAddressSpace());
77 I.getAddressSpace(),
I.getName(), New.get());
84 if (!ShouldCloneDefinition(&
I)) {
90 if (
I.getValueType()->isFunctionTy())
93 I.getName(), New.get());
97 I.getName(),
nullptr,
I.getThreadLocalMode(),
98 I.getType()->getAddressSpace());
106 I.getType()->getPointerAddressSpace(),
107 I.getLinkage(),
I.getName(), New.get());
108 GA->copyAttributesFrom(&
I);
120 G.getAllMetadata(MDs);
124 if (
G.isDeclaration())
127 if (!ShouldCloneDefinition(&
G)) {
132 if (
G.hasInitializer())
143 if (
I.isDeclaration()) {
147 I.getAllMetadata(MDs);
149 F->addMetadata(MD.first, *
MapMetadata(MD.second, VMap));
153 if (!ShouldCloneDefinition(&
I)) {
157 F->setPersonalityFn(
nullptr);
164 VMap[&J] = &*DestI++;
171 if (
I.hasPersonalityFn())
172 F->setPersonalityFn(
MapValue(
I.getPersonalityFn(), VMap));
180 if (!ShouldCloneDefinition(&
I))
189 NamedMDNode *NewNMD = New->getOrInsertNamedMetadata(NMD.getName());
190 for (
unsigned i = 0,
e = NMD.getNumOperands();
i !=
e; ++
i)
This class represents an incoming formal argument to a Function.
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
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 copyAttributesFrom(const GlobalVariable *Src)
copyAttributesFrom - copy all additional attributes (those not needed to create a GlobalVariable) fro...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
LLVMModuleRef LLVMCloneModule(LLVMModuleRef M)
Return an exact copy of the specified module.
static void copyComdat(GlobalObject *Dst, const GlobalObject *Src)
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.
void addOperand(MDNode *M)
@ SC
CHAIN = SC CHAIN, Imm128 - System call.
(vector float) vec_cmpeq(*A, *B) C
Attribute unwrap(LLVMAttributeRef Attr)
void copyAttributesFrom(const Function *Src)
copyAttributesFrom - copy all additional attributes (those not needed to create a Function) from the ...
void addMetadata(unsigned KindID, MDNode &MD)
Add a metadata attachment.
void setName(const Twine &Name)
Change the name of the value.
An efficient, type-erasing, non-owning reference to a callable.
This is an important base class in LLVM.
void setLinkage(LinkageTypes LT)
static Function * Create(FunctionType *Ty, LinkageTypes Linkage, unsigned AddrSpace, const Twine &N="", Module *M=nullptr)
A Module instance is used to store all the information related to an LLVM module.
LLVMAttributeRef wrap(Attribute Attr)
static ManagedStatic< DebugCounter > DC
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...
@ ExternalLinkage
Externally visible function.
std::unique_ptr< Module > CloneModule(const Module &M)
Return an exact copy of the specified module.
void CloneFunctionInto(Function *NewFunc, const Function *OldFunc, ValueToValueMapTy &VMap, CloneFunctionChangeType Changes, 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 setAliasee(Constant *Aliasee)
These methods retrieve and set alias target.
void setInitializer(Constant *InitVal)
setInitializer - Sets the initializer for this global variable, removing any existing initializer if ...
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.