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 KindModule =
"Module";
38const char *
const KindNamespace =
"Namespace";
39const char *
const KindStruct =
"Struct";
40const char *
const KindTemplateAlias =
"TemplateAlias";
41const char *
const KindTemplatePack =
"TemplatePack";
42const char *
const KindUndefined =
"Undefined";
43const char *
const KindUnion =
"Union";
51 const char *
Kind = KindUndefined;
54 else if (getIsModule())
56 else if (getIsBlock())
58 else if (getIsCallSite())
60 else if (getIsCompileUnit())
61 Kind = KindCompileUnit;
62 else if (getIsEnumeration())
63 Kind = KindEnumeration;
64 else if (getIsInlinedFunction())
65 Kind = KindInlinedFunction;
66 else if (getIsNamespace())
68 else if (getIsTemplatePack())
69 Kind = KindTemplatePack;
72 else if (getIsTemplateAlias())
73 Kind = KindTemplateAlias;
74 else if (getIsClass())
76 else if (getIsFunction())
78 else if (getIsStructure())
80 else if (getIsUnion())
110const LVTypes LVScope::EmptyTypes{};
112const LVScopes LVScope::EmptyScopes{};
126 else if (
Element->getIsScope())
128 else if (
Element->getIsSymbol())
139 assert(!
Line->getParent() &&
"Line already inserted");
141 Lines = std::make_unique<LVLines>();
145 Line->setParent(
this);
157 traverseParents(&LVScope::getHasLines, &LVScope::setHasLines);
165 Ranges = std::make_unique<LVLocations>();
178 assert(!
Scope->getParent() &&
"Scope already inserted");
180 Scopes = std::make_unique<LVScopes>();
184 Scope->setParent(
this);
192 if (
Scope->getIsGlobalReference())
193 traverseParents(&LVScope::getHasGlobals, &LVScope::setHasGlobals);
195 traverseParents(&LVScope::getHasLocals, &LVScope::setHasLocals);
198 traverseParents(&LVScope::getHasScopes, &LVScope::setHasScopes);
204 assert(!
Symbol->getParent() &&
"Symbol already inserted");
206 Symbols = std::make_unique<LVSymbols>();
218 if (
Symbol->getIsGlobalReference())
219 traverseParents(&LVScope::getHasGlobals, &LVScope::setHasGlobals);
221 traverseParents(&LVScope::getHasLocals, &LVScope::setHasLocals);
224 traverseParents(&LVScope::getHasSymbols, &LVScope::setHasSymbols);
230 assert(!
Type->getParent() &&
"Type already inserted");
232 Types = std::make_unique<LVTypes>();
236 Type->setParent(
this);
244 if (
Type->getIsGlobalReference())
245 traverseParents(&LVScope::getHasGlobals, &LVScope::setHasGlobals);
247 traverseParents(&LVScope::getHasLocals, &LVScope::setHasLocals);
250 traverseParents(&LVScope::getHasTypes, &LVScope::setHasTypes);
257 Location->setLowerAddress(LowerAddress);
258 Location->setUpperAddress(UpperAddress);
268 auto RemoveElement = [
Element, Predicate](
auto &Container) ->
bool {
270 if (Iter != Container->end()) {
271 Container->erase(Iter, Container->end());
281 return RemoveElement(
Lines);
286 return RemoveElement(
Types);
288 return RemoveElement(
Scopes);
300 if (!ReferenceSymbols)
304 References.
append(ReferenceSymbols->
begin(), ReferenceSymbols->
end());
310 if (
Symbol->getHasReferenceAbstract())
315 if (References.
size()) {
317 dbgs() <<
"Insert Missing Inlined Elements\n"
346 Symbol->setIsUnspecified();
360 Element->updateLevel(
this, Moved);
365 Line->updateLevel(
this, Moved);
377 if (getIsGlobalReference())
379 Element->setIsGlobalReference();
385 if (getIsResolvedName())
404 if (getIsArtificial())
459 if (getHasReference() && !
isNamed())
472 if (
Type->getIsTemplateParam()) {
477 return !Params.
empty();
482 if (getIsTemplateResolved())
484 setIsTemplateResolved();
487 if (
options().getAttributeEncoded()) {
490 std::string EncodedArgs;
501 if (getIsRoot() || getIsCompileUnit())
525 std::string BaseName;
527 if (getIsTemplateResolved())
528 Name.append(BaseName);
538 bool AddComma =
false;
550bool LVScope::resolvePrinting()
const {
554 if (
options().getPrintWarnings() && (getIsRoot() || getIsCompileUnit()))
560 if (
options().getSelectExecute()) {
561 return getIsRoot() || getIsCompileUnit() || getHasPattern();
564 bool Globals =
options().getAttributeGlobal();
565 bool Locals =
options().getAttributeLocal();
566 if ((Globals && Locals) || (!Globals && !Locals)) {
570 if ((Globals && !(getHasGlobals() || getIsGlobalReference())) ||
571 (Locals && !(getHasLocals() || !getIsGlobalReference())))
576 if (getIsFunction() && getIsArtificial() &&
577 !
options().getAttributeGenerated())
590 if (getIsSystem() && !
options().getAttributeSystem())
595 if (getIsCompileUnit()) {
598 std::string ScopeName(
getName());
599 if (std::error_code
EC =
608 bool DoPrint = (
options().getAttributeDiscarded()) ?
true : !getIsDiscarded();
616 getIsInCompare() ?
options().getReportExecute() : resolvePrinting();
622 DoPrint = DoPrint && (Print ||
options().getOutputSplit());
630 if ((getIsRoot() ||
options().getPrintAnyElement()) &&
631 options().getPrintFormatting() &&
635 if (Match && !
Element->getHasPattern())
645 if (Match && !
Line->getHasPattern())
653 if (
options().getPrintWarnings())
660 if (getIsCompileUnit()) {
661 if (
options().getPrintSummary())
671 if (getIsRoot() &&
options().getPrintWarnings()) {
688 Traverse(Parent->Types, SortFunction);
689 Traverse(Parent->Symbols, SortFunction);
690 Traverse(Parent->Scopes, SortFunction);
695 Sort(
Scope, SortFunction);
699 Sort(
this, SortFunction);
709 if ((Parent->*GetFunction)())
711 (Parent->*SetFunction)();
718 if (
options().getReportParents()) {
723 if ((Parent->*GetFunction)())
725 (Parent->*SetFunction)();
726 Parent = Parent->getParentScope();
731 auto Traverse = [&](
const auto *Set) {
733 for (
const auto &Entry : *Set)
734 (Entry->*SetFunction)();
737 (
Scope->*SetFunction)();
739 Traverse(
Scope->getTypes());
740 Traverse(
Scope->getSymbols());
741 Traverse(
Scope->getLines());
745 TraverseChildren(
Scope);
748 if (
options().getReportChildren())
749 TraverseChildren(
this);
761 Symbol->getLocations(LocationList, ValidLocation, RecordInvalid);
764 Scope->getLocations(LocationList, ValidLocation, RecordInvalid);
774 if (getIsDiscarded())
781 if (!(
Location->*ValidLocation)() && RecordInvalid)
792 Scope->getRanges(LocationList, ValidLocation, RecordInvalid);
798 if (getIsDiscarded())
805 Scope->getRanges(RangeList);
811 const LVLocations *ParentRanges = Parent->getRanges();
816 Parent = Parent->getParentScope();
834 if (!Candidates.
empty()) {
835 dbgs() <<
"\n[LVScope::findIn]\n"
841 for (
const LVScope *Candidate : Candidates)
842 dbgs() <<
"Candidate: "
844 <<
"Level = " << Candidate->getLevel() <<
", "
850 if (!Candidates.
empty())
851 return (Candidates.
size() == 1)
852 ? (
equals(Candidates[0]) ? Candidates[0] :
nullptr)
863 (
options().getCompareSymbols() &&
870 auto SetCompareState = [&](
auto &Container) {
872 for (
auto *Entry : *Container)
873 Entry->setIsInCompare();
875 SetCompareState(
Types);
877 SetCompareState(
Lines);
895 bool TraverseChildren) {
896 if (!(References && Targets))
900 dbgs() <<
"\n[LVScope::markMissingParents]\n";
902 dbgs() <<
"References: "
904 <<
"Level = " <<
Reference->getLevel() <<
", "
908 dbgs() <<
"Targets : "
910 <<
"Level = " <<
Target->getLevel() <<
", "
921 dbgs() <<
"\nSearch Reference: "
928 dbgs() <<
"\nFound Target: "
932 if (TraverseChildren)
936 dbgs() <<
"Missing Reference: "
949 if (getIsLexicalBlock() &&
Scope->getIsLexicalBlock())
963 if (!References && !Targets)
965 if (References && Targets && References->
size() == Targets->
size()) {
987 if (
options().getPrintFormatting() &&
options().getAttributeRange() &&
995 if (
options().getPrintFormatting() &&
options().getAttributeEncoded())
1001 if (getIncludeInPrint() &&
getReader().doPrintScope(
this)) {
1004 if (!(getIsRoot() || (getIsCompileUnit() &&
options().getSelectExecute())))
1014 if (!getIsBlock()) {
1016 if (!getIsAggregate()) {
1020 if (
options().getAttributeSize())
1022 OS <<
" [Size = " <<
Size <<
"]";
1027 if (
Full && getIsBlock())
1064 if (getIsTemplateResolved())
1094 if (getIsArrayResolved())
1096 setIsArrayResolved();
1119 if (
Type->getIsSubrange()) {
1132 std::stringstream ArrayInfo;
1137 if (
Type->getIsSubrangeCount())
1139 ArrayInfo <<
"[" <<
Type->getCount() <<
"]";
1142 unsigned LowerBound;
1143 unsigned UpperBound;
1144 std::tie(LowerBound, UpperBound) =
Type->getBounds();
1151 ArrayInfo <<
"[" << LowerBound <<
".." << UpperBound <<
"]";
1153 ArrayInfo <<
"[" << UpperBound + 1 <<
"]";
1188 "CU [0x%08" PRIx64
"], Scope [0x%08" PRIx64
"], Range [0x%08" PRIx64
1189 ":0x%08" PRIx64
"], Size = %" PRId64
"\n",
1199 CUContributionSize =
Size;
1208 if (!
options().getSelectExecute())
1211 if (MatchedScopes.size()) {
1213 Scope->traverseParentsAndChildren(&LVScope::getHasPattern,
1214 &LVScope::setHasPattern);
1224 if (
options().getAttributeRange()) {
1227 bool RecordInvalid =
options().getWarningRanges();
1236 if (
options().getAttributeLocation()) {
1239 bool RecordInvalid =
options().getWarningLocations();
1257 LVAddressToLine *Map = SectionMappings.findMap(SectionIndex);
1258 if (!Map || Map->empty())
1260 LVAddressToLine::const_iterator Iter = Map->lower_bound(
Address);
1261 return (Iter != Map->end()) ? Iter->second :
nullptr;
1267 LVAddressToLine *Map = SectionMappings.findMap(SectionIndex);
1268 if (!Map || Map->empty())
1270 LVAddressToLine::const_iterator Iter = Map->upper_bound(
Address);
1271 if (Iter != Map->begin())
1272 Iter = std::prev(Iter);
1273 return Iter->second;
1281 LVLine *LowLine = lineLowerBound(
Location->getLowerAddress(), Parent);
1282 LVLine *HighLine = lineUpperBound(
Location->getUpperAddress(), Parent);
1287 if (Index <= 0 || Index > Filenames.size())
1300 options().getSelectExecute() ? ++Found.Lines : ++Printed.Lines;
1303 options().getSelectExecute() ? ++Found.Scopes : ++Printed.Scopes;
1306 options().getSelectExecute() ? ++Found.Symbols : ++Printed.Symbols;
1309 options().getSelectExecute() ? ++Found.Types : ++Printed.Types;
1314 if (
Line->getIncludeInPrint())
1318 if (
Scope->getIncludeInPrint())
1322 if (
Symbol->getIncludeInPrint())
1323 ++Allocated.Symbols;
1326 if (
Type->getIncludeInPrint())
1357 if (WarningOffsets.find(
Offset) == WarningOffsets.end())
1364 if (InvalidCoverages.find(
Offset) == InvalidCoverages.end())
1389 if (!
options().getPrintFormatting())
1397 enum class Option { Directory, File };
1398 auto PrintNames = [&](Option Action) {
1399 StringRef Kind = Action == Option::Directory ?
"Directory" :
"File";
1400 std::set<std::string> UniqueNames;
1401 for (
size_t Index : Filenames) {
1405 size_t Pos =
Name.rfind(
'/');
1406 if (Pos != std::string::npos)
1407 Name = (Action == Option::File) ?
Name.substr(Pos + 1)
1408 :
Name.substr(0, Pos);
1410 UniqueNames.insert(std::string(
Name));
1412 for (
const std::string &
Name : UniqueNames)
1417 if (
options().getAttributeDirectories())
1418 PrintNames(Option::Directory);
1419 if (
options().getAttributeFiles())
1420 PrintNames(Option::File);
1421 if (
options().getAttributePublics()) {
1425 using OffsetSorted = std::map<LVAddress, LVPublicNames::const_iterator>;
1426 OffsetSorted SortedNames;
1427 for (LVPublicNames::const_iterator Iter = PublicNames.begin();
1428 Iter != PublicNames.end(); ++Iter)
1429 SortedNames.emplace(Iter->first->getOffset(), Iter);
1431 LVPublicNames::const_iterator Iter;
1432 for (OffsetSorted::reference Entry : SortedNames) {
1433 Iter = Entry.second;
1436 if (
options().getAttributeOffset()) {
1438 size_t Size = (*Iter).second.second;
1448 auto PrintHeader = [&](
const char *Header) { OS <<
"\n" << Header <<
":\n"; };
1449 auto PrintFooter = [&](
auto &Set) {
1462 LVOffsetElementMap::const_iterator Iter = Map.find(
Offset);
1471 const char *Header) {
1472 PrintHeader(Header);
1473 for (LVOffsetLocationsMap::const_reference Entry : Map) {
1474 PrintElement(WarningOffsets, Entry.first);
1477 <<
Location->getIntervalInfo() <<
"\n";
1483 PrintHeader(
"Unsupported DWARF Tags");
1484 for (LVTagOffsetsMap::const_reference Entry : DebugTags) {
1485 OS <<
format(
"\n0x%02x", (
unsigned)Entry.first) <<
", "
1492 PrintFooter(DebugTags);
1495 if (
options().getWarningCoverages()) {
1496 PrintHeader(
"Symbols Invalid Coverages");
1497 for (LVOffsetSymbolMap::const_reference Entry : InvalidCoverages) {
1501 <<
format(
"%.2f%%",
Symbol->getCoveragePercentage()) <<
" "
1505 PrintFooter(InvalidCoverages);
1508 if (
options().getWarningLines()) {
1509 PrintHeader(
"Lines Zero References");
1510 for (LVOffsetLinesMap::const_reference Entry : LinesZero) {
1511 PrintElement(WarningOffsets, Entry.first);
1517 PrintFooter(LinesZero);
1520 if (
options().getWarningLocations())
1521 PrintInvalidLocations(InvalidLocations,
"Invalid Location Ranges");
1523 if (
options().getWarningRanges())
1524 PrintInvalidLocations(InvalidRanges,
"Invalid Code Ranges");
1527void LVScopeCompileUnit::printTotals(
raw_ostream &OS)
const {
1528 OS <<
"\nTotals by lexical level:\n";
1529 for (
size_t Index = 1; Index <= MaxSeenLevel; ++Index)
1530 OS <<
format(
"[%03d]: %10d (%6.2f%%)\n", Index, Totals[Index].first,
1531 Totals[Index].second);
1535 LVSizesMap::const_iterator Iter =
Sizes.find(Scope);
1536 if (Iter !=
Sizes.end()) {
1538 assert(CUContributionSize &&
"Invalid CU contribution size.");
1542 rint((
float(
Size) / CUContributionSize) * 100.0 * 100.0) / 100.0;
1543 OS <<
format(
"%10" PRId64
" (%6.2f%%) : ",
Size, Percentage);
1547 LVLevel Level = Scope->getLevel();
1548 if (Level > MaxSeenLevel)
1549 MaxSeenLevel = Level;
1550 if (Level >= Totals.
size())
1551 Totals.
resize(2 * Level);
1552 Totals[Level].first +=
Size;
1553 Totals[Level].second += Percentage;
1562 if (
options().getSelectExecute() &&
options().getReportAnyView()) {
1565 printScopeSize(
Scope, OS);
1571 printScopeSize(
Scope, OS);
1577 bool PrintScopes =
options().getPrintScopes();
1582 OS <<
"\nScope Sizes:\n";
1583 options().resetPrintFormatting();
1588 printScopeSize(
this, OS);
1595 options().setPrintFormatting();
1607 const char *Header)
const {
1608 std::string Separator = std::string(29,
'-');
1609 auto PrintSeparator = [&]() { OS << Separator <<
"\n"; };
1610 auto PrintHeadingRow = [&](
const char *
T,
const char *U,
const char *V) {
1611 OS <<
format(
"%-9s%9s %9s\n",
T, U, V);
1613 auto PrintDataRow = [&](
const char *
T,
unsigned U,
unsigned V) {
1614 OS <<
format(
"%-9s%9d %9d\n",
T, U, V);
1619 PrintHeadingRow(
"Element",
"Total", Header);
1621 PrintDataRow(
"Scopes", Allocated.Scopes, Counter.
Scopes);
1622 PrintDataRow(
"Symbols", Allocated.Symbols, Counter.
Symbols);
1623 PrintDataRow(
"Types", Allocated.Types, Counter.
Types);
1624 PrintDataRow(
"Lines", Allocated.Lines, Counter.
Lines);
1628 Allocated.Scopes + Allocated.Symbols + Allocated.Lines + Allocated.Types,
1633 bool UseMatchedElements) {
1641 if (
options().getPrintAnyElement()) {
1642 if (UseMatchedElements)
1646 if (UseMatchedElements) {
1660 if (
options().getPrintSummary()) {
1664 if (!
options().getReportList()) {
1666 if (!
Element->getIncludeInPrint())
1670 else if (
Element->getIsSymbol())
1672 else if (
Element->getIsScope())
1674 else if (
Element->getIsLine())
1686 if (
options().getPrintSizes()) {
1690 OS <<
"\nScope Sizes:\n";
1691 printScopeSize(
this, OS);
1714 if (
options().getPrintFormatting()) {
1715 if (
options().getAttributeProducer())
1720 if (
options().getAttributeLanguage())
1777 if (
options().getAttributeInserted() && getHasReferenceAbstract() &&
1778 !getAddedMissing()) {
1783 if (
Scope->getHasReferenceAbstract() && !
Scope->getAddedMissing())
1784 Scope->addMissingElements(
Scope->getReference());
1799 if (getHasReferenceSpecification()) {
1801 if (Reference && Reference->getIsExternal()) {
1802 Reference->resetIsExternal();
1810 setType(Reference->getType());
1821 if (getIsTemplate())
1846 if (
options().getCompareLines() &&
1883 std::string Attributes =
1895 if (getIsTemplateResolved())
1911 if (getIsTemplate())
1920 if (getHasDiscriminator() &&
Scope->getHasDiscriminator())
1945 if (getIsMemberPointerResolved())
1947 setIsMemberPointerResolved();
1951 Name.append(
" (*)");
1956 bool AddComma =
false;
1958 if (
Symbol->getIsParameter()) {
1961 Type->resolveName();
1964 Name.append(std::string(
Symbol->getTypeName()));
2032 if (!
options().getAttributeAnyLocation())
2046 std::function<void(
LVScope * Parent)> TraverseScope = [&](
LVScope *Parent) {
2047 auto Traverse = [&](
const auto *Set) {
2049 for (
const auto &Entry : *Set)
2050 Entry->setInnerComponent();
2054 Scope->setInnerComponent();
2055 TraverseScope(
Scope);
2057 Traverse(Parent->getSymbols());
2058 Traverse(Parent->getTypes());
2059 Traverse(Parent->getLines());
2063 TraverseScope(
this);
2071 OS <<
"\nLogical View:\n";
2077 if (
options().getAttributeFormat())
2083 bool UseMatchedElements)
const {
2089 if (UseMatchedElements)
2090 options().resetPrintFormatting();
2099 std::string ScopeName(
Scope->getName());
2100 if (std::error_code
EC =
2107 Scope->printMatchedElements(*StreamSplit, UseMatchedElements);
2115 if (UseMatchedElements)
2116 options().setPrintFormatting();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
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 ...
LLVM_ABI 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())
LVElement(LVSubclassID ID)
virtual void resolveName()
StringRef virtualityString(uint32_t Virtuality=dwarf::DW_VIRTUALITY_none) const
uint32_t getInlineCode() const
StringRef typeAsString() 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
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
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
uint32_t getStorageSizeInBytes() const
bool isNamed() const override
static void markMissingParents(const LVLines *References, const LVLines *Targets)
virtual bool equals(const LVLine *Line) 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
LVOffset getOffset() 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)
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)
LVSourceLanguage getSourceLanguage() const override
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
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
LVElementsView getChildren() const
void printActiveRanges(raw_ostream &OS, bool Full=true) const
size_t scopeCount() const
const LVSymbols * getSymbols() const
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
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)
virtual void printSizes(raw_ostream &OS) const
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
LVElements getSortedChildren(LVSortFunction SortFunction=llvm::logicalview::getSortFunction()) const
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
static void markMissingParents(const LVSymbols *References, const LVSymbols *Targets)
static bool parametersMatch(const LVSymbols *References, const LVSymbols *Targets)
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.
LLVM_ABI 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::map< LVOffset, LVElement * > LVOffsetElementMap
std::string formattedNames(StringRef Name1, StringRef Name2)
LLVM_ABI LVStringPool & getStringPool()
SmallVector< LVElement *, 8 > LVElements
bool(LVScope::*)() const LVScopeGetFunction
std::string formattedKind(StringRef Kind)
std::map< LVOffset, LVLocations > LVOffsetLocationsMap
void addItem(MapType *Map, KeyType Key, ValueType Value)
LVScopeCompileUnit * getReaderCompileUnit()
SmallVector< LVScope *, 8 > LVScopes
std::map< LVScopeKind, LVScopeGetFunction > LVScopeDispatch
bool(LVLocation::*)() LVValidLocation
LVSortValue(*)(const LVObject *LHS, const LVObject *RHS) LVSortFunction
void(LVScope::*)() LVScopeSetFunction
LLVM_ABI LVSortValue compareRange(const LVObject *LHS, const LVObject *RHS)
std::string hexSquareString(uint64_t Value)
SmallVector< LVSymbol *, 8 > LVSymbols
LVSplitContext & getReaderSplitContext()
LLVM_ABI LVSortFunction getSortFunction()
std::string formattedName(StringRef Name)
std::pair< LVLine *, LVLine * > LVLineRange
bool(LVObject::*)() const LVObjectGetFunction
std::string formatAttributes(const StringRef First, Args... Others)
LVCompare & getComparator()
SmallVector< LVType *, 8 > LVTypes
void(LVObject::*)() LVObjectSetFunction
SmallVector< LVLocation *, 8 > LVLocations
This is an optimization pass for GlobalISel generic memory operations.
void stable_sort(R &&Range)
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:
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
FunctionAddr VTableAddr Count
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
auto remove_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::remove_if which take ranges instead of having to pass begin/end explicitly.