49 void ValueMapTypeRemapper::anchor() {}
50 void ValueMaterializer::anchor() {}
56 struct DelayedBasicBlock {
58 std::unique_ptr<BasicBlock> TempBB;
61 : OldBB(Old.getBasicBlock()),
62 TempBB(
BasicBlock::Create(Old.getContext())) {}
65 struct WorklistEntry {
69 MapGlobalIndirectSymbol,
76 struct AppendingGVTy {
80 struct GlobalIndirectSymbolTy {
87 unsigned AppendingGVIsOldCtorDtor : 1;
88 unsigned AppendingGVNumNewMembers;
91 AppendingGVTy AppendingGV;
97 struct MappingContext {
104 : VM(&VM), Materializer(Materializer) {}
108 friend class MDNodeMapper;
116 unsigned CurrentMCID = 0;
125 : Flags(Flags), TypeMapper(TypeMapper),
126 MCs(1, MappingContext(VM, Materializer)) {}
129 ~Mapper() {
assert(!hasWorkToDo() &&
"Expected to be flushed"); }
131 bool hasWorkToDo()
const {
return !Worklist.
empty(); }
136 MCs.
push_back(MappingContext(VM, Materializer));
137 return MCs.
size() - 1;
149 return cast_or_null<Constant>(mapValue(C));
166 void scheduleRemapFunction(
Function &
F,
unsigned MCID);
195 bool HasChanged =
false;
197 TempMDNode Placeholder;
201 struct UniquedGraph {
209 void propagateChanges();
223 MDNodeMapper(Mapper &M) : M(M) {}
303 bool createPOT(UniquedGraph &
G,
const MDNode &FirstN);
325 void mapNodesInPOT(UniquedGraph &
G);
333 template <
class OperandMapper>
334 void remapOperands(
MDNode &
N, OperandMapper mapOperand);
343 if (I != getVM().
end()) {
349 if (
auto *Materializer = getMaterializer()) {
350 if (
Value *NewV = Materializer->materialize(const_cast<Value *>(V))) {
358 if (isa<GlobalValue>(V)) {
361 return getVM()[V] =
const_cast<Value *
>(V);
364 if (
const InlineAsm *IA = dyn_cast<InlineAsm>(V)) {
368 NewTy = cast<FunctionType>(TypeMapper->
remapType(NewTy));
370 if (NewTy != IA->getFunctionType())
371 V =
InlineAsm::get(NewTy, IA->getAsmString(), IA->getConstraintString(),
372 IA->hasSideEffects(), IA->isAlignStack());
375 return getVM()[V] =
const_cast<Value *
>(V);
378 if (
const auto *MDV = dyn_cast<MetadataAsValue>(V)) {
379 const Metadata *MD = MDV->getMetadata();
381 if (
auto *LAM = dyn_cast<LocalAsMetadata>(MD)) {
383 if (
Value *LV = mapValue(LAM->getValue())) {
384 if (V == LAM->getValue())
385 return const_cast<Value *>(V);
400 return getVM()[V] =
const_cast<Value *
>(V);
403 auto *MappedMD = mapMetadata(MD);
405 return getVM()[V] =
const_cast<Value *
>(V);
416 return mapBlockAddress(*BA);
418 auto mapValueOrNull = [
this](
Value *V) {
419 auto Mapped = mapValue(V);
421 "Unexpected null mapping for constant operand without " 422 "NullMapMissingGlobalValues flag");
428 unsigned OpNo = 0, NumOperands = C->getNumOperands();
429 Value *Mapped =
nullptr;
430 for (; OpNo != NumOperands; ++OpNo) {
431 Value *
Op = C->getOperand(OpNo);
432 Mapped = mapValueOrNull(Op);
440 Type *NewTy = C->getType();
446 if (OpNo == NumOperands && NewTy == C->getType())
447 return getVM()[V] =
C;
453 for (
unsigned j = 0; j != OpNo; ++j)
454 Ops.
push_back(cast<Constant>(C->getOperand(j)));
457 if (OpNo != NumOperands) {
461 for (++OpNo; OpNo != NumOperands; ++OpNo) {
462 Mapped = mapValueOrNull(C->getOperand(OpNo));
468 Type *NewSrcTy =
nullptr;
470 if (
auto *GEPO = dyn_cast<GEPOperator>(C))
471 NewSrcTy = TypeMapper->
remapType(GEPO->getSourceElementType());
474 return getVM()[V] =
CE->getWithOperands(Ops, NewTy,
false, NewSrcTy);
475 if (isa<ConstantArray>(C))
477 if (isa<ConstantStruct>(C))
479 if (isa<ConstantVector>(C))
482 if (isa<UndefValue>(C))
484 if (isa<ConstantAggregateZero>(C))
486 assert(isa<ConstantPointerNull>(C));
498 DelayedBBs.
push_back(DelayedBasicBlock(BA));
499 BB = DelayedBBs.
back().TempBB.get();
508 getVM().MD()[
Key].reset(Val);
513 return mapToMetadata(MD, const_cast<Metadata *>(MD));
522 if (
auto *CMD = dyn_cast<ConstantAsMetadata>(Op))
523 assert((!*MappedOp ||
M.getVM().count(CMD->getValue()) ||
524 M.getVM().getMappedMD(Op)) &&
525 "Expected Value to be memoized");
527 assert((isa<MDString>(Op) ||
M.getVM().getMappedMD(Op)) &&
528 "Expected result to be memoized");
535 return mapDistinctNode(N);
543 if (CT && CT->getContext().isODRUniquingDebugTypes() &&
544 CT->getIdentifier() !=
"")
545 return const_cast<DICompositeType *>(CT);
549 MDNode *MDNodeMapper::mapDistinctNode(
const MDNode &N) {
551 assert(!M.getVM().getMappedMD(&N) &&
"Expected an unmapped node");
552 DistinctWorklist.push_back(
556 return DistinctWorklist.back();
562 return const_cast<ConstantAsMetadata *>(&CMD);
573 if (isa<MDString>(Op))
574 return const_cast<Metadata *>(Op);
576 if (
auto *CMD = dyn_cast<ConstantAsMetadata>(Op))
582 Metadata &MDNodeMapper::UniquedGraph::getFwdReference(
MDNode &Op) {
583 auto Where =
Info.find(&Op);
584 assert(Where !=
Info.end() &&
"Expected a valid reference");
586 auto &OpD = Where->second;
591 if (!OpD.Placeholder)
592 OpD.Placeholder = Op.
clone();
594 return *OpD.Placeholder;
597 template <
class OperandMapper>
598 void MDNodeMapper::remapOperands(
MDNode &N, OperandMapper mapOperand) {
612 struct POTWorklistEntry {
618 bool HasChanged =
false;
625 bool MDNodeMapper::createPOT(UniquedGraph &
G,
const MDNode &FirstN) {
626 assert(G.Info.empty() &&
"Expected a fresh traversal");
630 bool AnyChanges =
false;
632 Worklist.
push_back(POTWorklistEntry(const_cast<MDNode &>(FirstN)));
633 (void)G.Info[&FirstN];
634 while (!Worklist.
empty()) {
636 auto &WE = Worklist.
back();
637 if (
MDNode *N = visitOperands(G, WE.Op, WE.N->op_end(), WE.HasChanged)) {
639 Worklist.
push_back(POTWorklistEntry(*N));
644 assert(WE.N->isUniqued() &&
"Expected only uniqued nodes");
645 assert(WE.Op == WE.N->op_end() &&
"Expected to visit all operands");
646 auto &
D = G.Info[WE.N];
647 AnyChanges |= D.HasChanged = WE.HasChanged;
649 G.POT.push_back(WE.N);
663 HasChanged |= Op != *MappedOp;
670 "Only uniqued operands cannot be mapped immediately");
671 if (G.Info.insert(std::make_pair(&OpN,
Data())).second)
677 void MDNodeMapper::UniquedGraph::propagateChanges() {
687 auto Where =
Info.find(Op);
688 return Where !=
Info.end() && Where->second.HasChanged;
692 AnyChanges =
D.HasChanged =
true;
694 }
while (AnyChanges);
697 void MDNodeMapper::mapNodesInPOT(UniquedGraph &G) {
700 for (
auto *N : G.POT) {
709 bool HadPlaceholder(
D.Placeholder);
712 TempMDNode ClonedN =
D.Placeholder ? std::move(
D.Placeholder) : N->
clone();
713 remapOperands(*ClonedN, [
this, &
D, &G](
Metadata *Old) {
717 assert(G.Info[Old].ID >
D.ID &&
"Expected a forward reference");
718 return &G.getFwdReference(*cast<MDNode>(Old));
722 M.mapToMetadata(N, NewN);
731 for (
auto *N : CyclicNodes)
737 assert(DistinctWorklist.empty() &&
"MDNodeMapper::map is not recursive");
738 assert(!(M.Flags & RF_NoModuleLevelChanges) &&
739 "MDNodeMapper::map assumes module-level changes");
745 N.
isUniqued() ? mapTopLevelUniquedNode(N) : mapDistinctNode(N);
746 while (!DistinctWorklist.empty())
747 remapOperands(*DistinctWorklist.pop_back_val(), [
this](
Metadata *Old) {
750 return mapTopLevelUniquedNode(*cast<MDNode>(Old));
755 Metadata *MDNodeMapper::mapTopLevelUniquedNode(
const MDNode &FirstN) {
760 if (!createPOT(G, FirstN)) {
762 for (
const MDNode *N : G.POT)
764 return &
const_cast<MDNode &
>(FirstN);
768 G.propagateChanges();
782 if (isa<MDString>(MD))
787 if ((Flags & RF_NoModuleLevelChanges))
788 return const_cast<Metadata *>(MD);
790 if (
auto *CMD = dyn_cast<ConstantAsMetadata>(MD)) {
798 assert(isa<MDNode>(MD) &&
"Expected a metadata node");
804 assert(MD &&
"Expected valid metadata");
805 assert(!isa<LocalAsMetadata>(MD) &&
"Unexpected local metadata");
810 return MDNodeMapper(*this).map(*cast<MDNode>(MD));
813 void Mapper::flush() {
815 while (!Worklist.
empty()) {
817 CurrentMCID = E.MCID;
819 case WorklistEntry::MapGlobalInit:
820 E.Data.GVInit.GV->setInitializer(mapConstant(E.Data.GVInit.Init));
821 remapGlobalObjectMetadata(*E.Data.GVInit.GV);
823 case WorklistEntry::MapAppendingVar: {
824 unsigned PrefixSize = AppendingInits.
size() - E.AppendingGVNumNewMembers;
825 mapAppendingVariable(*E.Data.AppendingGV.GV,
826 E.Data.AppendingGV.InitPrefix,
827 E.AppendingGVIsOldCtorDtor,
829 AppendingInits.
resize(PrefixSize);
832 case WorklistEntry::MapGlobalIndirectSymbol:
833 E.Data.GlobalIndirectSymbol.GIS->setIndirectSymbol(
834 mapConstant(E.Data.GlobalIndirectSymbol.Target));
837 remapFunction(*E.Data.RemapF);
845 while (!DelayedBBs.
empty()) {
847 BasicBlock *BB = cast_or_null<BasicBlock>(mapValue(DBB.OldBB));
848 DBB.TempBB->replaceAllUsesWith(BB ? BB : DBB.OldBB);
855 Value *V = mapValue(Op);
860 assert((Flags & RF_IgnoreMissingLocals) &&
861 "Referenced value not in value map!");
865 if (
PHINode *PN = dyn_cast<PHINode>(I)) {
866 for (
unsigned i = 0,
e = PN->getNumIncomingValues(); i !=
e; ++i) {
867 Value *V = mapValue(PN->getIncomingBlock(i));
870 PN->setIncomingBlock(i, cast<BasicBlock>(V));
872 assert((Flags & RF_IgnoreMissingLocals) &&
873 "Referenced block not in value map!");
880 for (
const auto &
MI : MDs) {
882 MDNode *New = cast_or_null<MDNode>(mapMetadata(Old));
913 CS.setAttributes(Attrs);
916 if (
auto *AI = dyn_cast<AllocaInst>(I))
917 AI->setAllocatedType(TypeMapper->
remapType(AI->getAllocatedType()));
918 if (
auto *
GEP = dyn_cast<GetElementPtrInst>(I)) {
919 GEP->setSourceElementType(
921 GEP->setResultElementType(
927 void Mapper::remapGlobalObjectMetadata(
GlobalObject &GO) {
931 for (
const auto &I : MDs)
932 GO.
addMetadata(I.first, *cast<MDNode>(mapMetadata(I.second)));
935 void Mapper::remapFunction(
Function &F) {
942 remapGlobalObjectMetadata(F);
947 A.mutateType(TypeMapper->
remapType(A.getType()));
960 unsigned NumElements =
961 cast<ArrayType>(InitPrefix->
getType())->getNumElements();
962 for (
unsigned I = 0; I != NumElements; ++
I)
973 Type *Tys[3] = {
ST.getElementType(0),
ST.getElementType(1), VoidPtrTy};
977 for (
auto *V : NewMembers) {
980 auto *S = cast<ConstantStruct>(V);
981 auto *E1 = cast<Constant>(mapValue(S->getOperand(0)));
982 auto *E2 = cast<Constant>(mapValue(S->getOperand(1)));
986 NewV = cast_or_null<Constant>(mapValue(V));
997 assert(AlreadyScheduled.
insert(&GV).second &&
"Should not reschedule");
998 assert(MCID < MCs.
size() &&
"Invalid mapping context");
1001 WE.Kind = WorklistEntry::MapGlobalInit;
1003 WE.Data.GVInit.GV = &GV;
1004 WE.Data.GVInit.Init = &Init;
1013 assert(AlreadyScheduled.
insert(&GV).second &&
"Should not reschedule");
1014 assert(MCID < MCs.
size() &&
"Invalid mapping context");
1017 WE.Kind = WorklistEntry::MapAppendingVar;
1019 WE.Data.AppendingGV.GV = &GV;
1020 WE.Data.AppendingGV.InitPrefix = InitPrefix;
1021 WE.AppendingGVIsOldCtorDtor = IsOldCtorDtor;
1022 WE.AppendingGVNumNewMembers = NewMembers.
size();
1029 assert(AlreadyScheduled.
insert(&GIS).second &&
"Should not reschedule");
1030 assert(MCID < MCs.
size() &&
"Invalid mapping context");
1033 WE.Kind = WorklistEntry::MapGlobalIndirectSymbol;
1035 WE.Data.GlobalIndirectSymbol.GIS = &GIS;
1040 void Mapper::scheduleRemapFunction(
Function &F,
unsigned MCID) {
1041 assert(AlreadyScheduled.
insert(&F).second &&
"Should not reschedule");
1042 assert(MCID < MCs.
size() &&
"Invalid mapping context");
1047 WE.Data.RemapF = &
F;
1052 assert(!hasWorkToDo() &&
"Expected to have flushed the worklist");
1053 this->Flags = this->Flags | Flags;
1057 return reinterpret_cast<Mapper *
>(pImpl);
1062 class FlushingMapper {
1066 explicit FlushingMapper(
void *pImpl) : M(*
getAsMapper(pImpl)) {
1067 assert(!M.hasWorkToDo() &&
"Expected to be flushed");
1070 ~FlushingMapper() { M.flush(); }
1072 Mapper *operator->()
const {
return &M; }
1080 : pImpl(new Mapper(VM, Flags, TypeMapper, Materializer)) {}
1087 return getAsMapper(pImpl)->registerAlternateMappingContext(VM, Materializer);
1091 FlushingMapper(pImpl)->addFlags(Flags);
1095 return FlushingMapper(pImpl)->mapValue(&V);
1099 return cast_or_null<Constant>(
mapValue(C));
1103 return FlushingMapper(pImpl)->mapMetadata(&MD);
1111 FlushingMapper(pImpl)->remapInstruction(&I);
1115 FlushingMapper(pImpl)->remapFunction(F);
1121 getAsMapper(pImpl)->scheduleMapGlobalInitializer(GV, Init, MCID);
1130 GV, InitPrefix, IsOldCtorDtor, NewMembers, MCID);
1136 getAsMapper(pImpl)->scheduleMapGlobalIndirectSymbol(GIS, Target, MCID);
1140 getAsMapper(pImpl)->scheduleRemapFunction(F, MCID);
const T & front() const
front - Get the first element.
static unsigned getMappedOp(unsigned PseudoOp)
const_iterator end(StringRef path)
Get end iterator over path.
Tracking metadata reference owned by Metadata.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata *> MDs)
This class represents an incoming formal argument to a Function.
This class represents lattice values for constants.
void replaceOperandWith(unsigned I, Metadata *New)
Replace a specific operand.
void RemapFunction(Function &F, ValueToValueMapTy &VM, RemapFlags Flags=RF_None, ValueMapTypeRemapper *TypeMapper=nullptr, ValueMaterializer *Materializer=nullptr)
Remap the operands, metadata, arguments, and instructions of a function.
Implements a dense probed hash-table based set.
void push_back(const T &Elt)
Any global values not in value map are mapped to null instead of mapping to self. ...
static ConstantAggregateZero * get(Type *Ty)
LLVMContext & getContext() const
All values hold a context through their type.
void scheduleRemapFunction(Function &F, unsigned MappingContextID=0)
const MDOperand & getOperand(unsigned I) const
void getAllMetadata(SmallVectorImpl< std::pair< unsigned, MDNode *>> &MDs) const
Appends all attachments for the global to MDs, sorting by attachment ID.
void reserve(size_type N)
static Mapper * getAsMapper(void *pImpl)
bool hasAttribute(unsigned Index, Attribute::AttrKind Kind) const
Return true if the attribute exists at the given index.
static Constant * get(ArrayType *T, ArrayRef< Constant *> V)
TempMDNode clone() const
Create a (temporary) clone of this.
static Constant * getNullValue(Type *Ty)
Constructor to create a '0' constant of arbitrary type.
static std::enable_if< std::is_base_of< MDNode, T >::value, T * >::type replaceWithDistinct(std::unique_ptr< T, TempMDNodeDeleter > N)
Replace a temporary node with a distinct one.
Function * getFunction() const
The address of a basic block.
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
void setInitializer(Constant *InitVal)
setInitializer - Sets the initializer for this global variable, removing any existing initializer if ...
bool isResolved() const
Check if node is fully resolved.
void remapInstruction(Instruction &I)
A Use represents the edge between a Value definition and its users.
Constant * mapConstant(const Constant &C)
bool none_of(R &&Range, UnaryPredicate P)
Provide wrappers to std::none_of which take ranges instead of having to pass begin/end explicitly...
Windows NT (Windows on ARM)
static StructType * get(LLVMContext &Context, ArrayRef< Type *> Elements, bool isPacked=false)
This static method is the primary way to create a literal StructType.
void resolveCycles()
Resolve cycles.
op_iterator op_begin() const
A constant value that is initialized with an expression using other constant values.
Class to represent function types.
Metadata * mapMetadata(const Metadata &MD)
Instruct the remapper to move distinct metadata instead of duplicating it when there are module-level...
Type * getType() const
All values are typed, get the type of this value.
op_range operands() const
Type * getValueAsType() const
Return the attribute's value as a Type.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
BasicBlock * getBasicBlock() const
constexpr char Attrs[]
Key for Kernel::Metadata::mAttrs.
If this flag is set, the remapper knows that only local values within a function (such as an instruct...
Analysis containing CSE Info
Class to represent pointers.
void remapInstruction(Instruction *I, ValueToValueMapTy &VMap)
Convert the instruction operands from referencing the current values into those specified by VMap...
Constant * getAggregateElement(unsigned Elt) const
For aggregates (struct/array/vector) return the constant that corresponds to the specified element if...
static Metadata * cloneOrBuildODR(const MDNode &N)
This is a class that can be implemented by clients to materialize Values on demand.
static std::enable_if< std::is_base_of< MDNode, T >::value, T * >::type replaceWithUniqued(std::unique_ptr< T, TempMDNodeDeleter > N)
Replace a temporary node with a uniqued one.
static ConstantPointerNull * get(PointerType *T)
Static factory methods - Return objects of the specified value.
LLVM Basic Block Representation.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important class for using LLVM in a threaded context.
static ConstantAsMetadata * wrapConstantAsMetadata(const ConstantAsMetadata &CMD, Value *MappedV)
static BlockAddress * get(Function *F, BasicBlock *BB)
Return a BlockAddress for the specified function and basic block.
size_t size() const
size - Get the array size.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This is an important base class in LLVM.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
std::pair< iterator, bool > insert(const ValueT &V)
unsigned getNumParams() const
Return the number of fixed parameters this function type requires.
ArrayRef< Type * > params() const
void scheduleMapGlobalInitializer(GlobalVariable &GV, Constant &Init, unsigned MappingContextID=0)
static FunctionType * get(Type *Result, ArrayRef< Type *> Params, bool isVarArg)
This static method is the primary way of constructing a FunctionType.
static Constant * get(StructType *T, ArrayRef< Constant *> V)
static Attribute getWithByValType(LLVMContext &Context, Type *Ty)
static UndefValue * get(Type *T)
Static factory methods - Return an 'undef' object of the specified type.
RemapFlags
These are flags that the value mapping APIs allow.
Attribute getAttribute(unsigned Index, Attribute::AttrKind Kind) const
Return the attribute object that exists at the given index.
void setMetadata(unsigned KindID, MDNode *Node)
Set the metadata of the specified kind to the specified node.
Align max(MaybeAlign Lhs, Align Rhs)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
void addMetadata(unsigned KindID, MDNode &MD)
Add a metadata attachment.
LLVM_NODISCARD T pop_back_val()
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
void remapFunction(Function &F)
void getAllMetadata(SmallVectorImpl< std::pair< unsigned, MDNode *>> &MDs) const
Get all metadata attached to this Instruction.
Target - Wrapper for Target specific information.
unsigned getNumAttrSets() const
ValueMapper(ValueToValueMapTy &VM, RemapFlags Flags=RF_None, ValueMapTypeRemapper *TypeMapper=nullptr, ValueMaterializer *Materializer=nullptr)
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
This is a class that can be implemented by clients to remap types when cloning constants and instruct...
If this flag is set, the remapper ignores missing function-local entries (Argument, Instruction, BasicBlock) that are not in the value map.
LLVM_NODISCARD AttributeList addAttribute(LLVMContext &C, unsigned Index, Attribute::AttrKind Kind) const
Add an attribute to the attribute set at the given index.
LLVM_NODISCARD bool empty() const
LLVM_NODISCARD AttributeList removeAttribute(LLVMContext &C, unsigned Index, Attribute::AttrKind Kind) const
Remove the specified attribute at the specified index from this attribute list.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
void addFlags(RemapFlags Flags)
Add to the current RemapFlags.
static InlineAsm * get(FunctionType *Ty, StringRef AsmString, StringRef Constraints, bool hasSideEffects, bool isAlignStack=false, AsmDialect asmDialect=AD_ATT)
InlineAsm::get - Return the specified uniqued inline asm string.
void mutateType(Type *Ty)
Mutate the type of this Value to be of the specified type.
Value * mapValue(const Value &V)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
GlobalIndirectSymbol(Type *Ty, ValueTy VTy, unsigned AddressSpace, LinkageTypes Linkage, const Twine &Name, Constant *Symbol)
unsigned registerAlternateMappingContext(ValueToValueMapTy &VM, ValueMaterializer *Materializer=nullptr)
Register an alternate mapping context.
void scheduleMapAppendingVariable(GlobalVariable &GV, Constant *InitPrefix, bool IsOldCtorDtor, ArrayRef< Constant *> NewMembers, unsigned MappingContextID=0)
virtual Type * remapType(Type *SrcTy)=0
The client should implement this method if they want to remap types while mapping values...
unsigned getNumOperands() const
Return number of MDNode operands.
static IntegerType * getInt8Ty(LLVMContext &C)
void scheduleMapGlobalIndirectSymbol(GlobalIndirectSymbol &GIS, Constant &Target, unsigned MappingContextID=0)
static Constant * get(ArrayRef< Constant *> V)
Type * getElementType() const
PointerType * getType() const
Global values are always pointers.
iterator_range< arg_iterator > args()
MDNode * mapMDNode(const MDNode &N)