25#define DEBUG_TYPE "Scope"
28const char *
const KindArray =
"Array";
29const char *
const KindBlock =
"Block";
30const char *
const KindCallSite =
"CallSite";
31const char *
const KindClass =
"Class";
32const char *
const KindCompileUnit =
"CompileUnit";
33const char *
const KindEnumeration =
"Enumeration";
34const char *
const KindFile =
"File";
35const char *
const KindFunction =
"Function";
36const char *
const KindInlinedFunction =
"InlinedFunction";
37const char *
const KindNamespace =
"Namespace";
38const char *
const KindStruct =
"Struct";
39const char *
const KindTemplateAlias =
"TemplateAlias";
40const char *
const KindTemplatePack =
"TemplatePack";
41const char *
const KindUndefined =
"Undefined";
42const char *
const KindUnion =
"Union";
50 const char *
Kind = KindUndefined;
53 else if (getIsBlock())
55 else if (getIsCallSite())
57 else if (getIsCompileUnit())
58 Kind = KindCompileUnit;
59 else if (getIsEnumeration())
60 Kind = KindEnumeration;
61 else if (getIsInlinedFunction())
62 Kind = KindInlinedFunction;
63 else if (getIsNamespace())
65 else if (getIsTemplatePack())
66 Kind = KindTemplatePack;
69 else if (getIsTemplateAlias())
70 Kind = KindTemplateAlias;
71 else if (getIsClass())
73 else if (getIsFunction())
75 else if (getIsStructure())
77 else if (getIsUnion())
108 Children = std::make_unique<LVElements>();
116 else if (
Element->getIsScope())
118 else if (
Element->getIsSymbol())
129 assert(!
Line->getParent() &&
"Line already inserted");
131 Lines = std::make_unique<LVLines>();
135 Line->setParent(
this);
147 traverseParents(&LVScope::getHasLines, &LVScope::setHasLines);
155 Ranges = std::make_unique<LVLocations>();
170 Scopes = std::make_unique<LVScopes>();
183 if (
Scope->getIsGlobalReference())
184 traverseParents(&LVScope::getHasGlobals, &LVScope::setHasGlobals);
186 traverseParents(&LVScope::getHasLocals, &LVScope::setHasLocals);
189 traverseParents(&LVScope::getHasScopes, &LVScope::setHasScopes);
197 Symbols = std::make_unique<LVSymbols>();
210 if (
Symbol->getIsGlobalReference())
211 traverseParents(&LVScope::getHasGlobals, &LVScope::setHasGlobals);
213 traverseParents(&LVScope::getHasLocals, &LVScope::setHasLocals);
216 traverseParents(&LVScope::getHasSymbols, &LVScope::setHasSymbols);
222 assert(!
Type->getParent() &&
"Type already inserted");
224 Types = std::make_unique<LVTypes>();
229 Type->setParent(
this);
237 if (
Type->getIsGlobalReference())
238 traverseParents(&LVScope::getHasGlobals, &LVScope::setHasGlobals);
240 traverseParents(&LVScope::getHasLocals, &LVScope::setHasLocals);
243 traverseParents(&LVScope::getHasTypes, &LVScope::setHasTypes);
250 Location->setLowerAddress(LowerAddress);
251 Location->setUpperAddress(UpperAddress);
261 auto RemoveElement = [
Element, Predicate](
auto &Container) ->
bool {
262 auto Iter = std::remove_if(Container->begin(), Container->end(), Predicate);
263 if (Iter != Container->end()) {
264 Container->erase(Iter, Container->end());
274 return RemoveElement(
Lines);
280 return RemoveElement(
Types);
282 return RemoveElement(
Scopes);
296 if (!ReferenceSymbols)
300 References.
append(ReferenceSymbols->
begin(), ReferenceSymbols->
end());
306 if (
Symbol->getHasReferenceAbstract())
311 if (References.
size()) {
313 dbgs() <<
"Insert Missing Inlined Elements\n"
359 Line->updateLevel(
this, Moved);
372 if (getIsGlobalReference())
374 Element->setIsGlobalReference();
380 if (getIsResolvedName())
399 if (getIsArtificial())
454 if (getHasReference() && !
isNamed())
467 if (
Type->getIsTemplateParam()) {
472 return !Params.
empty();
477 if (getIsTemplateResolved())
479 setIsTemplateResolved();
482 if (
options().getAttributeEncoded()) {
485 std::string EncodedArgs;
496 if (getIsRoot() || getIsCompileUnit())
520 std::string BaseName;
522 if (getIsTemplateResolved())
523 Name.append(BaseName);
533 bool AddComma =
false;
545bool LVScope::resolvePrinting()
const {
549 if (
options().getPrintWarnings() && (getIsRoot() || getIsCompileUnit()))
555 if (
options().getSelectExecute()) {
556 return getIsRoot() || getIsCompileUnit() || getHasPattern();
559 bool Globals =
options().getAttributeGlobal();
560 bool Locals =
options().getAttributeLocal();
561 if ((Globals && Locals) || (!Globals && !Locals)) {
565 if ((Globals && !(getHasGlobals() || getIsGlobalReference())) ||
566 (Locals && !(getHasLocals() || !getIsGlobalReference())))
571 if (getIsFunction() && getIsArtificial() &&
572 !
options().getAttributeGenerated())
585 if (getIsSystem() && !
options().getAttributeSystem())
590 if (getIsCompileUnit()) {
593 std::string ScopeName(
getName());
594 if (std::error_code
EC =
603 bool DoPrint = (
options().getAttributeDiscarded()) ?
true : !getIsDiscarded();
611 getIsInCompare() ?
options().getReportExecute() : resolvePrinting();
617 DoPrint = DoPrint && (Print ||
options().getOutputSplit());
625 if ((getIsRoot() ||
options().getPrintAnyElement()) &&
626 options().getPrintFormatting() &&
649 if (
options().getPrintWarnings())
656 if (getIsCompileUnit()) {
657 if (
options().getPrintSummary())
667 if (getIsRoot() &&
options().getPrintWarnings()) {
682 std::stable_sort(Set->begin(), Set->end(), SortFunction);
684 Traverse(Parent->
Types, SortFunction);
685 Traverse(Parent->
Symbols, SortFunction);
686 Traverse(Parent->
Scopes, SortFunction);
688 Traverse(Parent->
Children, SortFunction);
692 Sort(
Scope, SortFunction);
696 Sort(
this, SortFunction);
706 if ((Parent->*GetFunction)())
708 (Parent->*SetFunction)();
715 if (
options().getReportParents()) {
720 if ((Parent->*GetFunction)())
722 (Parent->*SetFunction)();
728 auto Traverse = [&](
const auto *Set) {
730 for (
const auto &Entry : *Set)
731 (Entry->*SetFunction)();
734 (
Scope->*SetFunction)();
742 TraverseChildren(
Scope);
745 if (
options().getReportChildren())
746 TraverseChildren(
this);
771 if (getIsDiscarded())
778 if (!(
Location->*ValidLocation)() && RecordInvalid)
795 if (getIsDiscarded())
831 if (!Candidates.
empty()) {
832 dbgs() <<
"\n[LVScope::findIn]\n"
834 <<
"Offset = " << hexSquareString(getOffset()) <<
", "
835 <<
"Level = " << getLevel() <<
", "
836 <<
"Kind = " << formattedKind(kind()) <<
", "
837 <<
"Name = " << formattedName(getName()) <<
"\n";
838 for (const LVScope *Candidate : Candidates)
839 dbgs() <<
"Candidate: "
840 <<
"Offset = " << hexSquareString(Candidate->getOffset()) <<
", "
841 <<
"Level = " << Candidate->getLevel() <<
", "
842 <<
"Kind = " << formattedKind(Candidate->kind()) <<
", "
843 <<
"Name = " << formattedName(Candidate->getName()) <<
"\n";
847 if (!Candidates.
empty())
848 return (Candidates.
size() == 1)
849 ? (
equals(Candidates[0]) ? Candidates[0] :
nullptr)
860 (
options().getCompareSymbols() &&
867 auto SetCompareState = [&](
auto &Container) {
869 for (
auto *Entry : *Container)
870 Entry->setIsInCompare();
872 SetCompareState(
Types);
874 SetCompareState(
Lines);
892 bool TraverseChildren) {
893 if (!(References && Targets))
897 dbgs() <<
"\n[LVScope::markMissingParents]\n";
899 dbgs() <<
"References: "
901 <<
"Level = " <<
Reference->getLevel() <<
", "
905 dbgs() <<
"Targets : "
907 <<
"Level = " <<
Target->getLevel() <<
", "
918 dbgs() <<
"\nSearch Reference: "
925 dbgs() <<
"\nFound Target: "
929 if (TraverseChildren)
933 dbgs() <<
"Missing Reference: "
946 if (getIsLexicalBlock() &&
Scope->getIsLexicalBlock())
960 if (!References && !Targets)
962 if (References && Targets && References->
size() == Targets->
size()) {
985 if (
options().getPrintFormatting() &&
options().getAttributeRange() &&
993 if (
options().getPrintFormatting() &&
options().getAttributeEncoded())
999 if (getIncludeInPrint() &&
getReader().doPrintScope(
this)) {
1002 if (!(getIsRoot() || (getIsCompileUnit() &&
options().getSelectExecute())))
1012 if (!getIsBlock()) {
1014 if (!getIsAggregate())
1021 if (
Full && getIsBlock())
1058 if (getIsTemplateResolved())
1088 if (getIsArrayResolved())
1090 setIsArrayResolved();
1113 if (
Type->getIsSubrange()) {
1126 std::stringstream ArrayInfo;
1131 if (
Type->getIsSubrangeCount())
1133 ArrayInfo <<
"[" <<
Type->getCount() <<
"]";
1136 unsigned LowerBound;
1137 unsigned UpperBound;
1138 std::tie(LowerBound, UpperBound) =
Type->getBounds();
1145 ArrayInfo <<
"[" << LowerBound <<
".." << UpperBound <<
"]";
1147 ArrayInfo <<
"[" << UpperBound + 1 <<
"]";
1182 "CU [0x%08" PRIx64
"], Scope [0x%08" PRIx64
"], Range [0x%08" PRIx64
1183 ":0x%08" PRIx64
"], Size = %" PRId64
"\n",
1193 CUContributionSize =
Size;
1202 if (!
options().getSelectExecute())
1205 if (MatchedScopes.
size()) {
1208 &LVScope::setHasPattern);
1218 if (
options().getAttributeRange()) {
1221 bool RecordInvalid =
options().getWarningRanges();
1230 if (
options().getAttributeLocation()) {
1233 bool RecordInvalid =
options().getWarningLocations();
1251 LVAddressToLine *Map = SectionMappings.findMap(SectionIndex);
1252 if (!Map || Map->empty())
1254 LVAddressToLine::const_iterator Iter = Map->lower_bound(
Address);
1255 return (Iter != Map->end()) ? Iter->second :
nullptr;
1261 LVAddressToLine *Map = SectionMappings.findMap(SectionIndex);
1262 if (!Map || Map->empty())
1264 LVAddressToLine::const_iterator Iter = Map->upper_bound(
Address);
1265 if (Iter != Map->begin())
1266 Iter = std::prev(Iter);
1267 return Iter->second;
1275 LVLine *LowLine = lineLowerBound(
Location->getLowerAddress(), Parent);
1276 LVLine *HighLine = lineUpperBound(
Location->getUpperAddress(), Parent);
1281 if (Index <= 0 || Index > Filenames.size())
1308 if (
Line->getIncludeInPrint())
1312 if (
Scope->getIncludeInPrint())
1316 if (
Symbol->getIncludeInPrint())
1320 if (
Type->getIncludeInPrint())
1346 addItem<LVTagOffsetsMap, dwarf::Tag, LVOffset>(&DebugTags,
Target,
Offset);
1351 if (WarningOffsets.find(
Offset) == WarningOffsets.end())
1358 if (InvalidCoverages.find(
Offset) == InvalidCoverages.end())
1379 addItem<LVOffsetLinesMap, LVOffset, LVLine *>(&LinesZero,
Offset,
Line);
1383 if (!
options().getPrintFormatting())
1391 enum class Option { Directory, File };
1392 auto PrintNames = [&](Option Action) {
1393 StringRef Kind = Action == Option::Directory ?
"Directory" :
"File";
1394 std::set<std::string> UniqueNames;
1395 for (
size_t Index : Filenames) {
1399 size_t Pos =
Name.rfind(
'/');
1400 if (Pos != std::string::npos)
1401 Name = (Action == Option::File) ?
Name.substr(Pos + 1)
1402 :
Name.substr(0, Pos);
1404 UniqueNames.insert(std::string(
Name));
1406 for (
const std::string &
Name : UniqueNames)
1411 if (
options().getAttributeDirectories())
1412 PrintNames(Option::Directory);
1413 if (
options().getAttributeFiles())
1414 PrintNames(Option::File);
1415 if (
options().getAttributePublics()) {
1419 using OffsetSorted = std::map<LVAddress, LVPublicNames::const_iterator>;
1420 OffsetSorted SortedNames;
1421 for (LVPublicNames::const_iterator Iter = PublicNames.begin();
1422 Iter != PublicNames.end(); ++Iter)
1423 SortedNames.emplace(Iter->first->getOffset(), Iter);
1425 LVPublicNames::const_iterator Iter;
1426 for (OffsetSorted::reference Entry : SortedNames) {
1427 Iter = Entry.second;
1430 if (
options().getAttributeOffset()) {
1432 size_t Size = (*Iter).second.second;
1442 auto PrintHeader = [&](
const char *Header) {
OS <<
"\n" << Header <<
":\n"; };
1443 auto PrintFooter = [&](
auto &Set) {
1456 LVOffsetElementMap::const_iterator Iter = Map.find(
Offset);
1465 const char *Header) {
1466 PrintHeader(Header);
1467 for (LVOffsetLocationsMap::const_reference Entry : Map) {
1468 PrintElement(WarningOffsets, Entry.first);
1471 <<
Location->getIntervalInfo() <<
"\n";
1477 PrintHeader(
"Unsupported DWARF Tags");
1478 for (LVTagOffsetsMap::const_reference Entry : DebugTags) {
1479 OS <<
format(
"\n0x%02x", (
unsigned)Entry.first) <<
", "
1483 PrintOffset(Count,
Offset);
1486 PrintFooter(DebugTags);
1489 if (
options().getWarningCoverages()) {
1490 PrintHeader(
"Symbols Invalid Coverages");
1491 for (LVOffsetSymbolMap::const_reference Entry : InvalidCoverages) {
1499 PrintFooter(InvalidCoverages);
1502 if (
options().getWarningLines()) {
1503 PrintHeader(
"Lines Zero References");
1504 for (LVOffsetLinesMap::const_reference Entry : LinesZero) {
1505 PrintElement(WarningOffsets, Entry.first);
1508 PrintOffset(Count,
Line->getOffset());
1511 PrintFooter(LinesZero);
1514 if (
options().getWarningLocations())
1515 PrintInvalidLocations(InvalidLocations,
"Invalid Location Ranges");
1517 if (
options().getWarningRanges())
1518 PrintInvalidLocations(InvalidRanges,
"Invalid Code Ranges");
1521void LVScopeCompileUnit::printTotals(
raw_ostream &
OS)
const {
1522 OS <<
"\nTotals by lexical level:\n";
1525 Totals[
Index].second);
1529 LVSizesMap::const_iterator Iter = Sizes.find(
Scope);
1530 if (Iter != Sizes.end()) {
1532 assert(CUContributionSize &&
"Invalid CU contribution size.");
1536 rint((
float(
Size) / CUContributionSize) * 100.0 * 100.0) / 100.0;
1537 OS <<
format(
"%10" PRId64
" (%6.2f%%) : ",
Size, Percentage);
1542 if (Level > MaxSeenLevel)
1543 MaxSeenLevel =
Level;
1544 if (Level >= Totals.
size())
1545 Totals.
resize(2 * Level);
1547 Totals[
Level].second += Percentage;
1556 if (
options().getSelectExecute() &&
options().getReportAnyView()) {
1571 bool PrintScopes =
options().getPrintScopes();
1576 OS <<
"\nScope Sizes:\n";
1577 options().resetPrintFormatting();
1582 printScopeSize(
this,
OS);
1589 options().setPrintFormatting();
1601 const char *Header)
const {
1602 std::string Separator = std::string(29,
'-');
1603 auto PrintSeparator = [&]() {
OS << Separator <<
"\n"; };
1604 auto PrintHeadingRow = [&](
const char *
T,
const char *U,
const char *V) {
1607 auto PrintDataRow = [&](
const char *
T,
unsigned U,
unsigned V) {
1613 PrintHeadingRow(
"Element",
"Total", Header);
1615 PrintDataRow(
"Scopes", Allocated.
Scopes, Counter.
Scopes);
1617 PrintDataRow(
"Types", Allocated.
Types, Counter.
Types);
1618 PrintDataRow(
"Lines", Allocated.
Lines, Counter.
Lines);
1627 bool UseMatchedElements) {
1630 std::stable_sort(MatchedElements.
begin(), MatchedElements.
end(),
1636 if (
options().getPrintAnyElement()) {
1637 if (UseMatchedElements)
1641 if (UseMatchedElements) {
1656 if (
options().getPrintSummary()) {
1660 if (!
options().getReportList()) {
1662 if (!
Element->getIncludeInPrint())
1666 else if (
Element->getIsSymbol())
1668 else if (
Element->getIsScope())
1670 else if (
Element->getIsLine())
1682 if (
options().getPrintSizes()) {
1686 OS <<
"\nScope Sizes:\n";
1687 printScopeSize(
this,
OS);
1710 if (
options().getPrintFormatting() &&
options().getAttributeProducer())
1765 if (
options().getAttributeInserted() && getHasReferenceAbstract() &&
1766 !getAddedMissing()) {
1771 if (
Scope->getHasReferenceAbstract() && !
Scope->getAddedMissing())
1787 if (getHasReferenceSpecification()) {
1809 if (getIsTemplate())
1834 if (
options().getCompareLines() &&
1883 if (getIsTemplateResolved())
1899 if (getIsTemplate())
1908 if (getHasDiscriminator() &&
Scope->getHasDiscriminator())
1933 if (getIsMemberPointerResolved())
1935 setIsMemberPointerResolved();
1939 Name.append(
" (*)");
1944 bool AddComma =
false;
1946 if (
Symbol->getIsParameter()) {
1949 Type->resolveName();
2008 if (!
options().getAttributeAnyLocation())
2022 std::function<void(
LVScope * Parent)> TraverseScope = [&](
LVScope *Parent) {
2023 auto Traverse = [&](
const auto *Set) {
2025 for (
const auto &Entry : *Set)
2026 Entry->setInnerComponent();
2031 TraverseScope(
Scope);
2039 TraverseScope(
this);
2047 OS <<
"\nLogical View:\n";
2053 if (
options().getAttributeFormat())
2059 bool UseMatchedElements)
const {
2065 if (UseMatchedElements)
2066 options().resetPrintFormatting();
2076 if (std::error_code
EC =
2091 if (UseMatchedElements)
2092 options().setPrintFormatting();
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Pass interface - Implemented by all 'passes'.
void append(ItTy in_start, ItTy in_end)
Add the specified range to the end of the SmallVector.
void push_back(const T &Elt)
StringRef - Represent a constant reference to a string, i.e.
std::string str() const
str - Get the contents as an std::string.
Target - Wrapper for Target specific information.
const char * getName() const
getName - Get the target name.
The instances of the Type class are immutable: once they are created, they are never changed.
Stores all information relating to a compile unit, be it in its original instance in the object file ...
void printItem(LVElement *Element, LVComparePass Pass)
void push(LVScope *Scope)
size_t getNameIndex() const
std::string discriminatorAsString() const
StringRef getQualifiedName() const
void resolveFullname(LVElement *BaseType, StringRef Name=emptyString())
virtual size_t getCallFilenameIndex() const
virtual void updateLevel(LVScope *Parent, bool Moved=false)
virtual void resolveName()
StringRef virtualityString(uint32_t Virtuality=dwarf::DW_VIRTUALITY_none) const
uint32_t getInlineCode() const
StringRef typeAsString() const
virtual uint32_t getDiscriminator() const
StringRef externalString() const
virtual StringRef getLinkageName() const
void setName(StringRef ElementName) override
StringRef getName() const override
LVElement * getType() const
bool referenceMatch(const LVElement *Element) const
virtual uint32_t getCallLineNumber() const
void setFile(LVElement *Reference=nullptr)
void setType(LVElement *Element=nullptr)
StringRef getTypeName() const
void printLinkageName(raw_ostream &OS, bool Full, LVElement *Parent, LVScope *Scope) const
StringRef getTypeQualifiedName() const
virtual void report(LVComparePass Pass)
StringRef accessibilityString(uint32_t Access=dwarf::DW_ACCESS_private) const
bool equals(const LVElement *Element) const
StringRef inlineCodeString(uint32_t Code) const
size_t getFilenameIndex() const
std::string typeOffsetAsString() const
virtual size_t getLinkageNameIndex() const
bool isNamed() const override
void printReference(raw_ostream &OS, bool Full, LVElement *Parent) const
static void markMissingParents(const LVLines *References, const LVLines *Targets)
virtual bool equals(const LVLine *Line) const
virtual Error doPrint(bool Split, bool Match, bool Print, raw_ostream &OS, bool Full=true) const
virtual const char * kind() const
LVScope * getParentScope() const
std::string indentAsString() const
virtual void print(raw_ostream &OS, bool Full=true) const
void setLevel(LVLevel Level)
void printAttributes(raw_ostream &OS, bool Full=true) const
virtual std::string lineNumberAsString(bool ShowZero=false) const
void setParent(LVScope *Scope)
void setOffset(LVOffset DieOffset)
LVOffset getOffset() const
LVElement * getParent() const
size_t indentationSize() const
void resetFilenameIndex()
void resolvePatternMatch(LVLine *Line)
void addEntry(LVScope *Scope, LVAddress LowerAddress, LVAddress UpperAddress)
void notifyAddedElement(LVLine *Line)
raw_ostream & outputStream()
virtual bool isSystemEntry(LVElement *Element, StringRef Name={}) const
virtual LVSectionIndex getSectionIndex(LVScope *Scope)
void setCompileUnit(LVScope *Scope)
bool doPrintScope(const LVScope *Scope) const
virtual void printRecords(raw_ostream &OS) const
void printExtra(raw_ostream &OS, bool Full=true) const override
LVScope * getReference() const override
bool equals(const LVScope *Scope) const override
LVScope * findEqualScope(const LVScopes *Scopes) const override
bool equals(const LVScope *Scope) const override
void printExtra(raw_ostream &OS, bool Full=true) const override
void resolveExtra() override
bool equals(const LVScope *Scope) const override
void printExtra(raw_ostream &OS, bool Full=true) const override
void propagatePatternMatch()
void addDebugTag(dwarf::Tag Target, LVOffset Offset)
void printSummary(raw_ostream &OS) const override
void addedElement(LVLine *Line)
void printExtra(raw_ostream &OS, bool Full=true) const override
void printMatchedElements(raw_ostream &OS, bool UseMatchedElements) override
LVLineRange lineRange(LVLocation *Location) const
void addMapping(LVLine *Line, LVSectionIndex SectionIndex)
void addInvalidLocation(LVLocation *Location)
void incrementPrintedScopes()
void increment(LVLine *Line)
void addLineZero(LVLine *Line)
void addInvalidOffset(LVOffset Offset, LVElement *Element)
void addInvalidCoverage(LVSymbol *Symbol)
void addSize(LVScope *Scope, LVOffset Lower, LVOffset Upper)
void processRangeLocationCoverage(LVValidLocation ValidLocation=&LVLocation::validateRanges)
void incrementPrintedLines()
StringRef getFilename(size_t Index) const
void print(raw_ostream &OS, bool Full=true) const override
bool equals(const LVScope *Scope) const override
void printSizes(raw_ostream &OS) const override
void addInvalidRange(LVLocation *Location)
void printLocalNames(raw_ostream &OS, bool Full=true) const
StringRef getProducer() const override
void incrementPrintedSymbols()
void incrementPrintedTypes()
void printWarnings(raw_ostream &OS, bool Full=true) const override
void printExtra(raw_ostream &OS, bool Full=true) const override
bool equals(const LVScope *Scope) const override
LVScope * findEqualScope(const LVScopes *Scopes) const override
uint32_t getCallLineNumber() const override
void resolveExtra() override
bool equals(const LVScope *Scope) const override
uint32_t getDiscriminator() const override
size_t getCallFilenameIndex() const override
void printExtra(raw_ostream &OS, bool Full=true) const override
void resolveExtra() override
void setName(StringRef ObjectName) override
LVScope * getReference() const override
LVScope * findEqualScope(const LVScopes *Scopes) const override
size_t getLinkageNameIndex() const override
void printExtra(raw_ostream &OS, bool Full=true) const override
bool equals(const LVScope *Scope) const override
void resolveReferences() override
void resolveExtra() override
void printExtra(raw_ostream &OS, bool Full=true) const override
bool equals(const LVScope *Scope) const override
LVScope * findEqualScope(const LVScopes *Scopes) const override
LVScope * getReference() const override
void processRangeInformation()
void transformScopedName()
void printExtra(raw_ostream &OS, bool Full=true) const override
StringRef getFileFormatName() const
Error doPrintMatches(bool Split, raw_ostream &OS, bool UseMatchedElements) const
void print(raw_ostream &OS, bool Full=true) const override
bool equals(const LVScope *Scope) const override
void printExtra(raw_ostream &OS, bool Full=true) const override
bool equals(const LVScope *Scope) const override
virtual LVScope * getReference() const
void addElement(LVElement *Element)
void traverseParentsAndChildren(LVObjectGetFunction GetFunction, LVObjectSetFunction SetFunction)
const LVLines * getLines() const
virtual void printSummary(raw_ostream &OS) const
StringRef resolveReferencesChain()
void printExtra(raw_ostream &OS, bool Full=true) const override
void report(LVComparePass Pass) override
const char * kind() const override
virtual LVScope * findEqualScope(const LVScopes *Scopes) const
const LVScopes * getScopes() const
void print(raw_ostream &OS, bool Full=true) const override
void resolveName() override
void printActiveRanges(raw_ostream &OS, bool Full=true) const
size_t scopeCount() const
const LVSymbols * getSymbols() const
virtual void printMatchedElements(raw_ostream &OS, bool UseMatchedElements)
virtual void setEncodedArgs(StringRef EncodedArgs)
void printEncodedArgs(raw_ostream &OS, bool Full) const
void updateLevel(LVScope *Parent, bool Moved) override
LVScope * outermostParent(LVAddress Address)
std::unique_ptr< LVLocations > Ranges
void addToChildren(LVElement *Element)
static void markMissingParents(const LVScopes *References, const LVScopes *Targets, bool TraverseChildren)
std::unique_ptr< LVSymbols > Symbols
const LVTypes * getTypes() const
void encodeTemplateArguments(std::string &Name) const
void addObject(LVLocation *Location)
const LVElements * getChildren() const
virtual void printSizes(raw_ostream &OS) const
std::unique_ptr< LVElements > Children
std::unique_ptr< LVTypes > Types
virtual bool equals(const LVScope *Scope) const
bool getTemplateParameterTypes(LVTypes &Params)
virtual StringRef getEncodedArgs() const
std::unique_ptr< LVLines > Lines
void getLocations(LVLocations &LocationList, LVValidLocation ValidLocation, bool RecordInvalid=false)
Error doPrint(bool Split, bool Match, bool Print, raw_ostream &OS, bool Full=true) const override
virtual bool equalNumberOfChildren(const LVScope *Scope) const
void addMissingElements(LVScope *Reference)
virtual void printWarnings(raw_ostream &OS, bool Full=true) const
void resolveReferences() override
std::unique_ptr< LVScopes > Scopes
const LVLocations * getRanges() const
size_t symbolCount() const
bool removeElement(LVElement *Element) override
StringRef getString(size_t Index) const
void getLocations(LVLocations &LocationList, LVValidLocation ValidLocation, bool RecordInvalid=false)
static void markMissingParents(const LVSymbols *References, const LVSymbols *Targets)
float getCoveragePercentage() const
void setReference(LVSymbol *Symbol) override
const char * kind() const override
static bool parametersMatch(const LVSymbols *References, const LVSymbols *Targets)
LVSymbol * getReference() const
virtual bool equals(const LVType *Type) const
static bool parametersMatch(const LVTypes *References, const LVTypes *Targets)
static void markMissingParents(const LVTypes *References, const LVTypes *Targets)
This class implements an extremely fast bulk output stream that can only output to a stream.
StringRef TagString(unsigned Tag)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
std::string hexString(uint64_t Value, size_t Width=HEX_WIDTH)
std::string formattedNames(StringRef Name1, StringRef Name2)
std::map< LVOffset, LVElement * > LVOffsetElementMap
LVStringPool & getStringPool()
std::pair< LVLine *, LVLine * > LVLineRange
std::map< LVScopeKind, LVScopeGetFunction > LVScopeDispatch
std::string formattedKind(StringRef Kind)
std::map< LVOffset, LVLocations > LVOffsetLocationsMap
LVScopeCompileUnit * getReaderCompileUnit()
LVSortValue compareRange(const LVObject *LHS, const LVObject *RHS)
bool(LVObject::*)() const LVObjectGetFunction
std::string hexSquareString(uint64_t Value)
bool(LVScope::*)() const LVScopeGetFunction
bool(LVLocation::*)() LVValidLocation
LVSplitContext & getReaderSplitContext()
LVSortFunction getSortFunction()
std::string formattedName(StringRef Name)
void(LVObject::*)() LVObjectSetFunction
LVSortValue(*)(const LVObject *LHS, const LVObject *RHS) LVSortFunction
std::string formatAttributes(const StringRef First, Args... Others)
void(LVScope::*)() LVScopeSetFunction
LVCompare & getComparator()
This is an optimization pass for GlobalISel generic memory operations.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
void erase(Container &C, ValueType V)
Wrapper function to remove a value from a container:
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.