38 cl::desc(
"Enable adding flow sensitive discriminators"));
46 std::numeric_limits<uint64_t>::max(), std::numeric_limits<uint64_t>::min()};
50 Fragment(DVR->getExpression()->getFragmentInfo()),
57DILocation::DILocation(
LLVMContext &
C, StorageType Storage,
unsigned Line,
58 unsigned Column, uint64_t AtomGroup,
uint8_t AtomRank,
61 :
MDNode(
C, DILocationKind, Storage, MDs), AtomGroup(AtomGroup),
62 AtomRank(AtomRank), HasIRLayers(HasIRLayers) {
63 assert(AtomRank <= 7 &&
"AtomRank number should fit in 3 bits");
64 assert(AtomGroup < (1ULL << 60) &&
"AtomGroup number should fit in 60 bits");
66 C.updateDILocationAtomGroupWaterline(AtomGroup + 1);
69 "Expected a scope and optional inlined-at + irlayers");
71 assert(Column < (1u << 16) &&
"Expected 16-bit column");
73 SubclassData32 = Line;
74 SubclassData16 = Column;
76 setImplicitCode(ImplicitCode);
81 if (Column >= (1u << 16))
87 Metadata *InlinedAt,
bool ImplicitCode,
88 uint64_t AtomGroup, uint8_t AtomRank,
89 Metadata *IRLayers, StorageType Storage,
95 if (AtomGroup >= (1ULL << 60))
100 Context.pImpl->DILocations,
107 assert(ShouldCreate &&
"Expected non-uniqued nodes to always be created");
119 Storage, Context.pImpl->DILocations);
123 Metadata *File,
unsigned Line,
unsigned Column,
124 StorageType Storage,
bool ShouldCreate) {
130 if (
auto *
N =
getUniqued(Context.pImpl->DILayerLocs,
131 DILayerLocInfo::KeyTy(Kind, File, Line, Column)))
138 DILayerLoc(Context,
Storage, Line, Column,
Ops),
139 Storage, Context.pImpl->DILayerLocs);
148 DILayerLocListInfo::KeyTy
Key(Layers);
153 Hash =
Key.getHash();
155 assert(ShouldCreate &&
"Expected non-uniqued nodes to always be created");
158 DILayerLocList(Context,
Storage, Hash, Layers),
159 Storage, Context.pImpl->DILayerLocLists);
162void DILayerLocList::recalculateHash() {
163 setHash(DILayerLocListInfo::KeyTy::calculateHash(
this));
169 if (Locs.
size() == 1)
171 auto *Merged = Locs[0];
174 if (Merged ==
nullptr)
182 TempMDNode ClonedScope = LBB->
clone();
197 return {LB->getLine(), LB->getColumn()};
199 return {SP->getLine(), 0u};
205template <
typename MatcherT>
206static std::pair<DIScope *, LineColumn>
213 LineColumn Loc1(L1->getLine(), L1->getColumn());
214 for (;
S1;
S1 =
S1->getScope()) {
216 Matcher.insert(
S1, Loc1);
221 LineColumn Loc2(L2->getLine(), L2->getColumn());
225 if (
DIScope *S = Matcher.match(S2, Loc2))
226 return std::make_pair(S, Loc2);
231 return std::make_pair(
nullptr,
LineColumn(L2->getLine(), L2->getColumn()));
241 return Scopes.contains(S) ? S :
nullptr;
258 if (ScopesAtLoc ==
Scopes.end())
262 if (ScopesAtLoc->second.contains(S))
265 if (!ScopesAtLoc->second.empty())
266 return *ScopesAtLoc->second.begin();
286 using LayerKey = std::tuple<Metadata *, Metadata *, unsigned, unsigned>;
288 return LayerKey(L->getRawKind(), L->getRawFile(), L->getLine(),
314 DILocation *
Loc = LocA ? LocA : LocB;
319 auto A = std::make_tuple(LocA->getLine(), LocA->getColumn(),
320 LocA->getDiscriminator(), LocA->getFilename(),
321 LocA->getDirectory());
322 auto B = std::make_tuple(LocB->getLine(), LocB->getColumn(),
323 LocB->getDiscriminator(), LocB->getFilename(),
324 LocB->getDirectory());
325 return A <
B ? LocA : LocB;
343 for (
auto [L,
I] = std::make_pair(LocA, 0U); L; L = L->getInlinedAt(),
I++) {
346 {L->getScope()->getSubprogram(), L->getInlinedAt()},
I);
347 assert(Res.second &&
"Multiple <SP, InlinedAt> pairs in a location chain?");
351 LocVec::reverse_iterator ARIt = ALocs.rend();
352 LocVec::reverse_iterator BRIt = BLocs.rend();
358 for (
auto [L,
I] = std::make_pair(LocB, 0U); L; L = L->getInlinedAt(),
I++) {
361 if (ARIt != ALocs.rend())
365 auto IT = ALookup.
find({L->getScope()->getSubprogram(), L->getInlinedAt()});
366 if (IT == ALookup.
end())
370 ARIt = LocVec::reverse_iterator(ALocs.begin() + IT->second + 1);
371 BRIt = LocVec::reverse_iterator(BLocs.begin() +
I + 1);
382 auto *LocAIA = LocA->getInlinedAt();
383 auto *LocBIA = LocB->getInlinedAt();
384 auto MergeLocPair = [&
C, LocAIA,
385 LocBIA](
const DILocation *L1,
const DILocation *L2,
390 L1->getAtomGroup(), L1->getAtomRank(),
391 L1->getRawIRLayers());
395 if (L1->getScope()->getSubprogram() != L2->getScope()->getSubprogram())
404 assert(
Scope &&
"No common scope in the same subprogram?");
407 if (
Scope->getFile() != L1->getFile() || L1->getFile() != L2->getFile()) {
408 auto [CommonLocScope, CommonLoc] =
418 Scope = CommonLocScope;
422 if (
Scope->getFile() != L1->getFile() || L1->getFile() != L2->getFile())
429 bool SameLine = L1->getLine() == L2->getLine();
430 bool SameCol = L1->getColumn() == L2->getColumn();
431 unsigned Line = SameLine ? L1->getLine() : 0;
432 unsigned Col = SameLine && SameCol ? L1->getColumn() : 0;
433 bool IsImplicitCode = L1->isImplicitCode() && L2->isImplicitCode();
437 if (!SameLine || !(L1->getAtomGroup() || L2->getAtomGroup()))
445 if (LocBIA == LocAIA &&
InlinedAt == LocBIA) {
450 bool UseL1Atom = [L1, L2]() {
451 if (L1->getAtomRank() == L2->getAtomRank()) {
453 if (!L1->getAtomGroup() || !L2->getAtomGroup())
454 return !L2->getAtomGroup();
455 return L1->getAtomGroup() < L2->getAtomGroup();
458 if (!L1->getAtomRank() || !L2->getAtomRank())
459 return !L2->getAtomRank();
460 return L1->getAtomRank() < L2->getAtomRank();
462 Group = UseL1Atom ? L1->getAtomGroup() : L2->getAtomGroup();
463 Rank = UseL1Atom ? L1->getAtomRank() : L2->getAtomRank();
469 Group =
C.incNextDILocationAtomGroup();
473 Group, Rank, MergedLayers);
476 DILocation *Result = ARIt != ALocs.rend() ? (*ARIt)->getInlinedAt() :
nullptr;
480 for (; ARIt != ALocs.rend() && BRIt != BLocs.rend(); ++ARIt, ++BRIt) {
481 DILocation *Tmp = MergeLocPair(*ARIt, *BRIt, Result);
506std::optional<unsigned>
508 std::array<unsigned, 3> Components = {BD,
DF, CI};
509 uint64_t RemainingWork = 0U;
516 std::accumulate(Components.begin(), Components.end(), RemainingWork);
520 unsigned NextBitInsertionIndex = 0;
521 while (RemainingWork > 0) {
522 unsigned C = Components[
I++];
525 Ret |= (EC << NextBitInsertionIndex);
533 unsigned TBD, TDF, TCI = 0;
535 if (TBD == BD && TDF ==
DF && TCI == CI)
551#define HANDLE_DI_FLAG(ID, NAME) .Case("DIFlag" #NAME, Flag##NAME)
552#include "llvm/IR/DebugInfoFlags.def"
558#define HANDLE_DI_FLAG(ID, NAME) \
560 return "DIFlag" #NAME;
561#include "llvm/IR/DebugInfoFlags.def"
572 if (
A == FlagPrivate)
574 else if (
A == FlagProtected)
581 if (R == FlagSingleInheritance)
582 SplitFlags.
push_back(FlagSingleInheritance);
583 else if (R == FlagMultipleInheritance)
584 SplitFlags.
push_back(FlagMultipleInheritance);
586 SplitFlags.
push_back(FlagVirtualInheritance);
589 if ((Flags & FlagIndirectVirtualBase) == FlagIndirectVirtualBase) {
590 Flags &= ~FlagIndirectVirtualBase;
591 SplitFlags.
push_back(FlagIndirectVirtualBase);
594#define HANDLE_DI_FLAG(ID, NAME) \
595 if (DIFlags Bit = Flags & Flag##NAME) { \
596 SplitFlags.push_back(Bit); \
599#include "llvm/IR/DebugInfoFlags.def"
605 return T->getScope();
608 return SP->getScope();
611 return LB->getScope();
614 return NS->getScope();
617 return CB->getScope();
620 return M->getScope();
623 "Unhandled type of scope.");
631 return SP->getName();
633 return NS->getName();
635 return CB->getName();
640 "Unhandled type of scope.");
654 StorageType Storage,
bool ShouldCreate) {
662 Hash =
Key.getHash();
664 assert(ShouldCreate &&
"Expected non-uniqued nodes to always be created");
672 Storage, Context.pImpl->GenericDINodes);
675void GenericDINode::recalculateHash() {
676 setHash(GenericDINodeInfo::KeyTy::calculateHash(
this));
679#define UNWRAP_ARGS_IMPL(...) __VA_ARGS__
680#define UNWRAP_ARGS(ARGS) UNWRAP_ARGS_IMPL ARGS
681#define DEFINE_GETIMPL_LOOKUP(CLASS, ARGS) \
683 if (Storage == Uniqued) { \
684 if (auto *N = getUniqued(Context.pImpl->CLASS##s, \
685 CLASS##Info::KeyTy(UNWRAP_ARGS(ARGS)))) \
690 assert(ShouldCreate && \
691 "Expected non-uniqued nodes to always be created"); \
694#define DEFINE_GETIMPL_STORE(CLASS, ARGS, OPS) \
695 return storeImpl(new (std::size(OPS), Storage) \
696 CLASS(Context, Storage, UNWRAP_ARGS(ARGS), OPS), \
697 Storage, Context.pImpl->CLASS##s)
698#define DEFINE_GETIMPL_STORE_NO_OPS(CLASS, ARGS) \
699 return storeImpl(new (0u, Storage) \
700 CLASS(Context, Storage, UNWRAP_ARGS(ARGS)), \
701 Storage, Context.pImpl->CLASS##s)
702#define DEFINE_GETIMPL_STORE_NO_CONSTRUCTOR_ARGS(CLASS, OPS) \
703 return storeImpl(new (std::size(OPS), Storage) CLASS(Context, Storage, OPS), \
704 Storage, Context.pImpl->CLASS##s)
705#define DEFINE_GETIMPL_STORE_N(CLASS, ARGS, OPS, NUM_OPS) \
706 return storeImpl(new (NUM_OPS, Storage) \
707 CLASS(Context, Storage, UNWRAP_ARGS(ARGS), OPS), \
708 Storage, Context.pImpl->CLASS##s)
710DISubrange::DISubrange(
LLVMContext &
C, StorageType Storage,
712 :
DINode(
C, DISubrangeKind, Storage,
dwarf::DW_TAG_subrange_type,
Ops) {}
714 StorageType Storage,
bool ShouldCreate) {
724 int64_t
Lo, StorageType Storage,
734 StorageType Storage,
bool ShouldCreate) {
747 "Count must be signed constant or DIVariable or DIExpression");
753 return BoundType(MD);
756 return BoundType(MD);
768 "LowerBound must be signed constant or DIVariable or DIExpression");
774 return BoundType(MD);
777 return BoundType(MD);
789 "UpperBound must be signed constant or DIVariable or DIExpression");
795 return BoundType(MD);
798 return BoundType(MD);
810 "Stride must be signed constant or DIVariable or DIExpression");
816 return BoundType(MD);
819 return BoundType(MD);
823DIGenericSubrange::DIGenericSubrange(
LLVMContext &
C, StorageType Storage,
825 :
DINode(
C, DIGenericSubrangeKind, Storage,
dwarf::DW_TAG_generic_subrange,
844 "Count must be signed constant or DIVariable or DIExpression");
861 "LowerBound must be signed constant or DIVariable or DIExpression");
878 "UpperBound must be signed constant or DIVariable or DIExpression");
895 "Stride must be signed constant or DIVariable or DIExpression");
906DISubrangeType::DISubrangeType(
LLVMContext &
C, StorageType Storage,
907 unsigned Line,
uint32_t AlignInBits,
909 :
DIType(
C, DISubrangeTypeKind, Storage,
dwarf::DW_TAG_subrange_type, Line,
910 AlignInBits, 0, Flags,
Ops) {}
927DISubrangeType::convertRawToBound(
Metadata *IN)
const {
949DIEnumerator::DIEnumerator(
LLVMContext &
C, StorageType Storage,
958 StorageType Storage,
bool ShouldCreate) {
980 DataSizeInBits,
Flags),
986 case dwarf::DW_ATE_signed:
987 case dwarf::DW_ATE_signed_char:
988 case dwarf::DW_ATE_signed_fixed:
990 case dwarf::DW_ATE_unsigned:
991 case dwarf::DW_ATE_unsigned_char:
992 case dwarf::DW_ATE_unsigned_fixed:
1003 unsigned Encoding, DIFlags Flags,
unsigned Kind,
1004 int Factor,
APInt Numerator,
APInt Denominator,
1005 StorageType Storage,
bool ShouldCreate) {
1018 return getEncoding() == dwarf::DW_ATE_signed_fixed;
1021std::optional<DIFixedPointType::FixedPointKind>
1047 unsigned Encoding,
Metadata *CharType,
1048 StorageType Storage,
bool ShouldCreate) {
1068 if (Tuple->getNumOperands() != 1)
1070 ED = Tuple->getOperand(0);
1079 return static_cast<uint32_t>(CI->getZExtValue());
1085 return C->getValue();
1091 getTag() == dwarf::DW_TAG_variable) &&
1094 return C->getValue();
1100 return C->getValue();
1108 std::optional<unsigned> DWARFAddressSpace,
1109 std::optional<PtrAuthData> PtrAuthData, DIFlags Flags,
Metadata *ExtraData,
1123std::optional<DIDerivedType::PtrAuthData>
1124DIDerivedType::getPtrAuthData()
const {
1125 return getTag() == dwarf::DW_TAG_LLVM_ptrauth_type
1133 uint32_t AlignInBits,
Metadata *OffsetInBits, DIFlags Flags,
1134 Metadata *Elements,
unsigned RuntimeLang, std::optional<uint32_t> EnumKind,
1138 Metadata *Specification, uint32_t NumExtraInhabitants,
Metadata *BitStride,
1139 StorageType Storage,
bool ShouldCreate) {
1163 if (!ExistingSize || !SizeInBits || ExistingSize == SizeInBits)
1169 if ((ExistingCI && ExistingCI->isZero()) ||
1170 (IncomingCI && IncomingCI->isZero()))
1172 if (ExistingCI && IncomingCI)
1173 return ExistingCI->getZExtValue() != IncomingCI->getZExtValue();
1182 Metadata *
Elements,
unsigned RuntimeLang, std::optional<uint32_t> EnumKind,
1187 if (!
Context.isODRUniquingDebugTypes())
1202 if (!CT->isForwardDecl() || (
Flags & DINode::FlagFwdDecl))
1213 assert((std::end(
Ops) - std::begin(
Ops)) == (
int)CT->getNumOperands() &&
1214 "Mismatched number of operands");
1215 for (
unsigned I = 0, E = CT->getNumOperands();
I != E; ++
I)
1216 if (
Ops[
I] != CT->getOperand(
I))
1217 CT->setOperand(
I,
Ops[
I]);
1226 Metadata *Elements,
unsigned RuntimeLang, std::optional<uint32_t> EnumKind,
1230 assert(!Identifier.getString().empty() &&
"Expected valid identifier");
1231 if (!
Context.isODRUniquingDebugTypes())
1233 auto *&CT = (*
Context.pImpl->DITypeMap)[&Identifier];
1251 if (!
Context.isODRUniquingDebugTypes())
1255DISubroutineType::DISubroutineType(
LLVMContext &
C, StorageType Storage,
1258 :
DIType(
C, DISubroutineTypeKind, Storage,
dwarf::DW_TAG_subroutine_type, 0,
1264 StorageType Storage,
1265 bool ShouldCreate) {
1272 std::optional<ChecksumInfo<MDString *>> CS,
MDString *Src,
1275 Checksum(CS),
Source(Src) {}
1285StringRef DIFile::getChecksumKindAsString(ChecksumKind CSKind) {
1293std::optional<DIFile::ChecksumKind>
1305 MDString *Source, StorageType Storage,
1306 bool ShouldCreate) {
1316DICompileUnit::DICompileUnit(
LLVMContext &
C, StorageType Storage,
1318 bool IsOptimized,
unsigned RuntimeVersion,
1319 unsigned EmissionKind,
uint64_t DWOId,
1320 bool SplitDebugInlining,
1321 bool DebugInfoForProfiling,
unsigned NameTableKind,
1326 IsOptimized(IsOptimized), SplitDebugInlining(SplitDebugInlining),
1327 DebugInfoForProfiling(DebugInfoForProfiling),
1328 RangesBaseAddress(RangesBaseAddress) {
1335 unsigned RuntimeVersion,
MDString *SplitDebugFilename,
1338 uint64_t DWOId,
bool SplitDebugInlining,
bool DebugInfoForProfiling,
1339 unsigned NameTableKind,
bool RangesBaseAddress,
MDString *SysRoot,
1340 MDString *SDK, StorageType Storage,
bool ShouldCreate) {
1358 Context,
Storage, SourceLanguage, IsOptimized,
1359 RuntimeVersion, EmissionKind, DWOId, SplitDebugInlining,
1360 DebugInfoForProfiling, NameTableKind, RangesBaseAddress,
1365std::optional<DICompileUnit::DebugEmissionKind>
1375std::optional<DICompileUnit::DebugNameTableKind>
1392 return "LineTablesOnly";
1394 return "DebugDirectivesOnly";
1412DISubprogram::DISubprogram(
LLVMContext &
C, StorageType Storage,
unsigned Line,
1413 unsigned ScopeLine,
unsigned VirtualIndex,
1414 int ThisAdjustment, DIFlags Flags, DISPFlags SPFlags,
1417 Line(Line), ScopeLine(ScopeLine), VirtualIndex(VirtualIndex),
1418 ThisAdjustment(ThisAdjustment), Flags(Flags), SPFlags(SPFlags) {
1424 unsigned Virtuality,
bool IsMainSubprogram) {
1426 static_assert(int(SPFlagVirtual) == int(dwarf::DW_VIRTUALITY_virtual) &&
1427 int(SPFlagPureVirtual) ==
1428 int(dwarf::DW_VIRTUALITY_pure_virtual),
1429 "Virtuality constant mismatch");
1432 (IsLocalToUnit ? SPFlagLocalToUnit : SPFlagZero) |
1433 (IsDefinition ? SPFlagDefinition : SPFlagZero) |
1434 (IsOptimized ? SPFlagOptimized : SPFlagZero) |
1435 (IsMainSubprogram ? SPFlagMainSubprogram : SPFlagZero));
1440 return Block->getScope()->getSubprogram();
1446 return File->getScope()->getNonLexicalBlockFileScope();
1454 DIScope *CachedResult =
nullptr;
1457 Scope = Scope->getScope()) {
1458 if (
auto It = Cache.find(Scope); It != Cache.end()) {
1467 DIScope *UpdatedScope = CachedResult ? CachedResult : &NewSP;
1471 Cache[ScopeToUpdate] = UpdatedScope;
1479#define HANDLE_DISP_FLAG(ID, NAME) .Case("DISPFlag" #NAME, SPFlag##NAME)
1480#include "llvm/IR/DebugInfoFlags.def"
1489#define HANDLE_DISP_FLAG(ID, NAME) \
1490 case SPFlag##NAME: \
1491 return "DISPFlag" #NAME;
1492#include "llvm/IR/DebugInfoFlags.def"
1503#define HANDLE_DISP_FLAG(ID, NAME) \
1504 if (DISPFlags Bit = Flags & SPFlag##NAME) { \
1505 SplitFlags.push_back(Bit); \
1508#include "llvm/IR/DebugInfoFlags.def"
1515 unsigned ScopeLine,
Metadata *ContainingType,
unsigned VirtualIndex,
1516 int ThisAdjustment, DIFlags Flags, DISPFlags SPFlags,
Metadata *Unit,
1519 bool UsesKeyInstructions, StorageType Storage,
bool ShouldCreate) {
1549 (Line, ScopeLine, VirtualIndex, ThisAdjustment, Flags,
1555 assert(
F &&
"Invalid function");
1556 return F->getSubprogram() ==
this;
1559template <
typename ScopeT,
typename NodeT>
1561 auto getScopeLambda = [](
auto *
N) {
return getScope(
N); };
1562 return DISubprogram::visitRetainedNode<ScopeT>(
1563 N, getScopeLambda, getScopeLambda, getScopeLambda, getScopeLambda,
1564 getScopeLambda, [](
auto *
N) {
return nullptr; });
1591 DISubprogram *TypeSP =
nullptr;
1594 TypeSP = LS->getSubprogram();
1596 return this == TypeSP;
1609 unsigned Column, StorageType Storage,
1610 bool ShouldCreate) {
1614 assert(Scope &&
"Expected scope");
1622 unsigned Discriminator,
1623 StorageType Storage,
1624 bool ShouldCreate) {
1637 MDString *Name,
bool ExportSymbols,
1638 StorageType Storage,
bool ShouldCreate) {
1655 StorageType Storage,
bool ShouldCreate) {
1673 unsigned LineNo,
bool IsDecl, StorageType Storage,
1674 bool ShouldCreate) {
1683 StorageType Storage,
1687 dwarf::DW_TAG_template_type_parameter, IsDefault,
1693 StorageType Storage,
bool ShouldCreate) {
1702 bool isDefault,
Metadata *
Value, StorageType Storage,
bool ShouldCreate) {
1714 Metadata *StaticDataMemberDeclaration,
1715 Metadata *TemplateParams, uint32_t AlignInBits,
1717 bool ShouldCreate) {
1740 unsigned Arg, DIFlags Flags, uint32_t AlignInBits,
1742 bool ShouldCreate) {
1744 assert(Arg <= UINT16_MAX &&
"Expected argument number to fit in 16-bits");
1766 if (uint64_t
Size =
T->getSizeInBits())
1771 RawType = DT->getRawBaseType();
1780 return std::nullopt;
1783DILabel::DILabel(
LLVMContext &
C, StorageType Storage,
unsigned Line,
1784 unsigned Column,
bool IsArtificial,
1785 std::optional<unsigned> CoroSuspendIdx,
1789 this->Column = Column;
1790 this->IsArtificial = IsArtificial;
1791 this->CoroSuspendIdx = CoroSuspendIdx;
1794 Metadata *File,
unsigned Line,
unsigned Column,
1796 std::optional<unsigned> CoroSuspendIdx,
1797 StorageType Storage,
bool ShouldCreate) {
1798 assert(Scope &&
"Expected scope");
1809 StorageType Storage,
bool ShouldCreate) {
1815 return singleLocElts->size() > 0 &&
1822 return singleLocElts->size() > 0 &&
1823 (*singleLocElts)[0] == dwarf::DW_OP_deref;
1828 return singleLocElts->size() == 1 &&
1829 (*singleLocElts)[0] == dwarf::DW_OP_deref;
1834 bool ShouldCreate) {
1841 uint64_t Op =
getOp();
1843 if (Op >= dwarf::DW_OP_breg0 && Op <= dwarf::DW_OP_breg31)
1851 case dwarf::DW_OP_bregx:
1853 case dwarf::DW_OP_constu:
1854 case dwarf::DW_OP_consts:
1855 case dwarf::DW_OP_deref_size:
1856 case dwarf::DW_OP_xderef_size:
1857 case dwarf::DW_OP_plus_uconst:
1861 case dwarf::DW_OP_regx:
1902 return Op->is(dwarf::DW_OP_constu);
1906 return Op->is(dwarf::DW_OP_plus_uconst);
1910 return Op >= dwarf::DW_OP_lit0 &&
Op <= dwarf::DW_OP_lit31;
1916 if (
I->getSize() >
static_cast<uint64_t
>(E->get() -
I->get()))
1919 uint64_t
Op =
I->getOp();
1920 if ((
Op >= dwarf::DW_OP_reg0 &&
Op <= dwarf::DW_OP_reg31) ||
1921 (
Op >= dwarf::DW_OP_breg0 &&
Op <= dwarf::DW_OP_breg31) ||
isLitOp(
Op))
1930 return I->get() +
I->getSize() == E->get();
1931 case dwarf::DW_OP_stack_value: {
1933 if (
I->get() +
I->getSize() == E->get())
1940 case dwarf::DW_OP_swap: {
1961 if (
I->get() != FirstOp->get() ||
1966 case dwarf::DW_OP_deref_size:
1967 case dwarf::DW_OP_xderef_size:
1978 case dwarf::DW_OP_constu:
1979 case dwarf::DW_OP_plus_uconst:
1980 case dwarf::DW_OP_plus:
1981 case dwarf::DW_OP_minus:
1982 case dwarf::DW_OP_mul:
1983 case dwarf::DW_OP_div:
1984 case dwarf::DW_OP_mod:
1985 case dwarf::DW_OP_or:
1986 case dwarf::DW_OP_and:
1987 case dwarf::DW_OP_xor:
1988 case dwarf::DW_OP_shl:
1989 case dwarf::DW_OP_shr:
1990 case dwarf::DW_OP_shra:
1991 case dwarf::DW_OP_deref:
1992 case dwarf::DW_OP_xderef:
1993 case dwarf::DW_OP_not:
1994 case dwarf::DW_OP_dup:
1995 case dwarf::DW_OP_regx:
1996 case dwarf::DW_OP_bregx:
1997 case dwarf::DW_OP_push_object_address:
1998 case dwarf::DW_OP_over:
1999 case dwarf::DW_OP_rot:
2000 case dwarf::DW_OP_consts:
2001 case dwarf::DW_OP_eq:
2002 case dwarf::DW_OP_ne:
2003 case dwarf::DW_OP_gt:
2004 case dwarf::DW_OP_ge:
2005 case dwarf::DW_OP_lt:
2006 case dwarf::DW_OP_le:
2007 case dwarf::DW_OP_neg:
2008 case dwarf::DW_OP_abs:
2022 for (
const auto &It :
expr_ops()) {
2023 switch (It.getOp()) {
2026 case dwarf::DW_OP_stack_value:
2043 for (
const auto &It :
expr_ops()) {
2044 if (It.isNonEmitting())
2046 switch (It.getOp()) {
2065 auto ExprOpBegin =
expr_ops().begin();
2068 if (Arg.getIndex() != 0)
2073 return !std::any_of(ExprOpBegin, ExprOpEnd,
2077std::optional<ArrayRef<uint64_t>>
2081 return std::nullopt;
2107 return ExprOp.getOp() == dwarf::DW_OP_LLVM_arg;
2117std::optional<const DIExpression *>
2120 return std::nullopt;
2125 return std::nullopt;
2129 const DIExpression *Expr,
2134 return ExprOp.getOp() == dwarf::DW_OP_LLVM_arg;
2147 if (
Op.getOp() == dwarf::DW_OP_stack_value ||
2149 Ops.push_back(dwarf::DW_OP_deref);
2152 Op.appendToVector(
Ops);
2155 Ops.push_back(dwarf::DW_OP_deref);
2160 const DIExpression *SecondExpr,
2161 bool SecondIndirect) {
2167 return FirstOps == SecondOps;
2170std::optional<DIExpression::FragmentInfo>
2172 for (
auto I = Start;
I !=
End; ++
I)
2175 return std::nullopt;
2179 std::optional<uint64_t> InitialActiveBits = Var->
getSizeInBits();
2180 std::optional<uint64_t> ActiveBits = InitialActiveBits;
2181 auto NarrowActiveBits = [&](uint64_t SizeInBits) {
2182 ActiveBits = ActiveBits ? std::min(*ActiveBits, SizeInBits) : SizeInBits;
2186 switch (
Op.getOp()) {
2190 ActiveBits = InitialActiveBits;
2197 std::optional<DIBasicType::Signedness> VarSign = Var->
getSignedness();
2199 if (!VarSign || VarSigned != Extract.isSigned()) {
2200 ActiveBits = InitialActiveBits;
2203 NarrowActiveBits(Extract.getSizeInBits());
2217 Ops.push_back(dwarf::DW_OP_plus_uconst);
2220 Ops.push_back(dwarf::DW_OP_constu);
2223 uint64_t AbsMinusOne = -(
Offset+1);
2224 Ops.push_back(AbsMinusOne + 1);
2225 Ops.push_back(dwarf::DW_OP_minus);
2231 if (!SingleLocEltsOpt)
2233 auto SingleLocElts = *SingleLocEltsOpt;
2235 if (SingleLocElts.size() == 0) {
2240 if (SingleLocElts.size() == 2 &&
2241 SingleLocElts[0] == dwarf::DW_OP_plus_uconst) {
2242 Offset = SingleLocElts[1];
2246 if (SingleLocElts.size() == 3 && SingleLocElts[0] == dwarf::DW_OP_constu) {
2247 if (SingleLocElts[2] == dwarf::DW_OP_plus) {
2248 Offset = SingleLocElts[1];
2251 if (SingleLocElts[2] == dwarf::DW_OP_minus) {
2252 Offset = -SingleLocElts[1];
2264 RemainingOps.
clear();
2268 while (ExprOpIt != ExprOpEnd) {
2269 uint64_t
Op = ExprOpIt->getOp();
2270 if (
Op == dwarf::DW_OP_deref ||
Op == dwarf::DW_OP_deref_size ||
2280 if (ExprOpIt->getOp() == dwarf::DW_OP_plus)
2281 OffsetInBytes +=
Value;
2282 else if (ExprOpIt->getOp() == dwarf::DW_OP_minus)
2283 OffsetInBytes -=
Value;
2292 RemainingOps.
append(ExprOpIt.getBase(), ExprOpEnd.getBase());
2299 if (!SingleLocEltsOpt) {
2301 RemainingOps.
clear();
2312 SeenOps.
insert(Arg.getIndex());
2313 for (uint64_t Idx = 0; Idx <
N; ++Idx)
2320 unsigned &AddrClass) {
2324 if (!SingleLocEltsOpt)
2337 if (!SwapOp.
is(dwarf::DW_OP_swap) || !(XDerefOp.
is(dwarf::DW_OP_xderef) ||
2338 XDerefOp.
is(dwarf::DW_OP_xderef_size)))
2341 uint64_t
Op = AddrSpaceOp.
getOp();
2342 if (
Op == dwarf::DW_OP_constu)
2343 AddrClass = AddrSpaceOp.
getArg(0);
2345 AddrClass =
Op - dwarf::DW_OP_lit0;
2349 if (AddrSpaceOp.
get() == SingleLocElts.
begin())
2359 Ops.push_back(dwarf::DW_OP_deref);
2363 Ops.push_back(dwarf::DW_OP_deref);
2374 assert(Expr &&
"Can't add ops to this expression");
2378 [](
auto Op) { return Op.is(dwarf::DW_OP_LLVM_arg); })) {
2380 "Location Index must be 0 for a non-variadic expression.");
2389 if (
Op.getOp() == dwarf::DW_OP_stack_value)
2392 NewOps.
push_back(dwarf::DW_OP_stack_value);
2396 Op.appendToVector(NewOps);
2401 NewOps.
push_back(dwarf::DW_OP_stack_value);
2407 uint64_t OldArg, uint64_t NewArg) {
2408 assert(Expr &&
"Can't replace args in this expression");
2414 if (!Arg || Arg.getIndex() < OldArg) {
2415 Op.appendToVector(NewOps);
2419 uint64_t ArgIndex = Arg.getIndex() == OldArg ? NewArg : Arg.getIndex();
2422 if (ArgIndex > OldArg)
2432 assert(Expr &&
"Can't prepend ops to this expression");
2448 if (
Op.getOp() == dwarf::DW_OP_stack_value)
2451 Ops.push_back(dwarf::DW_OP_stack_value);
2455 Op.appendToVector(
Ops);
2458 Ops.push_back(dwarf::DW_OP_stack_value);
2464 assert(Expr && !
Ops.empty() &&
"Can't append ops to this expression");
2470 if (
Op.getOp() == dwarf::DW_OP_stack_value ||
2477 Op.appendToVector(NewOps);
2482 assert(result->isValid() &&
"concatenated expression is not valid");
2488 assert(Expr && !
Ops.empty() &&
"Can't append ops to this expression");
2492 return Op.getOp() == dwarf::DW_OP_stack_value ||
2493 Op.getOp() == dwarf::DW_OP_LLVM_fragment;
2495 "Can't append this op");
2500 std::optional<uint64_t> LastValueOp;
2504 LastValueOp =
Op.getOp();
2506 bool NeedsDeref = LastValueOp && *LastValueOp != dwarf::DW_OP_stack_value;
2507 bool NeedsStackValue = NeedsDeref || !LastValueOp;
2515 if (NeedsStackValue)
2516 NewOps.
push_back(dwarf::DW_OP_stack_value);
2521 const DIExpression *Expr,
unsigned OffsetInBits,
unsigned SizeInBits) {
2525 bool CanSplitValue =
true;
2527 bool EmitFragment =
true;
2531 switch (
Op.getOp()) {
2534 case dwarf::DW_OP_shr:
2535 case dwarf::DW_OP_shra:
2536 case dwarf::DW_OP_shl:
2537 case dwarf::DW_OP_plus:
2538 case dwarf::DW_OP_plus_uconst:
2539 case dwarf::DW_OP_minus:
2545 CanSplitValue =
false;
2547 case dwarf::DW_OP_deref:
2548 case dwarf::DW_OP_deref_size:
2549 case dwarf::DW_OP_deref_type:
2550 case dwarf::DW_OP_xderef:
2551 case dwarf::DW_OP_xderef_size:
2552 case dwarf::DW_OP_xderef_type:
2555 CanSplitValue =
true;
2557 case dwarf::DW_OP_stack_value:
2560 return std::nullopt;
2568 return std::nullopt;
2570 uint64_t FragmentOffsetInBits =
Fragment.getOffsetInBits();
2571 uint64_t FragmentSizeInBits =
Fragment.getSizeInBits();
2572 (void)FragmentSizeInBits;
2573 assert((OffsetInBits + SizeInBits <= FragmentSizeInBits) &&
2574 "new fragment outside of original fragment");
2575 OffsetInBits += FragmentOffsetInBits;
2584 uint64_t ExtractOffsetInBits = Extract.getOffsetInBits();
2585 uint64_t ExtractSizeInBits = Extract.getSizeInBits();
2586 if (ExtractOffsetInBits >= OffsetInBits &&
2587 ExtractOffsetInBits + ExtractSizeInBits <=
2588 OffsetInBits + SizeInBits) {
2589 Ops.push_back(
Op.getOp());
2590 Ops.push_back(ExtractOffsetInBits - OffsetInBits);
2591 Ops.push_back(ExtractSizeInBits);
2592 EmitFragment =
false;
2598 return std::nullopt;
2601 Op.appendToVector(
Ops);
2605 assert(Expr &&
"Unknown DIExpression");
2608 Ops.push_back(OffsetInBits);
2609 Ops.push_back(SizeInBits);
2617 uint64_t SliceSizeInBits,
const Value *DbgPtr, int64_t DbgPtrOffsetInBits,
2619 std::optional<DIExpression::FragmentInfo> &Result,
2620 int64_t &OffsetFromLocationInBits) {
2632 int64_t MemStartRelToDbgStartInBits;
2635 if (!MemOffsetFromDbgInBytes)
2638 MemStartRelToDbgStartInBits = *MemOffsetFromDbgInBytes * 8;
2640 MemStartRelToDbgStartInBits +=
2641 SliceOffsetInBits - (DbgPtrOffsetInBits + DbgExtractOffsetInBits);
2645 OffsetFromLocationInBits = -MemStartRelToDbgStartInBits;
2648 int64_t MemEndRelToDbgStart = MemStartRelToDbgStartInBits + SliceSizeInBits;
2649 if (MemEndRelToDbgStart < 0) {
2661 int64_t MemStartRelToVarInBits =
2663 int64_t MemEndRelToVarInBits = MemStartRelToVarInBits + SliceSizeInBits;
2668 int64_t MemFragStart = std::max<int64_t>(0, MemStartRelToVarInBits);
2669 int64_t MemFragSize =
2670 std::max<int64_t>(0, MemEndRelToVarInBits - MemFragStart);
2676 if (TrimmedSliceOfVariable == VarFrag)
2677 Result = std::nullopt;
2679 Result = TrimmedSliceOfVariable;
2683std::pair<DIExpression *, const ConstantInt *>
2693 switch (
Op.getOp()) {
2707 if (Convert.getEncoding() == dwarf::DW_ATE_signed)
2708 NewInt = NewInt.
sextOrTrunc(Convert.getBitSize());
2710 assert(Convert.getEncoding() == dwarf::DW_ATE_unsigned &&
2711 "Unexpected operand");
2712 NewInt = NewInt.
zextOrTrunc(Convert.getBitSize());
2717 Op.appendToVector(
Ops);
2726 uint64_t Result = 0;
2729 Result = std::max(Result, Arg.getIndex() + 1);
2731 "Expression is missing one or more location operands.");
2735std::optional<DIExpression::SignedOrUnsignedConstant>
2746 return std::nullopt;
2748 if (
Op != dwarf::DW_OP_consts &&
Op != dwarf::DW_OP_constu && !
isLitOp(
Op))
2749 return std::nullopt;
2757 if (NumElements != ConstSize && NumElements != ConstSize + 1 &&
2758 NumElements != ConstSize + 4)
2759 return std::nullopt;
2761 if (NumElements == ConstSize &&
Op == dwarf::DW_OP_consts)
2764 if ((NumElements == ConstSize + 1 &&
2765 getElement(ConstSize) != dwarf::DW_OP_stack_value) ||
2766 (NumElements == ConstSize + 4 &&
2767 (
getElement(ConstSize) != dwarf::DW_OP_stack_value ||
2769 return std::nullopt;
2778 return Op - dwarf::DW_OP_lit0;
2791 unsigned FromSize,
unsigned ToSize,
2799 bool ShouldCreate) {
2807 : DINode(
C, DIObjCPropertyKind,
Storage, dwarf::DW_TAG_APPLE_property,
Ops),
2813 Metadata *
Type, StorageType Storage,
bool ShouldCreate) {
2823DIProperty::DIProperty(
LLVMContext &
C, StorageType Storage,
unsigned Line,
2830 Metadata *BackingStorage, StorageType Storage,
2831 bool ShouldCreate) {
2842 StorageType Storage,
2843 bool ShouldCreate) {
2853 bool ShouldCreate) {
2862 Metadata *Elements, StorageType Storage,
2863 bool ShouldCreate) {
2871 auto ExistingIt = Context.pImpl->DIArgLists.find_as(
DIArgListKeyInfo(Args));
2872 if (ExistingIt != Context.pImpl->DIArgLists.end())
2874 DIArgList *NewArgList =
new DIArgList(Context, Args);
2875 Context.pImpl->DIArgLists.insert(NewArgList);
2882 "DIArgList must be passed a ValueAsMetadata");
2889 if (&VM == OldVMPtr) {
2901 if (ExistingArgList) {
2911void DIArgList::track() {
2916void DIArgList::untrack() {
2921void DIArgList::dropAllReferences(
bool Untrack) {
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")
This file defines the DenseSet and SmallDenseSet classes.
static unsigned encodingBits(unsigned C)
static unsigned encodeComponent(unsigned C)
static unsigned getNextComponentInDiscriminator(unsigned D)
Returns the next component stored in discriminator.
static unsigned getUnsignedFromPrefixEncoding(unsigned U)
Reverse transformation as getPrefixEncodingFromUnsigned.
This file contains constants used for implementing Dwarf debug support.
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
static DebugLoc getDebugLoc(MachineBasicBlock::instr_iterator FirstMI, MachineBasicBlock::instr_iterator LastMI)
Return the first DebugLoc that has line number information, given a range of instructions.
static constexpr StringLiteral Filename
BaseType
A given derived pointer can have multiple base pointers through phi/selects.
This file implements a set that has insertion order iteration characteristics.
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
Class for arbitrary precision integers.
LLVM_ABI APInt zextOrTrunc(unsigned width) const
Zero extend or truncate to width.
LLVM_ABI APInt sextOrTrunc(unsigned width) const
Sign extend or truncate to width.
Annotations lets you mark points and ranges inside source code, for tests:
Represent a constant reference to an array (0 or more elements consecutively in memory),...
ArrayRef< T > drop_front(size_t N=1) const
Drop the first N elements of the array.
size_t size() const
Get the array size.
bool empty() const
Check if the array is empty.
This is the shared class of boolean and integer constants.
static ConstantInt * getSigned(IntegerType *Ty, int64_t V, bool ImplicitTrunc=false)
Return a ConstantInt with the specified value for the specified type.
const APInt & getValue() const
Return the constant as an APInt value reference.
This is an important base class in LLVM.
LLVM_ABI void handleChangedOperand(void *Ref, Metadata *New)
static LLVM_ABI DIArgList * get(LLVMContext &Context, ArrayRef< ValueAsMetadata * > Args)
DIBasicType(LLVMContext &C, StorageType Storage, unsigned Tag, unsigned LineNo, uint32_t AlignInBits, unsigned Encoding, uint32_t NumExtraInhabitants, uint32_t DataSizeInBits, DIFlags Flags, ArrayRef< Metadata * > Ops)
unsigned StringRef uint64_t FlagZero unsigned StringRef uint64_t uint32_t unsigned DIFlags Flags
unsigned StringRef uint64_t FlagZero unsigned StringRef uint64_t uint32_t unsigned DIFlags Flags unsigned StringRef uint64_t uint32_t unsigned uint32_t DIFlags Flags unsigned StringRef DIFile * File
unsigned StringRef uint64_t FlagZero unsigned StringRef uint64_t uint32_t unsigned DIFlags Flags unsigned StringRef uint64_t uint32_t unsigned uint32_t DIFlags Flags unsigned StringRef DIFile unsigned DIScope * Scope
unsigned StringRef uint64_t SizeInBits
LLVM_ABI std::optional< Signedness > getSignedness() const
Return the signedness of this type, or std::nullopt if this type is neither signed nor unsigned.
unsigned getEncoding() const
unsigned StringRef uint64_t FlagZero unsigned StringRef uint64_t uint32_t unsigned DIFlags Flags unsigned StringRef uint64_t uint32_t unsigned uint32_t NumExtraInhabitants
static DIBasicType * getImpl(LLVMContext &Context, unsigned Tag, StringRef Name, DIFile *File, unsigned LineNo, DIScope *Scope, uint64_t SizeInBits, uint32_t AlignInBits, unsigned Encoding, uint32_t NumExtraInhabitants, uint32_t DataSizeInBits, DIFlags Flags, StorageType Storage, bool ShouldCreate=true)
unsigned StringRef uint64_t FlagZero unsigned StringRef uint64_t uint32_t AlignInBits
unsigned StringRef uint64_t FlagZero unsigned StringRef uint64_t uint32_t unsigned DIFlags Flags unsigned StringRef uint64_t uint32_t unsigned uint32_t DIFlags Flags unsigned StringRef DIFile unsigned LineNo
Metadata Metadata MDString Metadata unsigned LineNo
Metadata Metadata MDString * Name
Metadata Metadata MDString Metadata * File
static LLVM_ABI const char * nameTableKindString(DebugNameTableKind PK)
static LLVM_ABI const char * emissionKindString(DebugEmissionKind EK)
DISourceLanguageName Metadata MDString bool MDString unsigned MDString unsigned Metadata Metadata Metadata Metadata Metadata uint64_t bool bool unsigned bool MDString * SysRoot
DISourceLanguageName Metadata MDString bool MDString * Flags
DISourceLanguageName Metadata MDString bool MDString unsigned MDString unsigned Metadata Metadata Metadata Metadata Metadata uint64_t bool bool unsigned bool MDString MDString * SDK
DISourceLanguageName Metadata MDString bool MDString unsigned MDString unsigned Metadata Metadata Metadata * GlobalVariables
DebugEmissionKind getEmissionKind() const
DISourceLanguageName Metadata MDString bool MDString unsigned MDString unsigned Metadata * EnumTypes
DISourceLanguageName Metadata MDString * Producer
DISourceLanguageName Metadata MDString bool MDString unsigned MDString unsigned Metadata Metadata * RetainedTypes
DISourceLanguageName Metadata MDString bool MDString unsigned MDString * SplitDebugFilename
DISourceLanguageName Metadata MDString bool MDString unsigned MDString unsigned Metadata Metadata Metadata Metadata * ImportedEntities
DISourceLanguageName Metadata MDString bool MDString unsigned MDString unsigned Metadata Metadata Metadata Metadata Metadata * Macros
DebugNameTableKind getNameTableKind() const
DISourceLanguageName Metadata * File
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t AlignInBits
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned std::optional< uint32_t > EnumKind
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned std::optional< uint32_t > Metadata Metadata MDString Metadata Metadata * DataLocation
static LLVM_ABI DICompositeType * buildODRType(LLVMContext &Context, MDString &Identifier, unsigned Tag, MDString *Name, Metadata *File, unsigned Line, Metadata *Scope, Metadata *BaseType, Metadata *SizeInBits, uint32_t AlignInBits, Metadata *OffsetInBits, Metadata *Specification, uint32_t NumExtraInhabitants, DIFlags Flags, Metadata *Elements, unsigned RuntimeLang, std::optional< uint32_t > EnumKind, Metadata *VTableHolder, Metadata *TemplateParams, Metadata *Discriminator, Metadata *DataLocation, Metadata *Associated, Metadata *Allocated, Metadata *Rank, Metadata *Annotations, Metadata *BitStride)
Build a DICompositeType with the given ODR identifier.
unsigned MDString Metadata unsigned Line
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata * Elements
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned RuntimeLang
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned std::optional< uint32_t > Metadata Metadata MDString Metadata Metadata Metadata Metadata Metadata Metadata * Annotations
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned std::optional< uint32_t > Metadata Metadata MDString * Identifier
static LLVM_ABI DICompositeType * getODRTypeIfExists(LLVMContext &Context, MDString &Identifier)
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned std::optional< uint32_t > Metadata Metadata MDString Metadata * Discriminator
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned std::optional< uint32_t > Metadata Metadata * TemplateParams
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t OffsetInBits
unsigned MDString Metadata unsigned Metadata * Scope
unsigned MDString Metadata * File
unsigned MDString Metadata unsigned Metadata Metadata * BaseType
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Flags
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned std::optional< uint32_t > Metadata Metadata MDString Metadata Metadata Metadata Metadata * Allocated
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned std::optional< uint32_t > Metadata Metadata MDString Metadata Metadata Metadata Metadata Metadata Metadata Metadata * Specification
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned std::optional< uint32_t > Metadata * VTableHolder
unsigned MDString Metadata unsigned Metadata Metadata uint64_t SizeInBits
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned std::optional< uint32_t > Metadata Metadata MDString Metadata Metadata Metadata * Associated
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned std::optional< uint32_t > Metadata Metadata MDString Metadata Metadata Metadata Metadata Metadata Metadata Metadata uint32_t NumExtraInhabitants
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned std::optional< uint32_t > Metadata Metadata MDString Metadata Metadata Metadata Metadata Metadata * Rank
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned std::optional< uint32_t > Metadata Metadata MDString Metadata Metadata Metadata Metadata Metadata Metadata Metadata uint32_t Metadata * BitStride
unsigned StringRef DIFile unsigned DIScope DIType Metadata uint32_t Metadata * OffsetInBits
unsigned StringRef DIFile unsigned DIScope DIType Metadata uint32_t AlignInBits
unsigned StringRef DIFile unsigned DIScope DIType Metadata uint32_t Metadata std::optional< unsigned > std::optional< PtrAuthData > PtrAuthData
Metadata * getExtraData() const
Get extra data associated with this derived type.
unsigned StringRef DIFile * File
unsigned StringRef DIFile unsigned DIScope DIType Metadata uint32_t Metadata std::optional< unsigned > DWARFAddressSpace
LLVM_ABI DIType * getClassType() const
Get casted version of extra data.
LLVM_ABI Constant * getConstant() const
unsigned StringRef DIFile unsigned DIScope DIType Metadata * SizeInBits
LLVM_ABI Constant * getStorageOffsetInBits() const
LLVM_ABI Constant * getDiscriminantValue() const
LLVM_ABI uint32_t getVBPtrOffset() const
int64_t bool MDString * Name
static LLVM_ABI bool classof(const ExprOperand *Op)
static LLVM_ABI bool classof(const ExprOperand *Op)
static LLVM_ABI bool classof(const ExprOperand *Op)
static LLVM_ABI bool classof(const ExprOperand *Op)
A lightweight wrapper around an expression operand.
LLVM_ABI bool isNonEmitting() const
Return true if CodeGen handles this operand without adding bytes to the DWARF expression.
LLVM_ABI unsigned getSize() const
Return the size of the operand.
uint64_t getArg(unsigned I) const
Get an argument to the operand.
bool is(uint64_t Opcode) const
Return true if this is Opcode.
uint64_t getOp() const
Get the operand code.
const uint64_t * get() const
static LLVM_ABI bool classof(const ExprOperand *Op)
static LLVM_ABI bool classof(const ExprOperand *Op)
static LLVM_ABI bool classof(const ExprOperand *Op)
An iterator for expression operands.
element_iterator elements_end() const
LLVM_ABI bool isEntryValue() const
Check if the expression consists of exactly one entry value operand.
iterator_range< expr_op_iterator > expr_ops() const
static LLVM_ABI DIExpression * append(const DIExpression *Expr, ArrayRef< uint64_t > Ops)
Append the opcodes Ops to DIExpr.
std::array< uint64_t, 6 > ExtOps
unsigned getNumElements() const
static LLVM_ABI bool isLitOp(uint64_t Op)
Return true if Op is one of DW_OP_lit0 through DW_OP_lit31.
static LLVM_ABI ExtOps getExtOps(unsigned FromSize, unsigned ToSize, bool Signed)
Returns the ops for a zero- or sign-extension in a DIExpression.
expr_op_iterator expr_op_begin() const
Visit the elements via ExprOperand wrappers.
LLVM_ABI bool extractIfOffset(int64_t &Offset) const
If this is a constant offset, extract it.
static LLVM_ABI void appendOffset(SmallVectorImpl< uint64_t > &Ops, int64_t Offset)
Append Ops with operations to apply the Offset.
DbgVariableFragmentInfo FragmentInfo
LLVM_ABI bool startsWithDeref() const
Return whether the first element a DW_OP_deref.
static LLVM_ABI bool isEqualExpression(const DIExpression *FirstExpr, bool FirstIndirect, const DIExpression *SecondExpr, bool SecondIndirect)
Determines whether two debug values should produce equivalent DWARF expressions, using their DIExpres...
expr_op_iterator expr_op_end() const
LLVM_ABI bool isImplicit() const
Return whether this is an implicit location description.
static LLVM_ABI bool calculateFragmentIntersect(const DataLayout &DL, const Value *SliceStart, uint64_t SliceOffsetInBits, uint64_t SliceSizeInBits, const Value *DbgPtr, int64_t DbgPtrOffsetInBits, int64_t DbgExtractOffsetInBits, DIExpression::FragmentInfo VarFrag, std::optional< DIExpression::FragmentInfo > &Result, int64_t &OffsetFromLocationInBits)
Computes a fragment, bit-extract operation if needed, and new constant offset to describe a part of a...
element_iterator elements_begin() const
LLVM_ABI bool hasAllLocationOps(unsigned N) const
Returns true iff this DIExpression contains at least one instance of DW_OP_LLVM_arg,...
std::optional< FragmentInfo > getFragmentInfo() const
Retrieve the details of this fragment expression.
static LLVM_ABI DIExpression * appendOpsToArg(const DIExpression *Expr, ArrayRef< uint64_t > Ops, unsigned ArgNo, bool StackValue=false)
Create a copy of Expr by appending the given list of Ops to each instance of the operand DW_OP_LLVM_a...
LLVM_ABI uint64_t getConstantValue() const
Return the value of a constant expression, as recognized by isConstant().
LLVM_ABI bool isComplex() const
Return whether the location is computed on the expression stack, meaning it cannot be a simple regist...
static LLVM_ABI std::optional< FragmentInfo > getFragmentInfo(expr_op_iterator Start, expr_op_iterator End)
Retrieve the details of this fragment expression.
static LLVM_ABI std::optional< const DIExpression * > convertToNonVariadicExpression(const DIExpression *Expr)
If Expr is a valid single-location expression, i.e.
LLVM_ABI std::pair< DIExpression *, const ConstantInt * > constantFold(const ConstantInt *CI)
Try to shorten an expression with an initial constant operand.
LLVM_ABI bool isDeref() const
Return whether there is exactly one operator and it is a DW_OP_deref;.
static LLVM_ABI const DIExpression * convertToVariadicExpression(const DIExpression *Expr)
If Expr is a non-variadic expression (i.e.
LLVM_ABI uint64_t getNumLocationOperands() const
Return the number of unique location operands referred to (via DW_OP_LLVM_arg) in this expression; th...
ArrayRef< uint64_t > getElements() const
static LLVM_ABI DIExpression * replaceArg(const DIExpression *Expr, uint64_t OldArg, uint64_t NewArg)
Create a copy of Expr with each instance of DW_OP_LLVM_arg, \p OldArg replaced with DW_OP_LLVM_arg,...
LLVM_ABI std::optional< uint64_t > getActiveBits(DIVariable *Var)
Return the number of bits that have an active value, i.e.
static LLVM_ABI void canonicalizeExpressionOps(SmallVectorImpl< uint64_t > &Ops, const DIExpression *Expr, bool IsIndirect)
Inserts the elements of Expr into Ops modified to a canonical form, which uses DW_OP_LLVM_arg (i....
uint64_t getElement(unsigned I) const
static LLVM_ABI bool extractLeadingOffset(ArrayRef< uint64_t > Ops, int64_t &OffsetInBytes, SmallVectorImpl< uint64_t > &RemainingOps)
static LLVM_ABI std::optional< DIExpression * > createFragmentExpression(const DIExpression *Expr, unsigned OffsetInBits, unsigned SizeInBits)
Create a DIExpression to describe one part of an aggregate variable that is fragmented across multipl...
static LLVM_ABI const DIExpression * convertToUndefExpression(const DIExpression *Expr)
Removes all elements from Expr that do not apply to an undef debug value, which includes every operat...
static LLVM_ABI DIExpression * prepend(const DIExpression *Expr, uint8_t Flags, int64_t Offset=0)
Prepend DIExpr with a deref and offset operation and optionally turn it into a stack value or/and an ...
static LLVM_ABI DIExpression * appendToStack(const DIExpression *Expr, ArrayRef< uint64_t > Ops)
Convert DIExpr into a stack value if it isn't one already by appending DW_OP_deref if needed,...
static LLVM_ABI DIExpression * appendExt(const DIExpression *Expr, unsigned FromSize, unsigned ToSize, bool Signed)
Append a zero- or sign-extension to Expr.
LLVM_ABI std::optional< ArrayRef< uint64_t > > getSingleLocationExpressionElements() const
Returns a reference to the elements contained in this expression, skipping past the leading DW_OP_LLV...
LLVM_ABI bool isSingleLocationExpression() const
Return whether the evaluated expression makes use of a single location at the start of the expression...
LLVM_ABI std::optional< SignedOrUnsignedConstant > isConstant() const
Determine whether this represents a constant value, if so.
LLVM_ABI bool isValid() const
static LLVM_ABI const DIExpression * extractAddressClass(const DIExpression *Expr, unsigned &AddrClass)
Checks if the expression ends with <DWARF Address Space> DW_OP_swap DW_OP_xderef[_size],...
static LLVM_ABI DIExpression * prependOpcodes(const DIExpression *Expr, SmallVectorImpl< uint64_t > &Ops, bool StackValue=false, bool EntryValue=false)
Prepend DIExpr with the given opcodes and optionally turn it into a stack value.
MDString MDString * Directory
MDString MDString std::optional< ChecksumInfo< MDString * > > MDString * Source
static LLVM_ABI std::optional< ChecksumKind > getChecksumKind(StringRef CSKindStr)
MDString MDString std::optional< ChecksumInfo< MDString * > > CS
static LLVM_ABI std::optional< FixedPointKind > getFixedPointKind(StringRef Str)
static LLVM_ABI const char * fixedPointKindString(FixedPointKind)
unsigned StringRef DIFile unsigned DIScope uint64_t uint32_t unsigned DIFlags unsigned int APInt Numerator
unsigned StringRef DIFile unsigned LineNo
unsigned StringRef DIFile unsigned DIScope uint64_t uint32_t unsigned Encoding
unsigned StringRef DIFile unsigned DIScope uint64_t uint32_t unsigned DIFlags unsigned int APInt APInt Denominator
unsigned StringRef DIFile unsigned DIScope uint64_t SizeInBits
unsigned StringRef DIFile unsigned DIScope uint64_t uint32_t AlignInBits
LLVM_ABI bool isSigned() const
unsigned StringRef DIFile unsigned DIScope uint64_t uint32_t unsigned DIFlags unsigned int Factor
@ FixedPointBinary
Scale factor 2^Factor.
@ FixedPointDecimal
Scale factor 10^Factor.
@ FixedPointRational
Arbitrary rational scale factor.
unsigned StringRef DIFile * File
Metadata * getRawLowerBound() const
Metadata * getRawCountNode() const
Metadata * getRawStride() const
LLVM_ABI BoundType getLowerBound() const
Metadata * getRawUpperBound() const
LLVM_ABI BoundType getCount() const
LLVM_ABI BoundType getUpperBound() const
PointerUnion< DIVariable *, DIExpression * > BoundType
LLVM_ABI BoundType getStride() const
A pair of DIGlobalVariable and DIExpression.
Metadata MDString MDString Metadata unsigned Metadata bool bool Metadata Metadata * TemplateParams
Metadata MDString MDString Metadata unsigned Line
Metadata MDString MDString Metadata unsigned Metadata * Type
Metadata MDString MDString Metadata unsigned Metadata bool bool Metadata Metadata uint32_t Metadata * Annotations
Metadata MDString MDString Metadata unsigned Metadata bool bool Metadata * StaticDataMemberDeclaration
Metadata MDString MDString * LinkageName
Metadata MDString MDString Metadata * File
Metadata MDString MDString Metadata unsigned Metadata bool bool Metadata Metadata uint32_t AlignInBits
An imported module (C++ using directive or similar).
unsigned Metadata Metadata * Entity
unsigned Metadata Metadata Metadata unsigned Line
unsigned Metadata Metadata Metadata unsigned MDString * Name
unsigned Metadata Metadata Metadata * File
unsigned Metadata * Scope
Metadata MDString Metadata unsigned unsigned bool std::optional< unsigned > CoroSuspendIdx
Metadata MDString Metadata unsigned unsigned Column
Metadata MDString Metadata unsigned unsigned bool IsArtificial
Metadata MDString Metadata unsigned Line
Metadata MDString Metadata * File
A sequence of DILayerLoc entries.
iterator_range< layer_iterator > layers() const
A single intermediate-IR layer location.
LLVM_ABI DILexicalBlockBase(LLVMContext &C, unsigned ID, StorageType Storage, ArrayRef< Metadata * > Ops)
Metadata Metadata unsigned Discriminator
Metadata Metadata unsigned unsigned Column
LLVM_ABI DISubprogram * getSubprogram() const
Get the subprogram for this scope.
LLVM_ABI DILocalScope * getNonLexicalBlockFileScope() const
Get the first non DILexicalBlockFile scope of this scope.
DILocalScope(LLVMContext &C, unsigned ID, StorageType Storage, unsigned Tag, ArrayRef< Metadata * > Ops)
static LLVM_ABI DILocalScope * cloneScopeForSubprogram(DILocalScope &RootScope, DISubprogram &NewSP, LLVMContext &Ctx, DenseMap< const MDNode *, MDNode * > &Cache)
Traverses the scope chain rooted at RootScope until it hits a Subprogram, recreating the chain with "...
Metadata MDString Metadata unsigned Metadata * Type
Metadata MDString Metadata * File
Metadata MDString Metadata unsigned Line
Metadata MDString Metadata unsigned Metadata unsigned DIFlags uint32_t Metadata * Annotations
Metadata MDString Metadata unsigned Metadata unsigned DIFlags uint32_t AlignInBits
unsigned unsigned DILocalScope * Scope
static LLVM_ABI DILocation * getMergedLocations(ArrayRef< DILocation * > Locs)
Try to combine the vector of locations passed as input in a single one.
DILayerLocList * getIRLayers() const
unsigned unsigned DILocalScope DILocation bool uint64_t uint8_t Metadata * IRLayers
static LLVM_ABI std::optional< unsigned > encodeDiscriminator(unsigned BD, unsigned DF, unsigned CI)
Raw encoding of the discriminator.
unsigned unsigned DILocalScope DILocation bool ImplicitCode
static LLVM_ABI void decodeDiscriminator(unsigned D, unsigned &BD, unsigned &DF, unsigned &CI)
Raw decoder for values in an encoded discriminator D.
static LLVM_ABI DILocation * getMergedLocation(DILocation *LocA, DILocation *LocB)
Attempts to merge LocA and LocB into a single location; see DebugLoc::getMergedLocation for more deta...
unsigned unsigned DILocalScope DILocation * InlinedAt
unsigned unsigned Metadata * File
unsigned unsigned Metadata Metadata * Elements
unsigned unsigned MDString MDString * Value
unsigned unsigned MDString * Name
Represents a module in the programming language, for example, a Clang module, or a Fortran module.
Metadata Metadata * Scope
Metadata Metadata MDString * Name
Metadata Metadata MDString MDString MDString MDString * APINotesFile
Metadata Metadata MDString MDString MDString * IncludePath
Metadata Metadata MDString MDString * ConfigurationMacros
Metadata Metadata MDString MDString MDString MDString unsigned LineNo
Metadata MDString bool ExportSymbols
Tagged DWARF-like metadata node.
LLVM_ABI dwarf::Tag getTag() const
static LLVM_ABI DIFlags getFlag(StringRef Flag)
static LLVM_ABI DIFlags splitFlags(DIFlags Flags, SmallVectorImpl< DIFlags > &SplitFlags)
Split up a flags bitfield.
DINode(LLVMContext &C, unsigned ID, StorageType Storage, unsigned Tag, ArrayRef< Metadata * > Ops1, ArrayRef< Metadata * > Ops2={})
static LLVM_ABI StringRef getFlagString(DIFlags Flag)
MDString Metadata unsigned MDString MDString unsigned Metadata * Type
MDString Metadata unsigned MDString * GetterName
MDString Metadata unsigned MDString MDString * SetterName
A property of a class or structure.
MDString Metadata unsigned Metadata * Type
MDString Metadata unsigned Metadata Metadata * BackingStorage
Base class for scope-like contexts.
LLVM_ABI StringRef getName() const
LLVM_ABI DIScope * getScope() const
DIScope(LLVMContext &C, unsigned ID, StorageType Storage, unsigned Tag, ArrayRef< Metadata * > Ops)
Wrapper structure that holds source language identity metadata that includes language name,...
String type, Fortran CHARACTER(n)
unsigned MDString Metadata Metadata Metadata uint64_t SizeInBits
unsigned MDString Metadata Metadata Metadata uint64_t uint32_t AlignInBits
unsigned MDString Metadata Metadata Metadata * StringLocationExp
unsigned MDString Metadata Metadata * StringLengthExp
unsigned MDString Metadata Metadata Metadata uint64_t uint32_t unsigned Encoding
unsigned MDString Metadata * StringLength
Subprogram description. Uses SubclassData1.
Metadata MDString MDString Metadata unsigned Metadata unsigned Metadata unsigned int DIFlags DISPFlags Metadata Metadata Metadata Metadata Metadata Metadata MDString bool UsesKeyInstructions
LLVM_ABI void cleanupRetainedNodes()
When IR modules are merged, typically during LTO, the merged module may contain several types having ...
Metadata MDString MDString Metadata unsigned Metadata unsigned ScopeLine
Metadata MDString MDString Metadata unsigned Metadata unsigned Metadata unsigned int DIFlags DISPFlags SPFlags
Metadata MDString MDString Metadata unsigned Metadata unsigned Metadata * ContainingType
Metadata MDString MDString Metadata unsigned Metadata unsigned Metadata unsigned int DIFlags DISPFlags Metadata Metadata * TemplateParams
static LLVM_ABI DILocalScope * getRetainedNodeScope(MDNode *N)
Metadata MDString MDString Metadata unsigned Metadata unsigned Metadata unsigned int DIFlags DISPFlags Metadata Metadata Metadata Metadata Metadata Metadata MDString * TargetFuncName
static LLVM_ABI DISPFlags toSPFlags(bool IsLocalToUnit, bool IsDefinition, bool IsOptimized, unsigned Virtuality=SPFlagNonvirtual, bool IsMainSubprogram=false)
static LLVM_ABI const DIScope * getRawRetainedNodeScope(const MDNode *N)
void cleanupRetainedNodesIf(T &&Pred)
Metadata MDString MDString Metadata unsigned Metadata unsigned Metadata unsigned int DIFlags DISPFlags Metadata Metadata Metadata Metadata Metadata * ThrownTypes
static LLVM_ABI DISPFlags getFlag(StringRef Flag)
Metadata MDString MDString Metadata * File
Metadata MDString MDString Metadata unsigned Metadata unsigned Metadata unsigned VirtualIndex
static LLVM_ABI DISPFlags splitFlags(DISPFlags Flags, SmallVectorImpl< DISPFlags > &SplitFlags)
Split up a flags bitfield for easier printing.
static LLVM_ABI StringRef getFlagString(DISPFlags Flag)
Metadata MDString MDString Metadata unsigned Metadata unsigned Metadata unsigned int DIFlags DISPFlags Metadata Metadata Metadata Metadata * RetainedNodes
DISPFlags
Debug info subprogram flags.
Metadata MDString MDString Metadata unsigned Metadata unsigned Metadata unsigned int ThisAdjustment
LLVM_ABI bool describes(const Function *F) const
Check if this subprogram describes the given function.
StringRef DIFile unsigned Line
StringRef DIFile unsigned DIScope uint64_t uint32_t DIFlags DIType Metadata Metadata * UpperBound
StringRef DIFile unsigned DIScope uint64_t uint32_t DIFlags DIType Metadata Metadata Metadata Metadata * Bias
StringRef DIFile unsigned DIScope uint64_t uint32_t DIFlags DIType Metadata Metadata Metadata * Stride
StringRef DIFile unsigned DIScope uint64_t SizeInBits
PointerUnion< ConstantInt *, DIVariable *, DIExpression *, DIDerivedType * > BoundType
StringRef DIFile unsigned DIScope uint64_t uint32_t AlignInBits
StringRef DIFile unsigned DIScope uint64_t uint32_t DIFlags DIType Metadata * LowerBound
StringRef DIFile unsigned DIScope uint64_t uint32_t DIFlags Flags
LLVM_ABI BoundType getUpperBound() const
LLVM_ABI BoundType getStride() const
LLVM_ABI BoundType getLowerBound() const
LLVM_ABI BoundType getCount() const
Type array for a subprogram.
DIFlags uint8_t Metadata * TypeArray
Base class for template parameters.
unsigned MDString Metadata * Type
unsigned MDString Metadata bool Metadata * Value
bool isStaticMember() const
DIType(LLVMContext &C, unsigned ID, StorageType Storage, unsigned Tag, unsigned Line, uint32_t AlignInBits, uint32_t NumExtraInhabitants, DIFlags Flags, ArrayRef< Metadata * > Ops)
LLVM_ABI uint32_t getAlignInBits() const
Metadata * getRawSizeInBits() const
Base class for variables.
std::optional< DIBasicType::Signedness > getSignedness() const
Return the signedness of this variable's type, or std::nullopt if this type is neither signed nor uns...
LLVM_ABI std::optional< uint64_t > getSizeInBits() const
Determines the size of the variable's type.
Metadata * getRawType() const
LLVM_ABI DIVariable(LLVMContext &C, unsigned ID, StorageType Storage, signed Line, ArrayRef< Metadata * > Ops, uint32_t AlignInBits=0)
A parsed version of the target data layout string in and methods for querying it.
Record of a variable value-assignment, aka a non instruction representation of the dbg....
LLVM_ABI DebugVariableAggregate(const DbgVariableRecord *DVR)
const DILocation * getInlinedAt() const
const DILocalVariable * getVariable() const
LLVM_ABI DebugVariable(const DbgVariableRecord *DVR)
iterator find(const_arg_type_t< KeyT > Val)
std::pair< iterator, bool > try_emplace(KeyT &&Key, Ts &&...Args)
Class representing an expression and its matching format.
Generic tagged DWARF-like metadata node.
LLVM_ABI dwarf::Tag getTag() const
unsigned MDString * Header
unsigned MDString ArrayRef< Metadata * > DwarfOps
DenseSet< DIArgList *, DIArgListInfo > DIArgLists
This is an important class for using LLVM in a threaded context.
LLVMContextImpl *const pImpl
static MDTuple * getDistinct(LLVMContext &Context, ArrayRef< Metadata * > MDs)
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
LLVM_ABI TempMDNode clone() const
Create a (temporary) clone of this.
static T * storeImpl(T *N, StorageType Storage, StoreT &Store)
LLVMContext & getContext() const
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.
LLVM_ABI StringRef getString() const
static LLVM_ABI PoisonValue * get(Type *T)
Static factory methods - Return an 'poison' object of the specified type.
LLVMContext & getContext() const
LLVM_ABI void resolveAllUses(bool ResolveUsers=true)
Resolve all uses of this.
LLVM_ABI void replaceAllUsesWith(Metadata *MD)
Replace all uses of this with MD.
Implements a dense probed hash-table based set with some number of buckets stored inline.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
A SetVector that performs no allocations if smaller than a certain size.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void reserve(size_type N)
void append(ItTy in_start, ItTy in_end)
Add the specified range to the end of the SmallVector.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
constexpr bool empty() const
Check if the string is empty.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
The instances of the Type class are immutable: once they are created, they are never changed.
static LLVM_ABI IntegerType * getInt64Ty(LLVMContext &C)
LLVM Value Representation.
LLVM_ABI std::optional< int64_t > getPointerOffsetFrom(const Value *Other, const DataLayout &DL) const
If this ptr is provably equal to Other plus a constant offset, return that offset in bytes.
std::pair< iterator, bool > insert(const ValueT &V)
bool contains(const_arg_type_t< ValueT > V) const
Check if the set contains the given element.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Calculates the starting offsets for various sections within the .debug_names section.
@ DW_OP_LLVM_entry_value
Only used in LLVM metadata.
@ DW_OP_LLVM_implicit_pointer
Only used in LLVM metadata.
@ DW_OP_LLVM_extract_bits_zext
Only used in LLVM metadata.
@ DW_OP_LLVM_tag_offset
Only used in LLVM metadata.
@ DW_OP_LLVM_fragment
Only used in LLVM metadata.
@ DW_OP_LLVM_arg
Only used in LLVM metadata.
@ DW_OP_LLVM_convert
Only used in LLVM metadata.
@ DW_OP_LLVM_extract_bits_sext
Only used in LLVM metadata.
std::enable_if_t< detail::IsValidPointer< X, Y >::value, X * > dyn_extract(Y &&MD)
Extract a Value from Metadata, if any.
This is an optimization pass for GlobalISel generic memory operations.
auto drop_begin(T &&RangeOrContainer, size_t N=1)
Return a range covering RangeOrContainer with the first N elements excluded.
static T * getUniqued(DenseSet< T *, InfoT > &Store, const typename InfoT::KeyTy &Key)
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
LLVM_ABI cl::opt< bool > EnableFSDiscriminator
void append_range(Container &C, Range &&R)
Wrapper function to append range R to container C.
auto cast_or_null(const Y &Val)
static const DIScope * getScope(const NodeT *N)
auto dyn_cast_or_null(const Y &Val)
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
auto reverse(ContainerTy &&C)
bool none_of(R &&Range, UnaryPredicate P)
Provide wrappers to std::none_of which take ranges instead of having to pass begin/end explicitly.
constexpr bool isUInt(uint64_t x)
Checks if an unsigned integer fits into the given bit width.
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
bool isa(const From &Val)
isa<X> - 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
@ Ref
The access may reference the value stored in memory.
@ First
Helpers to iterate all locations in the MemoryEffectsBase class.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Count
DWARFExpression::Operation Op
ArrayRef(const T &OneElt) -> ArrayRef< T >
const IROptions & getIROptions(const LLVMContext &C)
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
@ End
Run the machine verifier once, at the end of the pipeline.
@ Keep
No function return thunk.
Implement std::hash so that hash_code can be used in STL containers.
SmallPtrSet< DIScope *, 8 > Scopes
void insert(DIScope *S, LineColumn Loc)
DIScope * match(DIScope *S, LineColumn Loc)
void insert(DIScope *S, LineColumn Loc)
DIScope * match(DIScope *S, LineColumn Loc)
SmallMapVector< std::pair< DIFile *, LineColumn >, SmallSetVector< DIScope *, 8 >, 8 > Scopes
A single checksum, represented by a Kind and a Value (a string).
static DbgVariableFragmentInfo intersect(DbgVariableFragmentInfo A, DbgVariableFragmentInfo B)
Returns a zero-sized fragment if A and B don't intersect.
A MapVector that performs no allocations if smaller than a certain size.