LLVM: lib/IR/DIBuilder.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
22#include
23
24using namespace llvm;
26
28 : M(m), VMContext(M.getContext()), CUNode(CU), DeclareFn(nullptr),
29 ValueFn(nullptr), LabelFn(nullptr), AssignFn(nullptr),
30 AllowUnresolvedNodes(AllowUnresolvedNodes) {
31 if (CUNode) {
33 AllEnumTypes.assign(ETs.begin(), ETs.end());
35 AllRetainTypes.assign(RTs.begin(), RTs.end());
37 AllGVs.assign(GVs.begin(), GVs.end());
39 ImportedModules.assign(IMs.begin(), IMs.end());
40 if (const auto &MNs = CUNode->getMacros())
41 AllMacrosPerParent.insert({nullptr, {MNs.begin(), MNs.end()}});
42 }
43}
44
45void DIBuilder::trackIfUnresolved(MDNode *N) {
46 if ()
47 return;
48 if (N->isResolved())
49 return;
50
51 assert(AllowUnresolvedNodes && "Cannot handle unresolved nodes");
52 UnresolvedNodes.emplace_back(N);
53}
54
56 auto PN = SubprogramTrackedNodes.find(SP);
57 if (PN != SubprogramTrackedNodes.end())
58 SP->replaceRetainedNodes(
60 PN->second.end())));
61}
62
64 if (!CUNode) {
65 assert(!AllowUnresolvedNodes &&
66 "creating type nodes without a CU is not supported");
67 return;
68 }
69
70 if (!AllEnumTypes.empty())
73 AllEnumTypes.end())));
74
76
77
78
79
82 if (RetainSet.insert(N).second)
84
85 if (!RetainValues.empty())
87
88 for (auto *SP : AllSubprograms)
90 for (auto *N : RetainValues)
91 if (auto *SP = dyn_cast(N))
93
94 if (!AllGVs.empty())
96
97 if (!ImportedModules.empty())
100 ImportedModules.end())));
101
102 for (const auto &I : AllMacrosPerParent) {
103
104 if (.first) {
106 continue;
107 }
108
109 auto *TMF = cast(I.first);
111 TMF->getLine(), TMF->getFile(),
114 }
115
116
117
118 for (const auto &N : UnresolvedNodes)
119 if (N && ->isResolved())
120 N->resolveCycles();
121 UnresolvedNodes.clear();
122
123
124 AllowUnresolvedNodes = false;
125}
126
127
129 if ( || isa(N))
130 return nullptr;
131 return cast(N);
132}
133
135 unsigned Lang, DIFile *File, StringRef Producer, bool isOptimized,
138 bool SplitDebugInlining, bool DebugInfoForProfiling,
141
142 assert(((Lang <= dwarf::DW_LANG_Metal && Lang >= dwarf::DW_LANG_C89) ||
144 "Invalid Language tag");
145
146 assert(!CUNode && "Can only make one compile unit per DIBuilder instance");
148 VMContext, Lang, File, Producer, isOptimized, Flags, RunTimeVer,
149 SplitName, Kind, nullptr, nullptr, nullptr, nullptr, nullptr, DWOId,
150 SplitDebugInlining, DebugInfoForProfiling, NameTableKind,
151 RangesBaseAddress, SysRoot, SDK);
152
153
156 trackIfUnresolved(CUNode);
157 return CUNode;
158}
159
163 DINodeArray Elements,
165 if (Line)
166 assert(File && "Source location has line number but no file");
167 unsigned EntitiesCount = C.pImpl->DIImportedEntitys.size();
169 File, Line, Name, Elements);
170 if (EntitiesCount < C.pImpl->DIImportedEntitys.size())
171
172
174 return M;
175}
176
179 unsigned Line,
180 DINodeArray Elements) {
181 return ::createImportedModule(VMContext, dwarf::DW_TAG_imported_module,
182 Context, NS, File, Line, StringRef(), Elements,
183 getImportTrackingVector(Context));
184}
185
188 DIFile *File, unsigned Line,
189 DINodeArray Elements) {
190 return ::createImportedModule(VMContext, dwarf::DW_TAG_imported_module,
191 Context, NS, File, Line, StringRef(), Elements,
192 getImportTrackingVector(Context));
193}
194
196 DIFile *File, unsigned Line,
197 DINodeArray Elements) {
198 return ::createImportedModule(VMContext, dwarf::DW_TAG_imported_module,
199 Context, M, File, Line, StringRef(), Elements,
200 getImportTrackingVector(Context));
201}
202
205 DIFile *File, unsigned Line,
207
208
209 return ::createImportedModule(VMContext, dwarf::DW_TAG_imported_declaration,
210 Context, Decl, File, Line, Name, Elements,
211 getImportTrackingVector(Context));
212}
213
216 std::optional Source) {
217 return DIFile::get(VMContext, Filename, Directory, CS, Source);
218}
219
223 assert(.empty() && "Unable to create macro without name");
226 "Unexpected macro type");
228 AllMacrosPerParent[Parent].insert(M);
229 return M;
230}
231
233 unsigned LineNumber, DIFile *File) {
235 LineNumber, File, DIMacroNodeArray())
236 .release();
237 AllMacrosPerParent[Parent].insert(MF);
238
239
240
241 AllMacrosPerParent.insert({MF, {}});
242 return MF;
243}
244
246 bool IsUnsigned) {
247 assert(.empty() && "Unable to create enumerator without name");
250}
251
253 assert(.empty() && "Unable to create enumerator without name");
255}
256
258 assert(.empty() && "Unable to create type without name");
260}
261
264}
265
267 unsigned Encoding,
269 uint32_t NumExtraInhabitants) {
270 assert(.empty() && "Unable to create type without name");
271 return DIBasicType::get(VMContext, dwarf::DW_TAG_base_type, Name, SizeInBits,
272 0, Encoding, NumExtraInhabitants, Flags);
273}
274
276 assert(.empty() && "Unable to create type without name");
278 SizeInBits, 0);
279}
280
284 assert(.empty() && "Unable to create type without name");
286 StringLength, nullptr, StrLocationExp, 0, 0, 0);
287}
288
292 assert(.empty() && "Unable to create type without name");
294 StringLengthExp, StrLocationExp, 0, 0, 0);
295}
296
299 0, 0, std::nullopt, std::nullopt, DINode::FlagZero);
300}
301
303 DIType *FromTy, unsigned Key, bool IsAddressDiscriminated,
304 unsigned ExtraDiscriminator, bool IsaPointer,
305 bool AuthenticatesNullValues) {
306 return DIDerivedType::get(VMContext, dwarf::DW_TAG_LLVM_ptrauth_type, "",
307 nullptr, 0, nullptr, FromTy, 0, 0, 0, std::nullopt,
308 std::optionalDIDerivedType::PtrAuthData(
309 std::in_place, Key, IsAddressDiscriminated,
310 ExtraDiscriminator, IsaPointer,
311 AuthenticatesNullValues),
312 DINode::FlagZero);
313}
314
318 std::optional DWARFAddressSpace,
320
322 nullptr, 0, nullptr, PointeeTy, SizeInBits,
323 AlignInBits, 0, DWARFAddressSpace, std::nullopt,
325}
326
332 return DIDerivedType::get(VMContext, dwarf::DW_TAG_ptr_to_member_type, "",
333 nullptr, 0, nullptr, PointeeTy, SizeInBits,
334 AlignInBits, 0, std::nullopt, std::nullopt, Flags,
336}
337
341 std::optional DWARFAddressSpace) {
342 assert(RTy && "Unable to create reference type");
344 SizeInBits, AlignInBits, 0, DWARFAddressSpace, {},
345 DINode::FlagZero);
346}
347
349 DIFile *File, unsigned LineNo,
355 AlignInBits, 0, std::nullopt, std::nullopt, Flags,
357}
358
361 unsigned LineNo, DIScope *Context,
362 DINodeArray TParams, uint32_t AlignInBits,
366 AlignInBits, 0, std::nullopt, std::nullopt, Flags,
368}
369
371 assert(Ty && "Invalid type!");
372 assert(FriendTy && "Invalid friend type!");
373 return DIDerivedType::get(VMContext, dwarf::DW_TAG_friend, "", nullptr, 0, Ty,
374 FriendTy, 0, 0, 0, std::nullopt, std::nullopt,
375 DINode::FlagZero);
376}
377
382 assert(Ty && "Unable to create inheritance");
384 ConstantInt::get(IntegerType::get(VMContext, 32), VBPtrOffset));
385 return DIDerivedType::get(VMContext, dwarf::DW_TAG_inheritance, "", nullptr,
386 0, Ty, BaseTy, 0, 0, BaseOffset, std::nullopt,
387 std::nullopt, Flags, ExtraData);
388}
389
396 SizeInBits, AlignInBits, OffsetInBits, std::nullopt,
397 std::nullopt, Flags, nullptr, Annotations);
398}
399
401 if (C)
403 return nullptr;
404}
405
411 VMContext, dwarf::DW_TAG_member, Name, File, LineNumber,
413 std::nullopt, std::nullopt, Flags, getConstantOrNull(Discriminant));
414}
415
420 Flags |= DINode::FlagBitField;
422 VMContext, dwarf::DW_TAG_member, Name, File, LineNumber,
424 OffsetInBits, std::nullopt, std::nullopt, Flags,
426 StorageOffsetInBits)),
428}
429
432 unsigned LineNumber, DIType *Ty,
435 Flags |= DINode::FlagStaticMember;
438 0, std::nullopt, std::nullopt, Flags,
440}
441
449 SizeInBits, AlignInBits, OffsetInBits, std::nullopt,
450 std::nullopt, Flags, PropertyNode);
451}
452
456 unsigned PropertyAttributes, DIType *Ty) {
458 SetterName, PropertyAttributes, Ty);
459}
460
463 DIType *Ty, bool isDefault) {
464 assert((!Context || isa(Context)) && "Expected compile unit");
466}
467
471 bool IsDefault, Metadata *MD) {
472 assert((!Context || isa(Context)) && "Expected compile unit");
474}
475
478 DIType *Ty, bool isDefault,
481 VMContext, dwarf::DW_TAG_template_value_parameter, Context, Name, Ty,
483}
484
488 bool IsDefault) {
490 VMContext, dwarf::DW_TAG_GNU_template_template_param, Context, Name, Ty,
492}
493
496 DIType *Ty, DINodeArray Val) {
498 VMContext, dwarf::DW_TAG_GNU_template_parameter_pack, Context, Name, Ty,
499 false, Val.get());
500}
501
506 unsigned RunTimeLang, DIType *VTableHolder, MDNode *TemplateParams,
508 assert((!Context || isa(Context)) &&
509 "createClassType should be called with a valid Context");
510
512 VMContext, dwarf::DW_TAG_class_type, Name, File, LineNumber,
514 OffsetInBits, Flags, Elements, RunTimeLang, VTableHolder,
515 cast_or_null(TemplateParams), UniqueIdentifier);
516 trackIfUnresolved(R);
517 return R;
518}
519
523 DIType *DerivedFrom, DINodeArray Elements, unsigned RunTimeLang,
525 uint32_t NumExtraInhabitants) {
527 VMContext, dwarf::DW_TAG_structure_type, Name, File, LineNumber,
529 Flags, Elements, RunTimeLang, VTableHolder, nullptr, UniqueIdentifier,
530 nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, Specification,
531 NumExtraInhabitants);
532 trackIfUnresolved(R);
533 return R;
534}
535
539 DINodeArray Elements, unsigned RunTimeLang, StringRef UniqueIdentifier) {
541 VMContext, dwarf::DW_TAG_union_type, Name, File, LineNumber,
543 Elements, RunTimeLang, nullptr, nullptr, UniqueIdentifier);
544 trackIfUnresolved(R);
545 return R;
546}
547
550 unsigned LineNumber, uint64_t SizeInBits,
552 DIDerivedType *Discriminator, DINodeArray Elements,
555 VMContext, dwarf::DW_TAG_variant_part, Name, File, LineNumber,
557 Elements, 0, nullptr, nullptr, UniqueIdentifier, Discriminator);
558 trackIfUnresolved(R);
559 return R;
560}
561
564 unsigned CC) {
566}
567
570 unsigned LineNumber, uint64_t SizeInBits,
571 uint32_t AlignInBits, DINodeArray Elements,
572 DIType *UnderlyingType, unsigned RunTimeLang,
573 StringRef UniqueIdentifier, bool IsScoped) {
575 VMContext, dwarf::DW_TAG_enumeration_type, Name, File, LineNumber,
577 IsScoped ? DINode::FlagEnumClass : DINode::FlagZero, Elements,
578 RunTimeLang, nullptr, nullptr, UniqueIdentifier);
579 AllEnumTypes.emplace_back(CTy);
580 trackIfUnresolved(CTy);
581 return CTy;
582}
583
585 DIFile *File, unsigned LineNo,
590 SizeInBits, AlignInBits, 0, std::nullopt,
591 std::nullopt, DINode::FlagZero);
592 trackIfUnresolved(R);
593 return R;
594}
595
598 DINodeArray Subscripts,
604 VMContext, dwarf::DW_TAG_array_type, "", nullptr, 0, nullptr, Ty, Size,
605 AlignInBits, 0, DINode::FlagZero, Subscripts, 0, nullptr, nullptr, "",
606 nullptr,
607 isa<DIExpression *>(DL) ? (Metadata *)cast<DIExpression *>(DL)
608 : (Metadata *)cast<DIVariable *>(DL),
609 isa<DIExpression *>(AS) ? (Metadata *)cast<DIExpression *>(AS)
610 : (Metadata *)cast<DIVariable *>(AS),
611 isa<DIExpression *>(AL) ? (Metadata *)cast<DIExpression *>(AL)
612 : (Metadata *)cast<DIVariable *>(AL),
613 isa<DIExpression *>(RK) ? (Metadata *)cast<DIExpression *>(RK)
614 : (Metadata *)cast<DIVariable *>(RK));
615 trackIfUnresolved(R);
616 return R;
617}
618
621 DINodeArray Subscripts) {
623 nullptr, 0, nullptr, Ty, Size, AlignInBits, 0,
624 DINode::FlagVector, Subscripts, 0, nullptr);
625 trackIfUnresolved(R);
626 return R;
627}
628
630 auto NewSP = SP->cloneWithFlags(SP->getFlags() | DINode::FlagArtificial);
632}
633
638}
639
641
643 return Ty;
645}
646
648
650 return Ty;
652
653 if (Implicit)
654 Flags |= DINode::FlagArtificial;
655
657}
658
660 assert(T && "Expected non-null type");
661 assert((isa(T) || (isa(T) &&
662 cast(T)->isDefinition() == false)) &&
663 "Expected type or subprogram declaration");
664 AllRetainTypes.emplace_back(T);
665}
666
668
671 DIFile *F, unsigned Line, unsigned RuntimeLang,
674
675
678 SizeInBits, AlignInBits, 0, DINode::FlagFwdDecl, nullptr, RuntimeLang,
679 nullptr, nullptr, UniqueIdentifier);
680 trackIfUnresolved(RetTy);
682}
683
686 unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
692 SizeInBits, AlignInBits, 0, Flags, nullptr, RuntimeLang, nullptr,
693 nullptr, UniqueIdentifier, nullptr, nullptr, nullptr, nullptr,
695 .release();
696 trackIfUnresolved(RetTy);
698}
699
702}
703
704DIMacroNodeArray
707}
708
711 for (Metadata *E : Elements) {
712 if (isa_and_nonnull(E))
714 else
716 }
718}
719
725 return DISubrange::get(VMContext, CountNode, LB, nullptr, nullptr);
726}
727
731 return DISubrange::get(VMContext, CountNode, LB, nullptr, nullptr);
732}
733
736 return DISubrange::get(VMContext, CountNode, LB, UB, Stride);
737}
738
743 return isa<DIExpression *>(Bound) ? (Metadata *)cast<DIExpression *>(Bound)
744 : (Metadata *)cast<DIVariable *>(Bound);
745 };
747 ConvToMetadata(LB), ConvToMetadata(UB),
748 ConvToMetadata(Stride));
749}
750
752#ifndef NDEBUG
753 if (auto *CT =
755 assert(CT->getIdentifier().empty() &&
756 "Context of a global variable should not be a type with identifier");
757#endif
758}
759
762 unsigned LineNumber, DIType *Ty, bool IsLocalToUnit, bool isDefined,
766
768 VMContext, cast_or_null(Context), Name, LinkageName, F,
769 LineNumber, Ty, IsLocalToUnit, isDefined,
770 cast_or_null(Decl), TemplateParams, AlignInBits,
772 if (!Expr)
775 AllGVs.push_back(N);
776 return N;
777}
778
781 unsigned LineNumber, DIType *Ty, bool IsLocalToUnit, MDNode *Decl,
784
786 VMContext, cast_or_null(Context), Name, LinkageName, F,
787 LineNumber, Ty, IsLocalToUnit, false,
788 cast_or_null(Decl), TemplateParams, AlignInBits,
789 nullptr)
790 .release();
791}
792
799
800
801 auto *Scope = cast(Context);
804 if (AlwaysPreserve) {
805
806
807
809 }
811}
812
814 DIFile *File, unsigned LineNo,
815 DIType *Ty, bool AlwaysPreserve,
818 assert(Scope && isa(Scope) &&
819 "Unexpected scope for a local variable.");
821 VMContext, getSubprogramNodesTrackingVector(Scope), Scope, Name,
822 0, File, LineNo, Ty, AlwaysPreserve, Flags, AlignInBits);
823}
824
829 assert(ArgNo && "Expected non-zero argument number for parameter");
830 assert(Scope && isa(Scope) &&
831 "Unexpected scope for a local variable.");
833 VMContext, getSubprogramNodesTrackingVector(Scope), Scope, Name, ArgNo,
834 File, LineNo, Ty, AlwaysPreserve, Flags, 0, Annotations);
835}
836
838 unsigned LineNo, bool AlwaysPreserve) {
839 auto *Scope = cast(Context);
840 auto *Node = DILabel::get(VMContext, Scope, Name, File, LineNo);
841
842 if (AlwaysPreserve) {
843
844
845
846 getSubprogramNodesTrackingVector(Scope).emplace_back(Node);
847 }
848 return Node;
849}
850
853}
854
855template <class... Ts>
857 if (IsDistinct)
860}
861
866 DITemplateParameterArray TParams, DISubprogram *Decl,
867 DITypeArray ThrownTypes, DINodeArray Annotations,
869 bool IsDefinition = SPFlags & DISubprogram::SPFlagDefinition;
872 Name, LinkageName, File, LineNo, Ty, ScopeLine, nullptr, 0, 0, Flags,
873 SPFlags, IsDefinition ? CUNode : nullptr, TParams, Decl, nullptr,
874 ThrownTypes, Annotations, TargetFuncName);
875
876 if (IsDefinition)
877 AllSubprograms.push_back(Node);
878 trackIfUnresolved(Node);
879 return Node;
880}
881
886 DITemplateParameterArray TParams, DISubprogram *Decl,
887 DITypeArray ThrownTypes) {
888 bool IsDefinition = SPFlags & DISubprogram::SPFlagDefinition;
891 ScopeLine, nullptr, 0, 0, Flags, SPFlags,
892 IsDefinition ? CUNode : nullptr, TParams,
893 Decl, nullptr, ThrownTypes)
894 .release();
895}
896
899 unsigned LineNo, DISubroutineType *Ty, unsigned VIndex, int ThisAdjustment,
902 DITypeArray ThrownTypes) {
904 "Methods should have both a Context and a context that isn't "
905 "the compile unit.");
906
907 bool IsDefinition = SPFlags & DISubprogram::SPFlagDefinition;
909 IsDefinition, VMContext, cast(Context), Name,
910 LinkageName, F, LineNo, Ty, LineNo, VTableHolder, VIndex, ThisAdjustment,
911 Flags, SPFlags, IsDefinition ? CUNode : nullptr, TParams, nullptr,
912 nullptr, ThrownTypes);
913
914 if (IsDefinition)
915 AllSubprograms.push_back(SP);
916 trackIfUnresolved(SP);
917 return SP;
918}
919
923 unsigned LineNo) {
925}
926
928 bool ExportSymbols) {
929
930
931
932
933
934
936 ExportSymbols);
937}
938
942 DIFile *File, unsigned LineNo, bool IsDecl) {
944 ConfigurationMacros, IncludePath, APINotesFile, LineNo,
945 IsDecl);
946}
947
950 unsigned Discriminator) {
952}
953
955 unsigned Line, unsigned Col) {
956
957
959 File, Line, Col);
960}
961
965 return insertDeclare(Storage, VarInfo, Expr, DL, InsertBefore->getParent(),
966 InsertBefore);
967}
968
972
973
975 return insertDeclare(Storage, VarInfo, Expr, DL, InsertAtEnd, InsertBefore);
976}
977
983 auto *Link = cast_or_null(
984 LinkedInstr->getMetadata(LLVMContext::MD_DIAssignID));
985 assert(Link && "Linked instruction must have DIAssign metadata attached");
986
989 Val, SrcVar, ValExpr, Link, Addr, AddrExpr, DL);
991
993 Instruction *InsertBefore = NextIt == InsertBB->end() ? nullptr : &*NextIt;
994 insertDbgVariableRecord(DVR, InsertBB, InsertBefore, true);
995 return DVR;
996 }
997
1000 if (!AssignFn)
1002
1003 std::array<Value *, 6> Args = {
1010 };
1011
1013 B.SetCurrentDebugLocation(DL);
1014
1015 auto *DVI = cast(B.CreateCall(AssignFn, Args));
1016 DVI->insertAfter(LinkedInstr);
1017 return DVI;
1018}
1019
1022 return insertLabel(LabelInfo, DL,
1023 InsertBefore ? InsertBefore->getParent() : nullptr,
1024 InsertBefore);
1025}
1026
1029 return insertLabel(LabelInfo, DL, InsertAtEnd, nullptr);
1030}
1031
1037 DbgInstPtr DVI = insertDbgValueIntrinsic(
1038 V, VarInfo, Expr, DL, InsertBefore ? InsertBefore->getParent() : nullptr,
1039 InsertBefore);
1040 if (auto *Inst = dyn_cast<Instruction *>(DVI))
1041 cast(Inst)->setTailCall();
1042 return DVI;
1043}
1044
1050 return insertDbgValueIntrinsic(V, VarInfo, Expr, DL, InsertAtEnd, nullptr);
1051}
1052
1053
1054
1057 if (InsertBefore)
1059 else if (InsertBB)
1062}
1063
1065 assert(V && "no value passed to dbg intrinsic");
1067}
1068
1071}
1072
1073DbgInstPtr DIBuilder::insertDbgValueIntrinsic(
1079 insertDbgVariableRecord(DVR, InsertBB, InsertBefore);
1080 return DVR;
1081 }
1082
1083 if (!ValueFn)
1085 return insertDbgIntrinsic(ValueFn, Val, VarInfo, Expr, DL, InsertBB,
1086 InsertBefore);
1087}
1088
1093 assert(VarInfo && "empty or invalid DILocalVariable* passed to dbg.declare");
1094 assert(DL && "Expected debug loc");
1095 assert(DL->getScope()->getSubprogram() ==
1097 "Expected matching subprograms");
1098
1102 insertDbgVariableRecord(DVR, InsertBB, InsertBefore);
1103 return DVR;
1104 }
1105
1106 if (!DeclareFn)
1108
1109 trackIfUnresolved(VarInfo);
1110 trackIfUnresolved(Expr);
1114
1117 return B.CreateCall(DeclareFn, Args);
1118}
1119
1123 bool InsertAtHead) {
1124 assert(InsertBefore || InsertBB);
1129
1131 if (InsertBB && InsertBefore)
1133 else if (InsertBB)
1134 InsertPt = InsertBB->end();
1135 InsertPt.setHeadBit(InsertAtHead);
1137}
1138
1145 assert(IntrinsicFn && "must pass a non-null intrinsic function");
1146 assert(V && "must pass a value to a dbg intrinsic");
1148 "empty or invalid DILocalVariable* passed to debug intrinsic");
1149 assert(DL && "Expected debug loc");
1150 assert(DL->getScope()->getSubprogram() ==
1152 "Expected matching subprograms");
1153
1154 trackIfUnresolved(VarInfo);
1155 trackIfUnresolved(Expr);
1159
1162 return B.CreateCall(IntrinsicFn, Args);
1163}
1164
1168 assert(LabelInfo && "empty or invalid DILabel* passed to dbg.label");
1169 assert(DL && "Expected debug loc");
1170 assert(DL->getScope()->getSubprogram() ==
1172 "Expected matching subprograms");
1173
1174 trackIfUnresolved(LabelInfo);
1177 if (InsertBB && InsertBefore)
1179 else if (InsertBB)
1181 return DLR;
1182 }
1183
1184 if (!LabelFn)
1186
1188
1191 return B.CreateCall(LabelFn, Args);
1192}
1193
1195 {
1197 N->replaceVTableHolder(VTableHolder);
1199 }
1200
1201
1202 if (T != VTableHolder)
1203 return;
1204
1205
1206
1207 if (T->isResolved())
1208 for (const MDOperand &O : T->operands())
1209 if (auto *N = dyn_cast_or_null(O))
1210 trackIfUnresolved(N);
1211}
1212
1214 DINodeArray TParams) {
1215 {
1217 if (Elements)
1218 N->replaceElements(Elements);
1219 if (TParams)
1220 N->replaceTemplateParams(DITemplateParameterArray(TParams));
1222 }
1223
1224
1225 if (->isResolved())
1226 return;
1227
1228
1229
1230
1231 if (Elements)
1232 trackIfUnresolved(Elements.get());
1233 if (TParams)
1234 trackIfUnresolved(TParams.get());
1235}
This file implements a class to represent arbitrary precision integral constant values and operations...
This file implements the APSInt class, which is a simple class that represents an arbitrary sized int...
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
This file contains the declarations for the subclasses of Constant, which represent the different fla...
static DILocalVariable * createLocalVariable(LLVMContext &VMContext, SmallVectorImpl< TrackingMDNodeRef > &PreservedNodes, DIScope *Context, StringRef Name, unsigned ArgNo, DIFile *File, unsigned LineNo, DIType *Ty, bool AlwaysPreserve, DINode::DIFlags Flags, uint32_t AlignInBits, DINodeArray Annotations=nullptr)
static Function * getDeclareIntrin(Module &M)
static DIType * createTypeWithFlags(const DIType *Ty, DINode::DIFlags FlagsToSet)
static DIScope * getNonCompileUnitScope(DIScope *N)
If N is compile unit return NULL otherwise return N.
static void checkGlobalVariableScope(DIScope *Context)
static DISubprogram * getSubprogram(bool IsDistinct, Ts &&...Args)
static ConstantAsMetadata * getConstantOrNull(Constant *C)
static DITemplateValueParameter * createTemplateValueParameterHelper(LLVMContext &VMContext, unsigned Tag, DIScope *Context, StringRef Name, DIType *Ty, bool IsDefault, Metadata *MD)
static Value * getDbgIntrinsicValueImpl(LLVMContext &VMContext, Value *V)
static void initIRBuilder(IRBuilder<> &Builder, const DILocation *DL, BasicBlock *InsertBB, Instruction *InsertBefore)
Initialize IRBuilder for inserting dbg.declare and dbg.value intrinsics.
static DIImportedEntity * createImportedModule(LLVMContext &C, dwarf::Tag Tag, DIScope *Context, Metadata *NS, DIFile *File, unsigned Line, StringRef Name, DINodeArray Elements, SmallVectorImpl< TrackingMDNodeRef > &ImportedModules)
This file contains constants used for implementing Dwarf debug support.
Module.h This file contains the declarations for the Module class.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Class for arbitrary precision integers.
An arbitrary precision integer that knows its signedness.
Annotations lets you mark points and ranges inside source code, for tests:
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
LLVM Basic Block Representation.
void insertDbgRecordBefore(DbgRecord *DR, InstListType::iterator Here)
Insert a DbgRecord into a block at the position given by Here.
InstListType::iterator iterator
Instruction iterators...
const Instruction * getTerminator() const LLVM_READONLY
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
static ConstantInt * getSigned(IntegerType *Ty, int64_t V)
Return a ConstantInt with the specified value for the specified type.
This is an important base class in LLVM.
Basic type, like 'int' or 'float'.
static DIType * createObjectPointerType(DIType *Ty, bool Implicit)
Create a uniqued clone of Ty with FlagObjectPointer set.
DIBasicType * createUnspecifiedParameter()
Create unspecified parameter type for a subroutine type.
DIGlobalVariable * createTempGlobalVariableFwdDecl(DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DIType *Ty, bool IsLocalToUnit, MDNode *Decl=nullptr, MDTuple *TemplateParams=nullptr, uint32_t AlignInBits=0)
Identical to createGlobalVariable except that the resulting DbgNode is temporary and meant to be RAUW...
DITemplateValueParameter * createTemplateTemplateParameter(DIScope *Scope, StringRef Name, DIType *Ty, StringRef Val, bool IsDefault=false)
Create debugging information for a template template parameter.
DIDerivedType * createBitFieldMemberType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, uint64_t SizeInBits, uint64_t OffsetInBits, uint64_t StorageOffsetInBits, DINode::DIFlags Flags, DIType *Ty, DINodeArray Annotations=nullptr)
Create debugging information entry for a bit field member.
NodeTy * replaceTemporary(TempMDNode &&N, NodeTy *Replacement)
Replace a temporary node.
DIDerivedType * createTypedef(DIType *Ty, StringRef Name, DIFile *File, unsigned LineNo, DIScope *Context, uint32_t AlignInBits=0, DINode::DIFlags Flags=DINode::FlagZero, DINodeArray Annotations=nullptr)
Create debugging information entry for a typedef.
void finalize()
Construct any deferred debug info descriptors.
DISubroutineType * createSubroutineType(DITypeRefArray ParameterTypes, DINode::DIFlags Flags=DINode::FlagZero, unsigned CC=0)
Create subroutine type.
DIMacro * createMacro(DIMacroFile *Parent, unsigned Line, unsigned MacroType, StringRef Name, StringRef Value=StringRef())
Create debugging information entry for a macro.
DIDerivedType * createInheritance(DIType *Ty, DIType *BaseTy, uint64_t BaseOffset, uint32_t VBPtrOffset, DINode::DIFlags Flags)
Create debugging information entry to establish inheritance relationship between two types.
DIDerivedType * createStaticMemberType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, DIType *Ty, DINode::DIFlags Flags, Constant *Val, unsigned Tag, uint32_t AlignInBits=0)
Create debugging information entry for a C++ static data member.
DIDerivedType * createVariantMemberType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, Constant *Discriminant, DINode::DIFlags Flags, DIType *Ty)
Create debugging information entry for a variant.
DICompositeType * createClassType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, DINode::DIFlags Flags, DIType *DerivedFrom, DINodeArray Elements, unsigned RunTimeLang=0, DIType *VTableHolder=nullptr, MDNode *TemplateParms=nullptr, StringRef UniqueIdentifier="")
Create debugging information entry for a class.
DICompositeType * createEnumerationType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, DINodeArray Elements, DIType *UnderlyingType, unsigned RunTimeLang=0, StringRef UniqueIdentifier="", bool IsScoped=false)
Create debugging information entry for an enumeration.
DILexicalBlockFile * createLexicalBlockFile(DIScope *Scope, DIFile *File, unsigned Discriminator=0)
This creates a descriptor for a lexical block with a new file attached.
void finalizeSubprogram(DISubprogram *SP)
Finalize a specific subprogram - no new variables may be added to this subprogram afterwards.
DIDerivedType * createQualifiedType(unsigned Tag, DIType *FromTy)
Create debugging information entry for a qualified type, e.g.
DICompileUnit * createCompileUnit(unsigned Lang, DIFile *File, StringRef Producer, bool isOptimized, StringRef Flags, unsigned RV, StringRef SplitName=StringRef(), DICompileUnit::DebugEmissionKind Kind=DICompileUnit::DebugEmissionKind::FullDebug, uint64_t DWOId=0, bool SplitDebugInlining=true, bool DebugInfoForProfiling=false, DICompileUnit::DebugNameTableKind NameTableKind=DICompileUnit::DebugNameTableKind::Default, bool RangesBaseAddress=false, StringRef SysRoot={}, StringRef SDK={})
A CompileUnit provides an anchor for all debugging information generated during this instance of comp...
DISubprogram * createTempFunctionFwdDecl(DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DISubroutineType *Ty, unsigned ScopeLine, DINode::DIFlags Flags=DINode::FlagZero, DISubprogram::DISPFlags SPFlags=DISubprogram::SPFlagZero, DITemplateParameterArray TParams=nullptr, DISubprogram *Decl=nullptr, DITypeArray ThrownTypes=nullptr)
Identical to createFunction, except that the resulting DbgNode is meant to be RAUWed.
DIDerivedType * createObjCIVar(StringRef Name, DIFile *File, unsigned LineNo, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, DINode::DIFlags Flags, DIType *Ty, MDNode *PropertyNode)
Create debugging information entry for Objective-C instance variable.
static DIType * createArtificialType(DIType *Ty)
Create a uniqued clone of Ty with FlagArtificial set.
DICompositeType * createVectorType(uint64_t Size, uint32_t AlignInBits, DIType *Ty, DINodeArray Subscripts)
Create debugging information entry for a vector type.
DILabel * createLabel(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, bool AlwaysPreserve=false)
Create a new descriptor for an label.
DINamespace * createNameSpace(DIScope *Scope, StringRef Name, bool ExportSymbols)
This creates new descriptor for a namespace with the specified parent scope.
DIStringType * createStringType(StringRef Name, uint64_t SizeInBits)
Create debugging information entry for a string type.
DISubprogram * createFunction(DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DISubroutineType *Ty, unsigned ScopeLine, DINode::DIFlags Flags=DINode::FlagZero, DISubprogram::DISPFlags SPFlags=DISubprogram::SPFlagZero, DITemplateParameterArray TParams=nullptr, DISubprogram *Decl=nullptr, DITypeArray ThrownTypes=nullptr, DINodeArray Annotations=nullptr, StringRef TargetFuncName="")
Create a new descriptor for the specified subprogram.
DbgInstPtr insertDbgAssign(Instruction *LinkedInstr, Value *Val, DILocalVariable *SrcVar, DIExpression *ValExpr, Value *Addr, DIExpression *AddrExpr, const DILocation *DL)
Insert a new llvm.dbg.assign intrinsic call.
DILexicalBlock * createLexicalBlock(DIScope *Scope, DIFile *File, unsigned Line, unsigned Col)
This creates a descriptor for a lexical block with the specified parent context.
DICompositeType * createUnionType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, DINode::DIFlags Flags, DINodeArray Elements, unsigned RunTimeLang=0, StringRef UniqueIdentifier="")
Create debugging information entry for an union.
DIMacroNodeArray getOrCreateMacroArray(ArrayRef< Metadata * > Elements)
Get a DIMacroNodeArray, create one if required.
DIDerivedType * createSetType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, uint64_t SizeInBits, uint32_t AlignInBits, DIType *Ty)
Create debugging information entry for a set.
void replaceVTableHolder(DICompositeType *&T, DIType *VTableHolder)
Replace the vtable holder in the given type.
DIBasicType * createNullPtrType()
Create C++11 nullptr type.
DICommonBlock * createCommonBlock(DIScope *Scope, DIGlobalVariable *decl, StringRef Name, DIFile *File, unsigned LineNo)
Create common block entry for a Fortran common block.
DIDerivedType * createFriend(DIType *Ty, DIType *FriendTy)
Create debugging information entry for a 'friend'.
void retainType(DIScope *T)
Retain DIScope* in a module even if it is not referenced through debug info anchors.
DIDerivedType * createTemplateAlias(DIType *Ty, StringRef Name, DIFile *File, unsigned LineNo, DIScope *Context, DINodeArray TParams, uint32_t AlignInBits=0, DINode::DIFlags Flags=DINode::FlagZero, DINodeArray Annotations=nullptr)
Create debugging information entry for a template alias.
DIDerivedType * createPointerType(DIType *PointeeTy, uint64_t SizeInBits, uint32_t AlignInBits=0, std::optional< unsigned > DWARFAddressSpace=std::nullopt, StringRef Name="", DINodeArray Annotations=nullptr)
Create debugging information entry for a pointer.
DITemplateValueParameter * createTemplateParameterPack(DIScope *Scope, StringRef Name, DIType *Ty, DINodeArray Val)
Create debugging information for a template parameter pack.
DIGlobalVariableExpression * createGlobalVariableExpression(DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DIType *Ty, bool IsLocalToUnit, bool isDefined=true, DIExpression *Expr=nullptr, MDNode *Decl=nullptr, MDTuple *TemplateParams=nullptr, uint32_t AlignInBits=0, DINodeArray Annotations=nullptr)
Create a new descriptor for the specified variable.
DIBasicType * createBasicType(StringRef Name, uint64_t SizeInBits, unsigned Encoding, DINode::DIFlags Flags=DINode::FlagZero, uint32_t NumExtraInhabitants=0)
Create debugging information entry for a basic type.
DISubrange * getOrCreateSubrange(int64_t Lo, int64_t Count)
Create a descriptor for a value range.
DIDerivedType * createReferenceType(unsigned Tag, DIType *RTy, uint64_t SizeInBits=0, uint32_t AlignInBits=0, std::optional< unsigned > DWARFAddressSpace=std::nullopt)
Create debugging information entry for a c++ style reference or rvalue reference type.
DISubprogram * createMethod(DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DISubroutineType *Ty, unsigned VTableIndex=0, int ThisAdjustment=0, DIType *VTableHolder=nullptr, DINode::DIFlags Flags=DINode::FlagZero, DISubprogram::DISPFlags SPFlags=DISubprogram::SPFlagZero, DITemplateParameterArray TParams=nullptr, DITypeArray ThrownTypes=nullptr)
Create a new descriptor for the specified C++ method.
DIMacroFile * createTempMacroFile(DIMacroFile *Parent, unsigned Line, DIFile *File)
Create debugging information temporary entry for a macro file.
DICompositeType * createArrayType(uint64_t Size, uint32_t AlignInBits, DIType *Ty, DINodeArray Subscripts, PointerUnion< DIExpression *, DIVariable * > DataLocation=nullptr, PointerUnion< DIExpression *, DIVariable * > Associated=nullptr, PointerUnion< DIExpression *, DIVariable * > Allocated=nullptr, PointerUnion< DIExpression *, DIVariable * > Rank=nullptr)
Create debugging information entry for an array.
DIDerivedType * createMemberPointerType(DIType *PointeeTy, DIType *Class, uint64_t SizeInBits, uint32_t AlignInBits=0, DINode::DIFlags Flags=DINode::FlagZero)
Create debugging information entry for a pointer to member.
DITypeRefArray getOrCreateTypeArray(ArrayRef< Metadata * > Elements)
Get a DITypeRefArray, create one if required.
DINodeArray getOrCreateArray(ArrayRef< Metadata * > Elements)
Get a DINodeArray, create one if required.
DIEnumerator * createEnumerator(StringRef Name, const APSInt &Value)
Create a single enumerator value.
DITemplateTypeParameter * createTemplateTypeParameter(DIScope *Scope, StringRef Name, DIType *Ty, bool IsDefault)
Create debugging information for template type parameter.
DIBuilder(Module &M, bool AllowUnresolved=true, DICompileUnit *CU=nullptr)
Construct a builder for a module.
DIExpression * createExpression(ArrayRef< uint64_t > Addr={})
Create a new descriptor for the specified variable which has a complex address expression for its add...
DICompositeType * createReplaceableCompositeType(unsigned Tag, StringRef Name, DIScope *Scope, DIFile *F, unsigned Line, unsigned RuntimeLang=0, uint64_t SizeInBits=0, uint32_t AlignInBits=0, DINode::DIFlags Flags=DINode::FlagFwdDecl, StringRef UniqueIdentifier="", DINodeArray Annotations=nullptr)
Create a temporary forward-declared type.
DIDerivedType * createPtrAuthQualifiedType(DIType *FromTy, unsigned Key, bool IsAddressDiscriminated, unsigned ExtraDiscriminator, bool IsaPointer, bool authenticatesNullValues)
Create a __ptrauth qualifier.
DICompositeType * createVariantPart(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, DINode::DIFlags Flags, DIDerivedType *Discriminator, DINodeArray Elements, StringRef UniqueIdentifier="")
Create debugging information entry for a variant part.
DIImportedEntity * createImportedModule(DIScope *Context, DINamespace *NS, DIFile *File, unsigned Line, DINodeArray Elements=nullptr)
Create a descriptor for an imported module.
DIDerivedType * createMemberType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, DINode::DIFlags Flags, DIType *Ty, DINodeArray Annotations=nullptr)
Create debugging information entry for a member.
DIImportedEntity * createImportedDeclaration(DIScope *Context, DINode *Decl, DIFile *File, unsigned Line, StringRef Name="", DINodeArray Elements=nullptr)
Create a descriptor for an imported function.
DILocalVariable * createAutoVariable(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, DIType *Ty, bool AlwaysPreserve=false, DINode::DIFlags Flags=DINode::FlagZero, uint32_t AlignInBits=0)
Create a new descriptor for an auto variable.
static DISubprogram * createArtificialSubprogram(DISubprogram *SP)
Create a distinct clone of SP with FlagArtificial set.
DIGenericSubrange * getOrCreateGenericSubrange(DIGenericSubrange::BoundType Count, DIGenericSubrange::BoundType LowerBound, DIGenericSubrange::BoundType UpperBound, DIGenericSubrange::BoundType Stride)
DIBasicType * createUnspecifiedType(StringRef Name)
Create a DWARF unspecified type.
DIObjCProperty * createObjCProperty(StringRef Name, DIFile *File, unsigned LineNumber, StringRef GetterName, StringRef SetterName, unsigned PropertyAttributes, DIType *Ty)
Create debugging information entry for Objective-C property.
DICompositeType * createForwardDecl(unsigned Tag, StringRef Name, DIScope *Scope, DIFile *F, unsigned Line, unsigned RuntimeLang=0, uint64_t SizeInBits=0, uint32_t AlignInBits=0, StringRef UniqueIdentifier="")
Create a permanent forward-declared type.
DITemplateValueParameter * createTemplateValueParameter(DIScope *Scope, StringRef Name, DIType *Ty, bool IsDefault, Constant *Val)
Create debugging information for template value parameter.
DILocalVariable * createParameterVariable(DIScope *Scope, StringRef Name, unsigned ArgNo, DIFile *File, unsigned LineNo, DIType *Ty, bool AlwaysPreserve=false, DINode::DIFlags Flags=DINode::FlagZero, DINodeArray Annotations=nullptr)
Create a new descriptor for a parameter variable.
DIFile * createFile(StringRef Filename, StringRef Directory, std::optional< DIFile::ChecksumInfo< StringRef > > Checksum=std::nullopt, std::optional< StringRef > Source=std::nullopt)
Create a file descriptor to hold debugging information for a file.
DICompositeType * createStructType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, DINode::DIFlags Flags, DIType *DerivedFrom, DINodeArray Elements, unsigned RunTimeLang=0, DIType *VTableHolder=nullptr, StringRef UniqueIdentifier="", DIType *Specification=nullptr, uint32_t NumExtraInhabitants=0)
Create debugging information entry for a struct.
void replaceArrays(DICompositeType *&T, DINodeArray Elements, DINodeArray TParams=DINodeArray())
Replace arrays on a composite type.
DIModule * createModule(DIScope *Scope, StringRef Name, StringRef ConfigurationMacros, StringRef IncludePath, StringRef APINotesFile={}, DIFile *File=nullptr, unsigned LineNo=0, bool IsDecl=false)
This creates new descriptor for a module with the specified parent scope.
DICompositeTypeArray getEnumTypes() const
void replaceEnumTypes(DICompositeTypeArray N)
Replace arrays.
DIMacroNodeArray getMacros() const
void replaceRetainedTypes(DITypeArray N)
void replaceGlobalVariables(DIGlobalVariableExpressionArray N)
void replaceMacros(DIMacroNodeArray N)
DIImportedEntityArray getImportedEntities() const
DIScopeArray getRetainedTypes() const
void replaceImportedEntities(DIImportedEntityArray N)
DIGlobalVariableExpressionArray getGlobalVariables() const
A pair of DIGlobalVariable and DIExpression.
An imported module (C++ using directive or similar).
DILocalScope * getScope() const
Get the local scope for this label.
DISubprogram * getSubprogram() const
Get the subprogram for this scope.
DILocalScope * getScope() const
Get the local scope for this variable.
Represents a module in the programming language, for example, a Clang module, or a Fortran module.
Tagged DWARF-like metadata node.
Base class for scope-like contexts.
String type, Fortran CHARACTER(n)
DISPFlags
Debug info subprogram flags.
Type array for a subprogram.
TempDIType cloneWithFlags(DIFlags NewFlags) const
Returns a new temporary DIType with updated Flags.
bool isObjectPointer() const
bool isArtificial() const
Base class for variables.
Records a position in IR for a source label (DILabel).
Record of a variable value-assignment, aka a non instruction representation of the dbg....
static DbgVariableRecord * createDbgVariableRecord(Value *Location, DILocalVariable *DV, DIExpression *Expr, const DILocation *DI)
static DbgVariableRecord * createDVRDeclare(Value *Address, DILocalVariable *DV, DIExpression *Expr, const DILocation *DI)
DIExpression * getExpression() const
DILocalVariable * getVariable() const
static DbgVariableRecord * createDVRAssign(Value *Val, DILocalVariable *Variable, DIExpression *Expression, DIAssignID *AssignID, Value *Address, DIExpression *AddressExpression, const DILocation *DI)
DIExpression * getAddressExpression() const
void SetCurrentDebugLocation(DebugLoc L)
Set location information used by debugging information.
void SetInsertPoint(BasicBlock *TheBB)
This specifies that created instructions should be appended to the end of the specified block.
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
const Module * getModule() const
Return the module owning the function this instruction belongs to or nullptr it the function does not...
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
This is an important class for using LLVM in a threaded context.
static MDTuple * getDistinct(LLVMContext &Context, ArrayRef< Metadata * > MDs)
static TempMDTuple getTemporary(LLVMContext &Context, ArrayRef< Metadata * > MDs)
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
static std::enable_if_t< std::is_base_of< MDNode, T >::value, T * > replaceWithDistinct(std::unique_ptr< T, TempMDNodeDeleter > N)
Replace a temporary node with a distinct one.
static std::enable_if_t< std::is_base_of< MDNode, T >::value, T * > replaceWithUniqued(std::unique_ptr< T, TempMDNodeDeleter > N)
Replace a temporary node with a uniqued one.
Tracking metadata reference owned by Metadata.
static MDString * get(LLVMContext &Context, StringRef Str)
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
A Module instance is used to store all the information related to an LLVM module.
bool IsNewDbgInfoFormat
Is this Module using intrinsics to record the position of debugging information, or non-intrinsic rec...
NamedMDNode * getOrInsertNamedMetadata(StringRef Name)
Return the named MDNode in the module with the specified name.
void addOperand(MDNode *M)
A discriminated union of two or more pointer types, with the discriminator in the low bit of the poin...
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
reference emplace_back(ArgTypes &&... Args)
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
static IntegerType * getInt64Ty(LLVMContext &C)
LLVM Value Representation.
LLVMContext & getContext() const
All values hold a context through their type.
const ParentTy * getParent() const
self_iterator getIterator()
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
@ C
The default llvm calling convention, compatible with C.
Function * getOrInsertDeclaration(Module *M, ID id, ArrayRef< Type * > Tys={})
Look up the Function declaration of the intrinsic id in the Module M.
Calculates the starting offsets for various sections within the .debug_names section.
This is an optimization pass for GlobalISel generic memory operations.
A single checksum, represented by a Kind and a Value (a string).