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),
29 AllowUnresolvedNodes(AllowUnresolvedNodes) {
30 if (CUNode) {
31 if (const auto &ETs = CUNode->getEnumTypes())
32 AllEnumTypes.assign(ETs.begin(), ETs.end());
33 if (const auto &RTs = CUNode->getRetainedTypes())
34 AllRetainTypes.assign(RTs.begin(), RTs.end());
35 if (const auto &GVs = CUNode->getGlobalVariables())
36 AllGVs.assign(GVs.begin(), GVs.end());
37 if (const auto &IMs = CUNode->getImportedEntities())
38 ImportedModules.assign(IMs.begin(), IMs.end());
39 if (const auto &MNs = CUNode->getMacros())
40 AllMacrosPerParent.insert({nullptr, {llvm::from_range, MNs}});
41 }
42}
43
44void DIBuilder::trackIfUnresolved(MDNode *N) {
45 if ()
46 return;
47 if (N->isResolved())
48 return;
49
50 assert(AllowUnresolvedNodes && "Cannot handle unresolved nodes");
51 UnresolvedNodes.emplace_back(N);
52}
53
55 auto PN = SubprogramTrackedNodes.find(SP);
56 if (PN != SubprogramTrackedNodes.end())
57 SP->replaceRetainedNodes(
59 PN->second.end())));
60}
61
63 if (!CUNode) {
64 assert(!AllowUnresolvedNodes &&
65 "creating type nodes without a CU is not supported");
66 return;
67 }
68
69 if (!AllEnumTypes.empty())
72 AllEnumTypes.end())));
73
75
76
77
78
81 if (RetainSet.insert(N).second)
83
84 if (!RetainValues.empty())
85 CUNode->replaceRetainedTypes(MDTuple::get(VMContext, RetainValues));
86
87 for (auto *SP : AllSubprograms)
89 for (auto *N : RetainValues)
92
93 if (!AllGVs.empty())
94 CUNode->replaceGlobalVariables(MDTuple::get(VMContext, AllGVs));
95
96 if (!ImportedModules.empty())
99 ImportedModules.end())));
100
101 for (const auto &I : AllMacrosPerParent) {
102
103 if (.first) {
104 CUNode->replaceMacros(MDTuple::get(VMContext, I.second.getArrayRef()));
105 continue;
106 }
107
110 TMF->getLine(), TMF->getFile(),
113 }
114
115
116
117 for (const auto &N : UnresolvedNodes)
118 if (N && ->isResolved())
119 N->resolveCycles();
120 UnresolvedNodes.clear();
121
122
123 AllowUnresolvedNodes = false;
124}
125
126
132
135 bool isOptimized, StringRef Flags, unsigned RunTimeVer, StringRef SplitName,
137 bool SplitDebugInlining, bool DebugInfoForProfiling,
140
141 assert(!CUNode && "Can only make one compile unit per DIBuilder instance");
143 VMContext, Lang, File, Producer, isOptimized, Flags, RunTimeVer,
144 SplitName, Kind, nullptr, nullptr, nullptr, nullptr, nullptr, DWOId,
145 SplitDebugInlining, DebugInfoForProfiling, NameTableKind,
146 RangesBaseAddress, SysRoot, SDK);
147
148
149 NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.cu");
151 trackIfUnresolved(CUNode);
152 return CUNode;
153}
154
158 DINodeArray Elements,
160 if (Line)
161 assert(File && "Source location has line number but no file");
162 unsigned EntitiesCount = C.pImpl->DIImportedEntitys.size();
164 File, Line, Name, Elements);
165 if (EntitiesCount < C.pImpl->DIImportedEntitys.size())
166
167
169 return M;
170}
171
174 unsigned Line,
175 DINodeArray Elements) {
176 return ::createImportedModule(VMContext, dwarf::DW_TAG_imported_module,
177 Context, NS, File, Line, StringRef(), Elements,
178 getImportTrackingVector(Context));
179}
180
183 DIFile *File, unsigned Line,
184 DINodeArray Elements) {
185 return ::createImportedModule(VMContext, dwarf::DW_TAG_imported_module,
186 Context, NS, File, Line, StringRef(), Elements,
187 getImportTrackingVector(Context));
188}
189
191 DIFile *File, unsigned Line,
192 DINodeArray Elements) {
193 return ::createImportedModule(VMContext, dwarf::DW_TAG_imported_module,
194 Context, M, File, Line, StringRef(), Elements,
195 getImportTrackingVector(Context));
196}
197
200 DIFile *File, unsigned Line,
201 StringRef Name, DINodeArray Elements) {
202
203
204 return ::createImportedModule(VMContext, dwarf::DW_TAG_imported_declaration,
205 Context, Decl, File, Line, Name, Elements,
206 getImportTrackingVector(Context));
207}
208
211 std::optional Source) {
212 return DIFile::get(VMContext, Filename, Directory, CS, Source);
213}
214
216 unsigned MacroType, StringRef Name,
218 assert(!Name.empty() && "Unable to create macro without name");
221 "Unexpected macro type");
222 auto *M = DIMacro::get(VMContext, MacroType, LineNumber, Name, Value);
223 AllMacrosPerParent[Parent].insert(M);
224 return M;
225}
226
228 unsigned LineNumber, DIFile *File) {
230 LineNumber, File, DIMacroNodeArray())
231 .release();
232 AllMacrosPerParent[Parent].insert(MF);
233
234
235
236 AllMacrosPerParent.insert({MF, {}});
237 return MF;
238}
239
241 bool IsUnsigned) {
242 assert(!Name.empty() && "Unable to create enumerator without name");
244 Name);
245}
246
248 assert(!Name.empty() && "Unable to create enumerator without name");
250}
251
253 assert(!Name.empty() && "Unable to create type without name");
254 return DIBasicType::get(VMContext, dwarf::DW_TAG_unspecified_type, Name);
255}
256
260
262 unsigned Encoding,
264 uint32_t NumExtraInhabitants,
266 assert(!Name.empty() && "Unable to create type without name");
267 return DIBasicType::get(VMContext, dwarf::DW_TAG_base_type, Name, SizeInBits,
268 0, Encoding, NumExtraInhabitants, DataSizeInBits,
269 Flags);
270}
271
274 uint32_t AlignInBits, unsigned Encoding,
277 SizeInBits, AlignInBits, Encoding, Flags,
280}
281
284 uint32_t AlignInBits, unsigned Encoding,
287 SizeInBits, AlignInBits, Encoding, Flags,
290}
291
294 uint32_t AlignInBits, unsigned Encoding,
296 APInt Denominator) {
298 SizeInBits, AlignInBits, Encoding, Flags,
300 Numerator, Denominator);
301}
302
304 assert(!Name.empty() && "Unable to create type without name");
305 return DIStringType::get(VMContext, dwarf::DW_TAG_string_type, Name,
306 SizeInBits, 0);
307}
308
312 assert(!Name.empty() && "Unable to create type without name");
313 return DIStringType::get(VMContext, dwarf::DW_TAG_string_type, Name,
314 StringLength, nullptr, StrLocationExp, 0, 0, 0);
315}
316
320 assert(!Name.empty() && "Unable to create type without name");
321 return DIStringType::get(VMContext, dwarf::DW_TAG_string_type, Name, nullptr,
322 StringLengthExp, StrLocationExp, 0, 0, 0);
323}
324
328 std::nullopt, DINode::FlagZero);
329}
330
332 DIType *FromTy, unsigned Key, bool IsAddressDiscriminated,
333 unsigned ExtraDiscriminator, bool IsaPointer,
334 bool AuthenticatesNullValues) {
336 VMContext, dwarf::DW_TAG_LLVM_ptrauth_type, "", nullptr, 0, nullptr,
338 std::optionalDIDerivedType::PtrAuthData(
339 std::in_place, Key, IsAddressDiscriminated, ExtraDiscriminator,
340 IsaPointer, AuthenticatesNullValues),
341 DINode::FlagZero);
342}
343
347 std::optional DWARFAddressSpace,
349
350 return DIDerivedType::get(VMContext, dwarf::DW_TAG_pointer_type, Name,
351 nullptr, 0, nullptr, PointeeTy, SizeInBits,
352 AlignInBits, 0, DWARFAddressSpace, std::nullopt,
354}
355
361 return DIDerivedType::get(VMContext, dwarf::DW_TAG_ptr_to_member_type, "",
362 nullptr, 0, nullptr, PointeeTy, SizeInBits,
363 AlignInBits, 0, std::nullopt, std::nullopt, Flags,
365}
366
370 std::optional DWARFAddressSpace) {
371 assert(RTy && "Unable to create reference type");
373 SizeInBits, AlignInBits, 0, DWARFAddressSpace, {},
374 DINode::FlagZero);
375}
376
387
390 unsigned LineNo, DIScope *Context,
391 DINodeArray TParams, uint32_t AlignInBits,
393 return DIDerivedType::get(VMContext, dwarf::DW_TAG_template_alias, Name, File,
396 std::nullopt, Flags, TParams.get(), Annotations);
397}
398
400 assert(Ty && "Invalid type!");
401 assert(FriendTy && "Invalid friend type!");
402 return DIDerivedType::get(VMContext, dwarf::DW_TAG_friend, "", nullptr, 0, Ty,
404 std::nullopt, DINode::FlagZero);
405}
406
411 assert(Ty && "Unable to create inheritance");
413 ConstantInt::get(IntegerType::get(VMContext, 32), VBPtrOffset));
414 return DIDerivedType::get(VMContext, dwarf::DW_TAG_inheritance, "", nullptr,
415 0, Ty, BaseTy, 0, 0, BaseOffset, std::nullopt,
416 std::nullopt, Flags, ExtraData);
417}
418
423 return DIDerivedType::get(VMContext, dwarf::DW_TAG_member, Name, File,
425 SizeInBits, AlignInBits, OffsetInBits, std::nullopt,
426 std::nullopt, Flags, nullptr, Annotations);
427}
428
433 return DIDerivedType::get(VMContext, dwarf::DW_TAG_member, Name, File,
435 SizeInBits, AlignInBits, OffsetInBits, std::nullopt,
436 std::nullopt, Flags, nullptr, Annotations);
437}
438
440 if (C)
442 return nullptr;
443}
444
449
450
451 assert((Flags & DINode::FlagBitField) == 0);
453 VMContext, dwarf::DW_TAG_member, Name, File, LineNumber,
455 std::nullopt, std::nullopt, Flags, getConstantOrNull(Discriminant));
456}
457
459 DINodeArray Elements,
462 auto *V = DICompositeType::get(VMContext, dwarf::DW_TAG_variant, {}, nullptr,
465 Elements, 0, {}, nullptr);
466
467 trackIfUnresolved(V);
469 DINode::FlagZero, V);
470}
471
476 Flags |= DINode::FlagBitField;
478 VMContext, dwarf::DW_TAG_member, Name, File, LineNumber,
480 OffsetInBits, std::nullopt, std::nullopt, Flags,
482 StorageOffsetInBits)),
484}
485
490 Flags |= DINode::FlagBitField;
492 VMContext, dwarf::DW_TAG_member, Name, File, LineNumber,
494 OffsetInBits, std::nullopt, std::nullopt, Flags,
496 StorageOffsetInBits)),
498}
499
502 unsigned LineNumber, DIType *Ty,
505 Flags |= DINode::FlagStaticMember;
508 AlignInBits, (uint64_t)0, std::nullopt,
510}
511
517 return DIDerivedType::get(VMContext, dwarf::DW_TAG_member, Name, File,
519 SizeInBits, AlignInBits, OffsetInBits, std::nullopt,
520 std::nullopt, Flags, PropertyNode);
521}
522
526 unsigned PropertyAttributes, DIType *Ty) {
527 return DIObjCProperty::get(VMContext, Name, File, LineNumber, GetterName,
528 SetterName, PropertyAttributes, Ty);
529}
530
533 DIType *Ty, bool isDefault) {
536}
537
541 bool IsDefault, Metadata *MD) {
544}
545
548 DIType *Ty, bool isDefault,
551 VMContext, dwarf::DW_TAG_template_value_parameter, Context, Name, Ty,
553}
554
558 bool IsDefault) {
560 VMContext, dwarf::DW_TAG_GNU_template_template_param, Context, Name, Ty,
562}
563
566 DIType *Ty, DINodeArray Val) {
568 VMContext, dwarf::DW_TAG_GNU_template_parameter_pack, Context, Name, Ty,
569 false, Val.get());
570}
571
576 unsigned RunTimeLang, DIType *VTableHolder, MDNode *TemplateParams,
579 "createClassType should be called with a valid Context");
580
582 VMContext, dwarf::DW_TAG_class_type, Name, File, LineNumber,
584 OffsetInBits, Flags, Elements, RunTimeLang, std::nullopt,
586 trackIfUnresolved(R);
587 return R;
588}
589
593 DIType *DerivedFrom, DINodeArray Elements, unsigned RunTimeLang,
595 uint32_t NumExtraInhabitants) {
597 VMContext, dwarf::DW_TAG_structure_type, Name, File, LineNumber,
599 Flags, Elements, RunTimeLang, std::nullopt, VTableHolder,
600 nullptr, UniqueIdentifier, nullptr, nullptr, nullptr, nullptr, nullptr,
601 nullptr, Specification, NumExtraInhabitants);
602 trackIfUnresolved(R);
603 return R;
604}
605
609 DIType *DerivedFrom, DINodeArray Elements, unsigned RunTimeLang,
611 uint32_t NumExtraInhabitants) {
613 VMContext, dwarf::DW_TAG_structure_type, Name, File, LineNumber,
615 Flags, Elements, RunTimeLang, std::nullopt, VTableHolder,
616 nullptr, UniqueIdentifier, nullptr, nullptr, nullptr, nullptr, nullptr,
617 nullptr, Specification, NumExtraInhabitants);
618 trackIfUnresolved(R);
619 return R;
620}
621
625 DINodeArray Elements, unsigned RunTimeLang, StringRef UniqueIdentifier) {
627 VMContext, dwarf::DW_TAG_union_type, Name, File, LineNumber,
629 Elements, RunTimeLang, std::nullopt, nullptr, nullptr,
630 UniqueIdentifier);
631 trackIfUnresolved(R);
632 return R;
633}
634
637 unsigned LineNumber, uint64_t SizeInBits,
639 DIDerivedType *Discriminator, DINodeArray Elements,
642 VMContext, dwarf::DW_TAG_variant_part, Name, File, LineNumber,
644 Elements, 0, std::nullopt, nullptr, nullptr,
645 UniqueIdentifier, Discriminator);
646 trackIfUnresolved(R);
647 return R;
648}
649
655
658 uint64_t SizeInBits, uint32_t AlignInBits, DINodeArray Elements,
659 DIType *UnderlyingType, unsigned RunTimeLang, StringRef UniqueIdentifier,
660 bool IsScoped, std::optional<uint32_t> EnumKind) {
662 VMContext, dwarf::DW_TAG_enumeration_type, Name, File, LineNumber,
664 IsScoped ? DINode::FlagEnumClass : DINode::FlagZero, Elements,
665 RunTimeLang, EnumKind, nullptr, nullptr, UniqueIdentifier);
666 AllEnumTypes.emplace_back(CTy);
667 trackIfUnresolved(CTy);
668 return CTy;
669}
670
672 DIFile *File, unsigned LineNo,
675 auto *R = DIDerivedType::get(VMContext, dwarf::DW_TAG_set_type, Name, File,
677 SizeInBits, AlignInBits, 0, std::nullopt,
678 std::nullopt, DINode::FlagZero);
679 trackIfUnresolved(R);
680 return R;
681}
682
685 DINodeArray Subscripts,
691 Ty, Subscripts, DL, AS, AL, RK);
692}
693
702 VMContext, dwarf::DW_TAG_array_type, Name, File, LineNumber,
704 Subscripts, 0, std::nullopt, nullptr, nullptr, "", nullptr,
713 nullptr, nullptr, 0, BitStride);
714 trackIfUnresolved(R);
715 return R;
716}
717
720 DINodeArray Subscripts,
723 VMContext, dwarf::DW_TAG_array_type, "",
724 nullptr, 0, nullptr, Ty,
725 Size, AlignInBits, 0,
726 DINode::FlagVector, Subscripts,
727 0, std::nullopt, nullptr,
728 nullptr, "",
729 nullptr, nullptr,
730 nullptr, nullptr, nullptr,
731 nullptr, nullptr,
732 0,
733 BitStride);
734 trackIfUnresolved(R);
735 return R;
736}
737
739 auto NewSP = SP->cloneWithFlags(SP->getFlags() | DINode::FlagArtificial);
741}
742
745 auto NewTy = Ty->cloneWithFlags(Ty->getFlags() | FlagsToSet);
747}
748
750
751 if (Ty->isArtificial())
752 return Ty;
754}
755
757
758 if (Ty->isObjectPointer())
759 return Ty;
761
762 if (Implicit)
763 Flags |= DINode::FlagArtificial;
764
766}
767
769 assert(T && "Expected non-null type");
772 "Expected type or subprogram declaration");
773 AllRetainTypes.emplace_back(T);
774}
775
777
780 unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
781 StringRef UniqueIdentifier, std::optional<uint32_t> EnumKind) {
782
783
786 SizeInBits, AlignInBits, 0, DINode::FlagFwdDecl, nullptr, RuntimeLang,
787 EnumKind, nullptr, nullptr, UniqueIdentifier);
788 trackIfUnresolved(RetTy);
789 return RetTy;
790}
791
794 unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
796 std::optional<uint32_t> EnumKind) {
797 auto *RetTy =
800 SizeInBits, AlignInBits, 0, Flags, nullptr, RuntimeLang, EnumKind,
801 nullptr, nullptr, UniqueIdentifier, nullptr, nullptr, nullptr,
803 .release();
804 trackIfUnresolved(RetTy);
805 return RetTy;
806}
807
811
812DIMacroNodeArray
816
819 for (Metadata *E : Elements) {
822 else
824 }
826}
827
833 return DISubrange::get(VMContext, CountNode, LB, nullptr, nullptr);
834}
835
839 return DISubrange::get(VMContext, CountNode, LB, nullptr, nullptr);
840}
841
846
853 };
855 ConvToMetadata(LB), ConvToMetadata(UB),
856 ConvToMetadata(Stride));
857}
858
864 return DISubrangeType::get(VMContext, Name, File, LineNo, Scope, SizeInBits,
865 AlignInBits, Flags, Ty, LowerBound, UpperBound,
866 Stride, Bias);
867}
868
870#ifndef NDEBUG
871 if (auto *CT =
873 assert(CT->getIdentifier().empty() &&
874 "Context of a global variable should not be a type with identifier");
875#endif
876}
877
880 unsigned LineNumber, DIType *Ty, bool IsLocalToUnit, bool isDefined,
884
887 LineNumber, Ty, IsLocalToUnit, isDefined,
890 if (!Expr)
893 AllGVs.push_back(N);
894 return N;
895}
896
899 unsigned LineNumber, DIType *Ty, bool IsLocalToUnit, MDNode *Decl,
902
905 LineNumber, Ty, IsLocalToUnit, false,
907 nullptr)
908 .release();
909}
910
917
918
922 if (AlwaysPreserve) {
923
924
925
927 }
929}
930
932 DIFile *File, unsigned LineNo,
933 DIType *Ty, bool AlwaysPreserve,
937 "Unexpected scope for a local variable.");
939 VMContext, getSubprogramNodesTrackingVector(Scope), Scope, Name,
940 0, File, LineNo, Ty, AlwaysPreserve, Flags, AlignInBits);
941}
942
947 assert(ArgNo && "Expected non-zero argument number for parameter");
949 "Unexpected scope for a local variable.");
951 VMContext, getSubprogramNodesTrackingVector(Scope), Scope, Name, ArgNo,
952 File, LineNo, Ty, AlwaysPreserve, Flags, 0, Annotations);
953}
954
956 unsigned LineNo, unsigned Column,
957 bool IsArtificial,
958 std::optional CoroSuspendIdx,
959 bool AlwaysPreserve) {
961 auto *Node = DILabel::get(VMContext, Scope, Name, File, LineNo, Column,
962 IsArtificial, CoroSuspendIdx);
963
964 if (AlwaysPreserve) {
965
966
967
968 getSubprogramNodesTrackingVector(Scope).emplace_back(Node);
969 }
971}
972
976
977template <class... Ts>
983
988 DITemplateParameterArray TParams, DISubprogram *Decl,
990 bool UseKeyInstructions) {
991 bool IsDefinition = SPFlags & DISubprogram::SPFlagDefinition;
994 Name, LinkageName, File, LineNo, Ty, ScopeLine, nullptr, 0, 0, Flags,
995 SPFlags, IsDefinition ? CUNode : nullptr, TParams, Decl, nullptr,
996 ThrownTypes, Annotations, TargetFuncName, UseKeyInstructions);
997
998 AllSubprograms.push_back(Node);
999 trackIfUnresolved(Node);
1000 return Node;
1001}
1002
1007 DITemplateParameterArray TParams, DISubprogram *Decl,
1008 DITypeArray ThrownTypes) {
1009 bool IsDefinition = SPFlags & DISubprogram::SPFlagDefinition;
1012 ScopeLine, nullptr, 0, 0, Flags, SPFlags,
1013 IsDefinition ? CUNode : nullptr, TParams,
1014 Decl, nullptr, ThrownTypes)
1015 .release();
1016}
1017
1020 unsigned LineNo, DISubroutineType *Ty, unsigned VIndex, int ThisAdjustment,
1023 DITypeArray ThrownTypes, bool UseKeyInstructions) {
1025 "Methods should have both a Context and a context that isn't "
1026 "the compile unit.");
1027
1028 bool IsDefinition = SPFlags & DISubprogram::SPFlagDefinition;
1030 IsDefinition, VMContext, cast(Context), Name,
1031 LinkageName, F, LineNo, Ty, LineNo, VTableHolder, VIndex, ThisAdjustment,
1032 Flags, SPFlags, IsDefinition ? CUNode : nullptr, TParams, nullptr,
1033 nullptr, ThrownTypes, nullptr, "", IsDefinition && UseKeyInstructions);
1034
1035 AllSubprograms.push_back(SP);
1036 trackIfUnresolved(SP);
1037 return SP;
1038}
1039
1043 unsigned LineNo) {
1044 return DICommonBlock::get(VMContext, Scope, Decl, Name, File, LineNo);
1045}
1046
1048 bool ExportSymbols) {
1049
1050
1051
1052
1053
1054
1056 ExportSymbols);
1057}
1058
1062 DIFile *File, unsigned LineNo, bool IsDecl) {
1064 ConfigurationMacros, IncludePath, APINotesFile, LineNo,
1065 IsDecl);
1066}
1067
1070 unsigned Discriminator) {
1072}
1073
1075 unsigned Line, unsigned Col) {
1076
1077
1079 File, Line, Col);
1080}
1081
1085
1086
1089 InsertBefore ? InsertBefore->getIterator()
1090 : InsertAtEnd->end());
1091}
1092
1099 LinkedInstr->getMetadata(LLVMContext::MD_DIAssignID));
1100 assert(Link && "Linked instruction must have DIAssign metadata attached");
1101
1103 Val, SrcVar, ValExpr, Link, Addr, AddrExpr, DL);
1104
1106 NextIt.setHeadBit(true);
1107 insertDbgVariableRecord(DVR, NextIt);
1108 return DVR;
1109}
1110
1111
1112
1115 Builder.SetInsertPoint(InsertPt.getBasicBlock(), InsertPt);
1116 Builder.SetCurrentDebugLocation(DL);
1117}
1118
1120 assert(V && "no value passed to dbg intrinsic");
1122}
1123
1131 insertDbgVariableRecord(DVR, InsertPt);
1132 return DVR;
1133}
1134
1138 assert(VarInfo && "empty or invalid DILocalVariable* passed to dbg.declare");
1139 assert(DL && "Expected debug loc");
1140 assert(DL->getScope()->getSubprogram() ==
1142 "Expected matching subprograms");
1143
1146 insertDbgVariableRecord(DVR, InsertPt);
1147 return DVR;
1148}
1149
1156 "empty or invalid DILocalVariable* passed to dbg.declare_value");
1157 assert(DL && "Expected debug loc");
1158 assert(DL->getScope()->getSubprogram() ==
1160 "Expected matching subprograms");
1161
1164 insertDbgVariableRecord(DVR, InsertPt);
1165 return DVR;
1166}
1167
1175
1178}
1179
1185 assert(IntrinsicFn && "must pass a non-null intrinsic function");
1186 assert(V && "must pass a value to a dbg intrinsic");
1188 "empty or invalid DILocalVariable* passed to debug intrinsic");
1189 assert(DL && "Expected debug loc");
1190 assert(DL->getScope()->getSubprogram() ==
1192 "Expected matching subprograms");
1193
1194 trackIfUnresolved(VarInfo);
1195 trackIfUnresolved(Expr);
1199
1202 return B.CreateCall(IntrinsicFn, Args);
1203}
1204
1207 assert(LabelInfo && "empty or invalid DILabel* passed to dbg.label");
1208 assert(DL && "Expected debug loc");
1209 assert(DL->getScope()->getSubprogram() ==
1211 "Expected matching subprograms");
1212
1213 trackIfUnresolved(LabelInfo);
1215 if (InsertPt.isValid()) {
1218 }
1219 return DLR;
1220}
1221
1223 {
1225 N->replaceVTableHolder(VTableHolder);
1227 }
1228
1229
1230 if (T != VTableHolder)
1231 return;
1232
1233
1234
1235 if (T->isResolved())
1236 for (const MDOperand &O : T->operands())
1238 trackIfUnresolved(N);
1239}
1240
1242 DINodeArray TParams) {
1243 {
1245 if (Elements)
1246 N->replaceElements(Elements);
1247 if (TParams)
1248 N->replaceTemplateParams(DITemplateParameterArray(TParams));
1250 }
1251
1252
1253 if (->isResolved())
1254 return;
1255
1256
1257
1258
1259 if (Elements)
1260 trackIfUnresolved(Elements.get());
1261 if (TParams)
1262 trackIfUnresolved(TParams.get());
1263}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
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)
Definition DIBuilder.cpp:911
static DIType * createTypeWithFlags(const DIType *Ty, DINode::DIFlags FlagsToSet)
Definition DIBuilder.cpp:743
static DIScope * getNonCompileUnitScope(DIScope *N)
If N is compile unit return NULL otherwise return N.
Definition DIBuilder.cpp:127
static void checkGlobalVariableScope(DIScope *Context)
Definition DIBuilder.cpp:869
static DISubprogram * getSubprogram(bool IsDistinct, Ts &&...Args)
Definition DIBuilder.cpp:978
static ConstantAsMetadata * getConstantOrNull(Constant *C)
Definition DIBuilder.cpp:439
static DITemplateValueParameter * createTemplateValueParameterHelper(LLVMContext &VMContext, unsigned Tag, DIScope *Context, StringRef Name, DIType *Ty, bool IsDefault, Metadata *MD)
Definition DIBuilder.cpp:539
static void initIRBuilder(IRBuilder<> &Builder, const DILocation *DL, InsertPosition InsertPt)
Initialize IRBuilder for inserting dbg.declare and dbg.value intrinsics.
Definition DIBuilder.cpp:1113
static Value * getDbgIntrinsicValueImpl(LLVMContext &VMContext, Value *V)
Definition DIBuilder.cpp:1119
static DIImportedEntity * createImportedModule(LLVMContext &C, dwarf::Tag Tag, DIScope *Context, Metadata *NS, DIFile *File, unsigned Line, StringRef Name, DINodeArray Elements, SmallVectorImpl< TrackingMDNodeRef > &ImportedModules)
Definition DIBuilder.cpp:156
This file contains constants used for implementing Dwarf debug support.
Module.h This file contains the declarations for the Module class.
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.
LLVM_ABI 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 LLVM_ABI DIType * createObjectPointerType(DIType *Ty, bool Implicit)
Create a uniqued clone of Ty with FlagObjectPointer set.
Definition DIBuilder.cpp:756
LLVM_ABI DIBasicType * createUnspecifiedParameter()
Create unspecified parameter type for a subroutine type.
Definition DIBuilder.cpp:776
LLVM_ABI 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...
Definition DIBuilder.cpp:897
LLVM_ABI DITemplateValueParameter * createTemplateTemplateParameter(DIScope *Scope, StringRef Name, DIType *Ty, StringRef Val, bool IsDefault=false)
Create debugging information for a template template parameter.
Definition DIBuilder.cpp:556
NodeTy * replaceTemporary(TempMDNode &&N, NodeTy *Replacement)
Replace a temporary node.
LLVM_ABI 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.
Definition DIBuilder.cpp:377
LLVM_ABI void finalize()
Construct any deferred debug info descriptors.
Definition DIBuilder.cpp:62
LLVM_ABI DISubroutineType * createSubroutineType(DITypeRefArray ParameterTypes, DINode::DIFlags Flags=DINode::FlagZero, unsigned CC=0)
Create subroutine type.
Definition DIBuilder.cpp:650
LLVM_ABI DIMacro * createMacro(DIMacroFile *Parent, unsigned Line, unsigned MacroType, StringRef Name, StringRef Value=StringRef())
Create debugging information entry for a macro.
Definition DIBuilder.cpp:215
LLVM_ABI 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.
Definition DIBuilder.cpp:407
LLVM_ABI DICompositeType * createVectorType(uint64_t Size, uint32_t AlignInBits, DIType *Ty, DINodeArray Subscripts, Metadata *BitStride=nullptr)
Create debugging information entry for a vector type.
Definition DIBuilder.cpp:718
LLVM_ABI 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.
Definition DIBuilder.cpp:501
LLVM_ABI 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.
Definition DIBuilder.cpp:445
LLVM_ABI 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.
Definition DIBuilder.cpp:572
LLVM_ABI DILexicalBlockFile * createLexicalBlockFile(DIScope *Scope, DIFile *File, unsigned Discriminator=0)
This creates a descriptor for a lexical block with a new file attached.
Definition DIBuilder.cpp:1068
LLVM_ABI void finalizeSubprogram(DISubprogram *SP)
Finalize a specific subprogram - no new variables may be added to this subprogram afterwards.
Definition DIBuilder.cpp:54
LLVM_ABI DIDerivedType * createQualifiedType(unsigned Tag, DIType *FromTy)
Create debugging information entry for a qualified type, e.g.
Definition DIBuilder.cpp:325
LLVM_ABI 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.
Definition DIBuilder.cpp:1003
LLVM_ABI 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.
Definition DIBuilder.cpp:513
static LLVM_ABI DIType * createArtificialType(DIType *Ty)
Create a uniqued clone of Ty with FlagArtificial set.
Definition DIBuilder.cpp:749
LLVM_ABI DIDerivedType * createBitFieldMemberType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, Metadata *SizeInBits, Metadata *OffsetInBits, uint64_t StorageOffsetInBits, DINode::DIFlags Flags, DIType *Ty, DINodeArray Annotations=nullptr)
Create debugging information entry for a bit field member.
Definition DIBuilder.cpp:472
LLVM_ABI DIFixedPointType * createRationalFixedPointType(StringRef Name, uint64_t SizeInBits, uint32_t AlignInBits, unsigned Encoding, DINode::DIFlags Flags, APInt Numerator, APInt Denominator)
Create debugging information entry for an arbitrary rational fixed-point type.
Definition DIBuilder.cpp:293
LLVM_ABI 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, bool UseKeyInstructions=false)
Create a new descriptor for the specified C++ method.
Definition DIBuilder.cpp:1018
LLVM_ABI DINamespace * createNameSpace(DIScope *Scope, StringRef Name, bool ExportSymbols)
This creates new descriptor for a namespace with the specified parent scope.
Definition DIBuilder.cpp:1047
LLVM_ABI DIStringType * createStringType(StringRef Name, uint64_t SizeInBits)
Create debugging information entry for a string type.
Definition DIBuilder.cpp:303
LLVM_ABI 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.
Definition DIBuilder.cpp:1093
LLVM_ABI DbgInstPtr insertDeclareValue(llvm::Value *Storage, DILocalVariable *VarInfo, DIExpression *Expr, const DILocation *DL, InsertPosition InsertPt)
Insert a new llvm.dbg.declare_value intrinsic call.
Definition DIBuilder.cpp:1150
LLVM_ABI DILexicalBlock * createLexicalBlock(DIScope *Scope, DIFile *File, unsigned Line, unsigned Col)
This creates a descriptor for a lexical block with the specified parent context.
Definition DIBuilder.cpp:1074
LLVM_ABI 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.
Definition DIBuilder.cpp:622
LLVM_ABI DIMacroNodeArray getOrCreateMacroArray(ArrayRef< Metadata * > Elements)
Get a DIMacroNodeArray, create one if required.
Definition DIBuilder.cpp:813
LLVM_ABI DIDerivedType * createMemberType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, Metadata *SizeInBits, uint32_t AlignInBits, Metadata *OffsetInBits, DINode::DIFlags Flags, DIType *Ty, DINodeArray Annotations=nullptr)
Create debugging information entry for a member.
Definition DIBuilder.cpp:429
LLVM_ABI 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.
Definition DIBuilder.cpp:671
LLVM_ABI void replaceVTableHolder(DICompositeType *&T, DIType *VTableHolder)
Replace the vtable holder in the given type.
Definition DIBuilder.cpp:1222
LLVM_ABI DIBasicType * createNullPtrType()
Create C++11 nullptr type.
Definition DIBuilder.cpp:257
LLVM_ABI DICommonBlock * createCommonBlock(DIScope *Scope, DIGlobalVariable *decl, StringRef Name, DIFile *File, unsigned LineNo)
Create common block entry for a Fortran common block.
Definition DIBuilder.cpp:1040
LLVM_ABI DIDerivedType * createFriend(DIType *Ty, DIType *FriendTy)
Create debugging information entry for a 'friend'.
Definition DIBuilder.cpp:399
LLVM_ABI DILabel * createLabel(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, unsigned Column, bool IsArtificial, std::optional< unsigned > CoroSuspendIdx, bool AlwaysPreserve=false)
Create a new descriptor for an label.
Definition DIBuilder.cpp:955
LLVM_ABI void retainType(DIScope *T)
Retain DIScope* in a module even if it is not referenced through debug info anchors.
Definition DIBuilder.cpp:768
LLVM_ABI 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.
Definition DIBuilder.cpp:389
LLVM_ABI 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="", bool UseKeyInstructions=false)
Create a new descriptor for the specified subprogram.
Definition DIBuilder.cpp:984
LLVM_ABI 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.
Definition DIBuilder.cpp:345
LLVM_ABI DbgInstPtr insertDeclare(llvm::Value *Storage, DILocalVariable *VarInfo, DIExpression *Expr, const DILocation *DL, BasicBlock *InsertAtEnd)
Insert a new llvm.dbg.declare intrinsic call.
Definition DIBuilder.cpp:1082
LLVM_ABI DbgInstPtr insertDbgValueIntrinsic(llvm::Value *Val, DILocalVariable *VarInfo, DIExpression *Expr, const DILocation *DL, InsertPosition InsertPt)
Insert a new llvm.dbg.value intrinsic call.
Definition DIBuilder.cpp:1124
LLVM_ABI DITemplateValueParameter * createTemplateParameterPack(DIScope *Scope, StringRef Name, DIType *Ty, DINodeArray Val)
Create debugging information for a template parameter pack.
Definition DIBuilder.cpp:565
LLVM_ABI 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.
Definition DIBuilder.cpp:878
LLVM_ABI 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, std::optional< uint32_t > EnumKind=std::nullopt)
Create a temporary forward-declared type.
Definition DIBuilder.cpp:792
LLVM_ABI 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, std::optional< uint32_t > EnumKind=std::nullopt)
Create debugging information entry for an enumeration.
Definition DIBuilder.cpp:656
LLVM_ABI DIFixedPointType * createDecimalFixedPointType(StringRef Name, uint64_t SizeInBits, uint32_t AlignInBits, unsigned Encoding, DINode::DIFlags Flags, int Factor)
Create debugging information entry for a decimal fixed-point type.
Definition DIBuilder.cpp:283
LLVM_ABI DIBasicType * createBasicType(StringRef Name, uint64_t SizeInBits, unsigned Encoding, DINode::DIFlags Flags=DINode::FlagZero, uint32_t NumExtraInhabitants=0, uint32_t DataSizeInBits=0)
Create debugging information entry for a basic type.
Definition DIBuilder.cpp:261
LLVM_ABI DISubrange * getOrCreateSubrange(int64_t Lo, int64_t Count)
Create a descriptor for a value range.
Definition DIBuilder.cpp:828
LLVM_ABI DISubrangeType * createSubrangeType(StringRef Name, DIFile *File, unsigned LineNo, DIScope *Scope, uint64_t SizeInBits, uint32_t AlignInBits, DINode::DIFlags Flags, DIType *Ty, Metadata *LowerBound, Metadata *UpperBound, Metadata *Stride, Metadata *Bias)
Create a type describing a subrange of another type.
Definition DIBuilder.cpp:859
LLVM_ABI 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.
Definition DIBuilder.cpp:368
LLVM_ABI DIMacroFile * createTempMacroFile(DIMacroFile *Parent, unsigned Line, DIFile *File)
Create debugging information temporary entry for a macro file.
Definition DIBuilder.cpp:227
LLVM_ABI 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.
Definition DIBuilder.cpp:684
LLVM_ABI 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.
Definition DIBuilder.cpp:356
LLVM_ABI DICompositeType * createStructType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, Metadata *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.
Definition DIBuilder.cpp:590
LLVM_ABI DITypeRefArray getOrCreateTypeArray(ArrayRef< Metadata * > Elements)
Get a DITypeRefArray, create one if required.
Definition DIBuilder.cpp:817
LLVM_ABI DINodeArray getOrCreateArray(ArrayRef< Metadata * > Elements)
Get a DINodeArray, create one if required.
Definition DIBuilder.cpp:808
LLVM_ABI DICompileUnit * createCompileUnit(DISourceLanguageName 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...
Definition DIBuilder.cpp:133
LLVM_ABI DIEnumerator * createEnumerator(StringRef Name, const APSInt &Value)
Create a single enumerator value.
Definition DIBuilder.cpp:247
LLVM_ABI DITemplateTypeParameter * createTemplateTypeParameter(DIScope *Scope, StringRef Name, DIType *Ty, bool IsDefault)
Create debugging information for template type parameter.
Definition DIBuilder.cpp:532
LLVM_ABI DIBuilder(Module &M, bool AllowUnresolved=true, DICompileUnit *CU=nullptr)
Construct a builder for a module.
Definition DIBuilder.cpp:27
LLVM_ABI DIExpression * createExpression(ArrayRef< uint64_t > Addr={})
Create a new descriptor for the specified variable which has a complex address expression for its add...
Definition DIBuilder.cpp:973
LLVM_ABI DIDerivedType * createPtrAuthQualifiedType(DIType *FromTy, unsigned Key, bool IsAddressDiscriminated, unsigned ExtraDiscriminator, bool IsaPointer, bool authenticatesNullValues)
Create a __ptrauth qualifier.
Definition DIBuilder.cpp:331
LLVM_ABI 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="", std::optional< uint32_t > EnumKind=std::nullopt)
Create a permanent forward-declared type.
Definition DIBuilder.cpp:778
LLVM_ABI 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.
Definition DIBuilder.cpp:636
LLVM_ABI DIImportedEntity * createImportedModule(DIScope *Context, DINamespace *NS, DIFile *File, unsigned Line, DINodeArray Elements=nullptr)
Create a descriptor for an imported module.
Definition DIBuilder.cpp:172
LLVM_ABI DbgInstPtr insertLabel(DILabel *LabelInfo, const DILocation *DL, InsertPosition InsertPt)
Insert a new llvm.dbg.label intrinsic call.
Definition DIBuilder.cpp:1205
LLVM_ABI DIImportedEntity * createImportedDeclaration(DIScope *Context, DINode *Decl, DIFile *File, unsigned Line, StringRef Name="", DINodeArray Elements=nullptr)
Create a descriptor for an imported function.
Definition DIBuilder.cpp:199
LLVM_ABI 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.
Definition DIBuilder.cpp:931
static LLVM_ABI DISubprogram * createArtificialSubprogram(DISubprogram *SP)
Create a distinct clone of SP with FlagArtificial set.
Definition DIBuilder.cpp:738
LLVM_ABI DIGenericSubrange * getOrCreateGenericSubrange(DIGenericSubrange::BoundType Count, DIGenericSubrange::BoundType LowerBound, DIGenericSubrange::BoundType UpperBound, DIGenericSubrange::BoundType Stride)
Definition DIBuilder.cpp:847
LLVM_ABI DIBasicType * createUnspecifiedType(StringRef Name)
Create a DWARF unspecified type.
Definition DIBuilder.cpp:252
LLVM_ABI DIObjCProperty * createObjCProperty(StringRef Name, DIFile *File, unsigned LineNumber, StringRef GetterName, StringRef SetterName, unsigned PropertyAttributes, DIType *Ty)
Create debugging information entry for Objective-C property.
Definition DIBuilder.cpp:524
LLVM_ABI DITemplateValueParameter * createTemplateValueParameter(DIScope *Scope, StringRef Name, DIType *Ty, bool IsDefault, Constant *Val)
Create debugging information for template value parameter.
Definition DIBuilder.cpp:547
LLVM_ABI 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.
Definition DIBuilder.cpp:943
LLVM_ABI 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.
Definition DIBuilder.cpp:209
LLVM_ABI void replaceArrays(DICompositeType *&T, DINodeArray Elements, DINodeArray TParams=DINodeArray())
Replace arrays on a composite type.
Definition DIBuilder.cpp:1241
LLVM_ABI DIFixedPointType * createBinaryFixedPointType(StringRef Name, uint64_t SizeInBits, uint32_t AlignInBits, unsigned Encoding, DINode::DIFlags Flags, int Factor)
Create debugging information entry for a binary fixed-point type.
Definition DIBuilder.cpp:273
LLVM_ABI 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.
Definition DIBuilder.cpp:1059
@ FixedPointBinary
Scale factor 2^Factor.
@ FixedPointDecimal
Scale factor 10^Factor.
@ FixedPointRational
Arbitrary rational scale factor.
PointerUnion< DIVariable *, DIExpression * > BoundType
A pair of DIGlobalVariable and DIExpression.
An imported module (C++ using directive or similar).
DILocalScope * getScope() const
Get the local scope for this label.
LLVM_ABI 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.
Wrapper structure that holds a language name and its version.
String type, Fortran CHARACTER(n)
Subprogram description. Uses SubclassData1.
DISPFlags
Debug info subprogram flags.
Type array for a subprogram.
TempDIType cloneWithFlags(DIFlags NewFlags) const
Returns a new temporary DIType with updated Flags.
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 LLVM_ABI DbgVariableRecord * createDVRDeclareValue(Value *Address, DILocalVariable *DV, DIExpression *Expr, const DILocation *DI)
static LLVM_ABI DbgVariableRecord * createDVRAssign(Value *Val, DILocalVariable *Variable, DIExpression *Expression, DIAssignID *AssignID, Value *Address, DIExpression *AddressExpression, const DILocation *DI)
DIExpression * getExpression() const
static LLVM_ABI DbgVariableRecord * createDVRDeclare(Value *Address, DILocalVariable *DV, DIExpression *Expr, const DILocation *DI)
static LLVM_ABI DbgVariableRecord * createDbgVariableRecord(Value *Location, DILocalVariable *DV, DIExpression *Expr, const DILocation *DI)
DILocalVariable * getVariable() const
DIExpression * getAddressExpression() const
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
BasicBlock * getBasicBlock()
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
static LLVM_ABI 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 LLVM_ABI 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.
LLVM_ABI 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 LLVM_ABI IntegerType * getInt64Ty(LLVMContext &C)
LLVM Value Representation.
self_iterator getIterator()
@ C
The default llvm calling convention, compatible with C.
Calculates the starting offsets for various sections within the .debug_names section.
This is an optimization pass for GlobalISel generic memory operations.
TypedTrackingMDRef< MDNode > TrackingMDNodeRef
decltype(auto) dyn_cast(const From &Val)
dyn_cast - Return the argument parameter cast to the specified type.
constexpr from_range_t from_range
auto cast_or_null(const Y &Val)
bool isa_and_nonnull(const Y &Val)
auto dyn_cast_or_null(const Y &Val)
FunctionAddr VTableAddr Count
bool isa(const From &Val)
isa - Return true if the parameter to the template is an instance of one of the template type argu...
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
IRBuilder(LLVMContext &, FolderTy, InserterTy, MDNode *, ArrayRef< OperandBundleDef >) -> IRBuilder< FolderTy, InserterTy >
decltype(auto) cast(const From &Val)
cast - Return the argument parameter cast to the specified type.
PointerUnion< Instruction *, DbgRecord * > DbgInstPtr
A single checksum, represented by a Kind and a Value (a string).