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())
112 Children = std::make_unique<LVElements>();
120 else if (
Element->getIsScope())
122 else if (
Element->getIsSymbol())
133 assert(!
Line->getParent() &&
"Line already inserted");
135 Lines = std::make_unique<LVLines>();
139 Line->setParent(
this);
151 traverseParents(&LVScope::getHasLines, &LVScope::setHasLines);
159 Ranges = std::make_unique<LVLocations>();
174 Scopes = std::make_unique<LVScopes>();
187 if (
Scope->getIsGlobalReference())
188 traverseParents(&LVScope::getHasGlobals, &LVScope::setHasGlobals);
190 traverseParents(&LVScope::getHasLocals, &LVScope::setHasLocals);
193 traverseParents(&LVScope::getHasScopes, &LVScope::setHasScopes);
201 Symbols = std::make_unique<LVSymbols>();
214 if (
Symbol->getIsGlobalReference())
215 traverseParents(&LVScope::getHasGlobals, &LVScope::setHasGlobals);
217 traverseParents(&LVScope::getHasLocals, &LVScope::setHasLocals);
220 traverseParents(&LVScope::getHasSymbols, &LVScope::setHasSymbols);
226 assert(!
Type->getParent() &&
"Type already inserted");
228 Types = std::make_unique<LVTypes>();
233 Type->setParent(
this);
241 if (
Type->getIsGlobalReference())
242 traverseParents(&LVScope::getHasGlobals, &LVScope::setHasGlobals);
244 traverseParents(&LVScope::getHasLocals, &LVScope::setHasLocals);
247 traverseParents(&LVScope::getHasTypes, &LVScope::setHasTypes);
254 Location->setLowerAddress(LowerAddress);
255 Location->setUpperAddress(UpperAddress);
265 auto RemoveElement = [
Element, Predicate](
auto &Container) ->
bool {
267 if (Iter != Container->end()) {
268 Container->erase(Iter, Container->end());
278 return RemoveElement(
Lines);
284 return RemoveElement(
Types);
286 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();
366 Line->updateLevel(
this, Moved);
379 if (getIsGlobalReference())
381 Element->setIsGlobalReference();
387 if (getIsResolvedName())
406 if (getIsArtificial())
461 if (getHasReference() && !
isNamed())
474 if (
Type->getIsTemplateParam()) {
479 return !Params.
empty();
484 if (getIsTemplateResolved())
486 setIsTemplateResolved();
489 if (
options().getAttributeEncoded()) {
492 std::string EncodedArgs;
503 if (getIsRoot() || getIsCompileUnit())
527 std::string BaseName;
529 if (getIsTemplateResolved())
530 Name.append(BaseName);
540 bool AddComma =
false;
552bool LVScope::resolvePrinting()
const {
556 if (
options().getPrintWarnings() && (getIsRoot() || getIsCompileUnit()))
562 if (
options().getSelectExecute()) {
563 return getIsRoot() || getIsCompileUnit() || getHasPattern();
566 bool Globals =
options().getAttributeGlobal();
567 bool Locals =
options().getAttributeLocal();
568 if ((Globals && Locals) || (!Globals && !Locals)) {
572 if ((Globals && !(getHasGlobals() || getIsGlobalReference())) ||
573 (Locals && !(getHasLocals() || !getIsGlobalReference())))
578 if (getIsFunction() && getIsArtificial() &&
579 !
options().getAttributeGenerated())
592 if (getIsSystem() && !
options().getAttributeSystem())
597 if (getIsCompileUnit()) {
600 std::string ScopeName(
getName());
601 if (std::error_code
EC =
610 bool DoPrint = (
options().getAttributeDiscarded()) ?
true : !getIsDiscarded();
618 getIsInCompare() ?
options().getReportExecute() : resolvePrinting();
624 DoPrint = DoPrint && (Print ||
options().getOutputSplit());
632 if ((getIsRoot() ||
options().getPrintAnyElement()) &&
633 options().getPrintFormatting() &&
638 if (Match && !
Element->getHasPattern())
648 if (Match && !
Line->getHasPattern())
656 if (
options().getPrintWarnings())
663 if (getIsCompileUnit()) {
664 if (
options().getPrintSummary())
674 if (getIsRoot() &&
options().getPrintWarnings()) {
691 Traverse(Parent->
Types, SortFunction);
692 Traverse(Parent->
Symbols, SortFunction);
693 Traverse(Parent->
Scopes, SortFunction);
695 Traverse(Parent->
Children, SortFunction);
699 Sort(
Scope, SortFunction);
703 Sort(
this, SortFunction);
713 if ((Parent->*GetFunction)())
715 (Parent->*SetFunction)();
722 if (
options().getReportParents()) {
727 if ((Parent->*GetFunction)())
729 (Parent->*SetFunction)();
735 auto Traverse = [&](
const auto *Set) {
737 for (
const auto &Entry : *Set)
738 (Entry->*SetFunction)();
741 (
Scope->*SetFunction)();
749 TraverseChildren(
Scope);
752 if (
options().getReportChildren())
753 TraverseChildren(
this);
778 if (getIsDiscarded())
785 if (!(
Location->*ValidLocation)() && RecordInvalid)
802 if (getIsDiscarded())
838 if (!Candidates.
empty()) {
839 dbgs() <<
"\n[LVScope::findIn]\n"
841 <<
"Offset = " << hexSquareString(getOffset()) <<
", "
842 <<
"Level = " << getLevel() <<
", "
843 <<
"Kind = " << formattedKind(kind()) <<
", "
844 <<
"Name = " << formattedName(getName()) <<
"\n";
845 for (const LVScope *Candidate : Candidates)
846 dbgs() <<
"Candidate: "
847 <<
"Offset = " << hexSquareString(Candidate->getOffset()) <<
", "
848 <<
"Level = " << Candidate->getLevel() <<
", "
849 <<
"Kind = " << formattedKind(Candidate->kind()) <<
", "
850 <<
"Name = " << formattedName(Candidate->getName()) <<
"\n";
854 if (!Candidates.
empty())
855 return (Candidates.
size() == 1)
856 ? (
equals(Candidates[0]) ? Candidates[0] :
nullptr)
867 (
options().getCompareSymbols() &&
874 auto SetCompareState = [&](
auto &Container) {
876 for (
auto *Entry : *Container)
877 Entry->setIsInCompare();
879 SetCompareState(
Types);
881 SetCompareState(
Lines);
899 bool TraverseChildren) {
900 if (!(References && Targets))
904 dbgs() <<
"\n[LVScope::markMissingParents]\n";
906 dbgs() <<
"References: "
908 <<
"Level = " <<
Reference->getLevel() <<
", "
912 dbgs() <<
"Targets : "
914 <<
"Level = " <<
Target->getLevel() <<
", "
925 dbgs() <<
"\nSearch Reference: "
932 dbgs() <<
"\nFound Target: "
936 if (TraverseChildren)
940 dbgs() <<
"Missing Reference: "
953 if (getIsLexicalBlock() &&
Scope->getIsLexicalBlock())
967 if (!References && !Targets)
969 if (References && Targets && References->
size() == Targets->
size()) {
992 if (
options().getPrintFormatting() &&
options().getAttributeRange() &&
1000 if (
options().getPrintFormatting() &&
options().getAttributeEncoded())
1006 if (getIncludeInPrint() &&
getReader().doPrintScope(
this)) {
1009 if (!(getIsRoot() || (getIsCompileUnit() &&
options().getSelectExecute())))
1019 if (!getIsBlock()) {
1021 if (!getIsAggregate()) {
1025 if (
options().getAttributeSize())
1027 OS <<
" [Size = " <<
Size <<
"]";
1032 if (
Full && getIsBlock())
1069 if (getIsTemplateResolved())
1099 if (getIsArrayResolved())
1101 setIsArrayResolved();
1124 if (
Type->getIsSubrange()) {
1137 std::stringstream ArrayInfo;
1142 if (
Type->getIsSubrangeCount())
1144 ArrayInfo <<
"[" <<
Type->getCount() <<
"]";
1147 unsigned LowerBound;
1148 unsigned UpperBound;
1149 std::tie(LowerBound, UpperBound) =
Type->getBounds();
1156 ArrayInfo <<
"[" << LowerBound <<
".." << UpperBound <<
"]";
1158 ArrayInfo <<
"[" << UpperBound + 1 <<
"]";
1193 "CU [0x%08" PRIx64
"], Scope [0x%08" PRIx64
"], Range [0x%08" PRIx64
1194 ":0x%08" PRIx64
"], Size = %" PRId64
"\n",
1204 CUContributionSize =
Size;
1213 if (!
options().getSelectExecute())
1216 if (MatchedScopes.
size()) {
1219 &LVScope::setHasPattern);
1229 if (
options().getAttributeRange()) {
1232 bool RecordInvalid =
options().getWarningRanges();
1241 if (
options().getAttributeLocation()) {
1244 bool RecordInvalid =
options().getWarningLocations();
1262 LVAddressToLine *Map = SectionMappings.findMap(SectionIndex);
1263 if (!Map || Map->empty())
1265 LVAddressToLine::const_iterator Iter = Map->lower_bound(
Address);
1266 return (Iter != Map->end()) ? Iter->second :
nullptr;
1272 LVAddressToLine *Map = SectionMappings.findMap(SectionIndex);
1273 if (!Map || Map->empty())
1275 LVAddressToLine::const_iterator Iter = Map->upper_bound(
Address);
1276 if (Iter != Map->begin())
1277 Iter = std::prev(Iter);
1278 return Iter->second;
1286 LVLine *LowLine = lineLowerBound(
Location->getLowerAddress(), Parent);
1287 LVLine *HighLine = lineUpperBound(
Location->getUpperAddress(), Parent);
1292 if (Index <= 0 || Index > Filenames.size())
1319 if (
Line->getIncludeInPrint())
1323 if (
Scope->getIncludeInPrint())
1327 if (
Symbol->getIncludeInPrint())
1331 if (
Type->getIncludeInPrint())
1357 addItem<LVTagOffsetsMap, dwarf::Tag, LVOffset>(&DebugTags,
Target,
Offset);
1362 if (WarningOffsets.find(
Offset) == WarningOffsets.end())
1369 if (InvalidCoverages.find(
Offset) == InvalidCoverages.end())
1390 addItem<LVOffsetLinesMap, LVOffset, LVLine *>(&LinesZero,
Offset,
Line);
1394 if (!
options().getPrintFormatting())
1402 enum class Option { Directory, File };
1403 auto PrintNames = [&](Option Action) {
1404 StringRef Kind = Action == Option::Directory ?
"Directory" :
"File";
1405 std::set<std::string> UniqueNames;
1406 for (
size_t Index : Filenames) {
1410 size_t Pos =
Name.rfind(
'/');
1411 if (Pos != std::string::npos)
1412 Name = (Action == Option::File) ?
Name.substr(Pos + 1)
1413 :
Name.substr(0, Pos);
1415 UniqueNames.insert(std::string(
Name));
1417 for (
const std::string &
Name : UniqueNames)
1422 if (
options().getAttributeDirectories())
1423 PrintNames(Option::Directory);
1424 if (
options().getAttributeFiles())
1425 PrintNames(Option::File);
1426 if (
options().getAttributePublics()) {
1430 using OffsetSorted = std::map<LVAddress, LVPublicNames::const_iterator>;
1431 OffsetSorted SortedNames;
1432 for (LVPublicNames::const_iterator Iter = PublicNames.begin();
1433 Iter != PublicNames.end(); ++Iter)
1434 SortedNames.emplace(Iter->first->getOffset(), Iter);
1436 LVPublicNames::const_iterator Iter;
1437 for (OffsetSorted::reference Entry : SortedNames) {
1438 Iter = Entry.second;
1441 if (
options().getAttributeOffset()) {
1443 size_t Size = (*Iter).second.second;
1453 auto PrintHeader = [&](
const char *Header) {
OS <<
"\n" << Header <<
":\n"; };
1454 auto PrintFooter = [&](
auto &Set) {
1467 LVOffsetElementMap::const_iterator Iter = Map.find(
Offset);
1476 const char *Header) {
1477 PrintHeader(Header);
1478 for (LVOffsetLocationsMap::const_reference Entry : Map) {
1479 PrintElement(WarningOffsets, Entry.first);
1482 <<
Location->getIntervalInfo() <<
"\n";
1488 PrintHeader(
"Unsupported DWARF Tags");
1489 for (LVTagOffsetsMap::const_reference Entry : DebugTags) {
1490 OS <<
format(
"\n0x%02x", (
unsigned)Entry.first) <<
", "
1494 PrintOffset(Count,
Offset);
1497 PrintFooter(DebugTags);
1500 if (
options().getWarningCoverages()) {
1501 PrintHeader(
"Symbols Invalid Coverages");
1502 for (LVOffsetSymbolMap::const_reference Entry : InvalidCoverages) {
1510 PrintFooter(InvalidCoverages);
1513 if (
options().getWarningLines()) {
1514 PrintHeader(
"Lines Zero References");
1515 for (LVOffsetLinesMap::const_reference Entry : LinesZero) {
1516 PrintElement(WarningOffsets, Entry.first);
1519 PrintOffset(Count,
Line->getOffset());
1522 PrintFooter(LinesZero);
1525 if (
options().getWarningLocations())
1526 PrintInvalidLocations(InvalidLocations,
"Invalid Location Ranges");
1528 if (
options().getWarningRanges())
1529 PrintInvalidLocations(InvalidRanges,
"Invalid Code Ranges");
1532void LVScopeCompileUnit::printTotals(
raw_ostream &
OS)
const {
1533 OS <<
"\nTotals by lexical level:\n";
1534 for (
size_t Index = 1; Index <= MaxSeenLevel; ++Index)
1535 OS <<
format(
"[%03d]: %10d (%6.2f%%)\n", Index, Totals[Index].first,
1536 Totals[Index].second);
1540 LVSizesMap::const_iterator Iter = Sizes.find(
Scope);
1541 if (Iter != Sizes.end()) {
1543 assert(CUContributionSize &&
"Invalid CU contribution size.");
1547 rint((
float(
Size) / CUContributionSize) * 100.0 * 100.0) / 100.0;
1548 OS <<
format(
"%10" PRId64
" (%6.2f%%) : ",
Size, Percentage);
1553 if (Level > MaxSeenLevel)
1554 MaxSeenLevel =
Level;
1555 if (Level >= Totals.
size())
1556 Totals.
resize(2 * Level);
1558 Totals[
Level].second += Percentage;
1567 if (
options().getSelectExecute() &&
options().getReportAnyView()) {
1582 bool PrintScopes =
options().getPrintScopes();
1587 OS <<
"\nScope Sizes:\n";
1588 options().resetPrintFormatting();
1593 printScopeSize(
this,
OS);
1600 options().setPrintFormatting();
1612 const char *Header)
const {
1613 std::string Separator = std::string(29,
'-');
1614 auto PrintSeparator = [&]() {
OS << Separator <<
"\n"; };
1615 auto PrintHeadingRow = [&](
const char *
T,
const char *U,
const char *V) {
1618 auto PrintDataRow = [&](
const char *
T,
unsigned U,
unsigned V) {
1624 PrintHeadingRow(
"Element",
"Total", Header);
1626 PrintDataRow(
"Scopes", Allocated.
Scopes, Counter.
Scopes);
1628 PrintDataRow(
"Types", Allocated.
Types, Counter.
Types);
1629 PrintDataRow(
"Lines", Allocated.
Lines, Counter.
Lines);
1638 bool UseMatchedElements) {
1646 if (
options().getPrintAnyElement()) {
1647 if (UseMatchedElements)
1651 if (UseMatchedElements) {
1666 if (
options().getPrintSummary()) {
1670 if (!
options().getReportList()) {
1672 if (!
Element->getIncludeInPrint())
1676 else if (
Element->getIsSymbol())
1678 else if (
Element->getIsScope())
1680 else if (
Element->getIsLine())
1692 if (
options().getPrintSizes()) {
1696 OS <<
"\nScope Sizes:\n";
1697 printScopeSize(
this,
OS);
1720 if (
options().getPrintFormatting()) {
1721 if (
options().getAttributeProducer())
1726 if (
options().getAttributeLanguage())
1783 if (
options().getAttributeInserted() && getHasReferenceAbstract() &&
1784 !getAddedMissing()) {
1789 if (
Scope->getHasReferenceAbstract() && !
Scope->getAddedMissing())
1805 if (getHasReferenceSpecification()) {
1827 if (getIsTemplate())
1852 if (
options().getCompareLines() &&
1901 if (getIsTemplateResolved())
1917 if (getIsTemplate())
1926 if (getHasDiscriminator() &&
Scope->getHasDiscriminator())
1951 if (getIsMemberPointerResolved())
1953 setIsMemberPointerResolved();
1957 Name.append(
" (*)");
1962 bool AddComma =
false;
1964 if (
Symbol->getIsParameter()) {
1967 Type->resolveName();
2038 if (!
options().getAttributeAnyLocation())
2052 std::function<void(
LVScope * Parent)> TraverseScope = [&](
LVScope *Parent) {
2053 auto Traverse = [&](
const auto *Set) {
2055 for (
const auto &Entry : *Set)
2056 Entry->setInnerComponent();
2061 TraverseScope(
Scope);
2069 TraverseScope(
this);
2077 OS <<
"\nLogical View:\n";
2083 if (
options().getAttributeFormat())
2089 bool UseMatchedElements)
const {
2095 if (UseMatchedElements)
2096 options().resetPrintFormatting();
2106 if (std::error_code
EC =
2121 if (UseMatchedElements)
2122 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())
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
uint32_t getStorageSizeInBytes() 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)
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
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.
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::string formattedNames(StringRef Name1, StringRef Name2)
std::map< LVOffset, LVElement * > LVOffsetElementMap
LLVM_ABI LVStringPool & getStringPool()
std::pair< LVLine *, LVLine * > LVLineRange
std::map< LVScopeKind, LVScopeGetFunction > LVScopeDispatch
std::string formattedKind(StringRef Kind)
std::map< LVOffset, LVLocations > LVOffsetLocationsMap
LVScopeCompileUnit * getReaderCompileUnit()
LLVM_ABI 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()
LLVM_ABI 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.
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.
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.