llvm/llvm/lib/DebugInfo/LogicalView/Core/LVScope.cpp

//===-- LVScope.cpp -------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This implements the LVScope class.
//
//===----------------------------------------------------------------------===//

#include "llvm/DebugInfo/LogicalView/Core/LVScope.h"
#include "llvm/DebugInfo/LogicalView/Core/LVCompare.h"
#include "llvm/DebugInfo/LogicalView/Core/LVLine.h"
#include "llvm/DebugInfo/LogicalView/Core/LVLocation.h"
#include "llvm/DebugInfo/LogicalView/Core/LVRange.h"
#include "llvm/DebugInfo/LogicalView/Core/LVReader.h"
#include "llvm/DebugInfo/LogicalView/Core/LVSymbol.h"
#include "llvm/DebugInfo/LogicalView/Core/LVType.h"

usingnamespacellvm;
usingnamespacellvm::logicalview;

#define DEBUG_TYPE

namespace {
const char *const KindArray =;
const char *const KindBlock =;
const char *const KindCallSite =;
const char *const KindClass =;
const char *const KindCompileUnit =;
const char *const KindEnumeration =;
const char *const KindFile =;
const char *const KindFunction =;
const char *const KindInlinedFunction =;
const char *const KindNamespace =;
const char *const KindStruct =;
const char *const KindTemplateAlias =;
const char *const KindTemplatePack =;
const char *const KindUndefined =;
const char *const KindUnion =;
} // end anonymous namespace

//===----------------------------------------------------------------------===//
// DWARF lexical block, such as: namespace, function, compile unit, module, etc.
//===----------------------------------------------------------------------===//
// Return a string representation for the scope kind.
const char *LVScope::kind() const {}

LVScopeDispatch LVScope::Dispatch =;

void LVScope::addToChildren(LVElement *Element) {}

void LVScope::addElement(LVElement *Element) {}

// Adds the line info item to the ones stored in the scope.
void LVScope::addElement(LVLine *Line) {}

// Add a location.
void LVScope::addObject(LVLocation *Location) {}

// Adds the scope to the child scopes and sets the parent in the child.
void LVScope::addElement(LVScope *Scope) {}

// Adds a symbol to the ones stored in the scope.
void LVScope::addElement(LVSymbol *Symbol) {}

// Adds a type to the ones stored in the scope.
void LVScope::addElement(LVType *Type) {}

// Add a pair of ranges.
void LVScope::addObject(LVAddress LowerAddress, LVAddress UpperAddress) {}

bool LVScope::removeElement(LVElement *Element) {}

void LVScope::addMissingElements(LVScope *Reference) {}

void LVScope::updateLevel(LVScope *Parent, bool Moved) {}

void LVScope::resolve() {}

void LVScope::resolveName() {}

void LVScope::resolveReferences() {}

void LVScope::resolveElements() {}

StringRef LVScope::resolveReferencesChain() {}

// Get template parameter types.
bool LVScope::getTemplateParameterTypes(LVTypes &Params) {}

// Resolve the template parameters/arguments relationship.
void LVScope::resolveTemplate() {}

// Get the qualified name for the template.
void LVScope::getQualifiedName(std::string &QualifiedName) const {}

// Encode the template arguments as part of the template name.
void LVScope::encodeTemplateArguments(std::string &Name) const {}

void LVScope::encodeTemplateArguments(std::string &Name,
                                      const LVTypes *Types) const {}

bool LVScope::resolvePrinting() const {}

Error LVScope::doPrint(bool Split, bool Match, bool Print, raw_ostream &OS,
                       bool Full) const {}

void LVScope::sort() {}

void LVScope::traverseParents(LVScopeGetFunction GetFunction,
                              LVScopeSetFunction SetFunction) {}

void LVScope::traverseParentsAndChildren(LVObjectGetFunction GetFunction,
                                         LVObjectSetFunction SetFunction) {}

// Traverse the symbol location ranges and for each range:
// - Apply the 'ValidLocation' validation criteria.
// - Add any failed range to the 'LocationList'.
// - Calculate location coverage.
void LVScope::getLocations(LVLocations &LocationList,
                           LVValidLocation ValidLocation, bool RecordInvalid) {}

// Traverse the scope ranges and for each range:
// - Apply the 'ValidLocation' validation criteria.
// - Add any failed range to the 'LocationList'.
// - Calculate location coverage.
void LVScope::getRanges(LVLocations &LocationList,
                        LVValidLocation ValidLocation, bool RecordInvalid) {}

// Get all the ranges associated with scopes.
void LVScope::getRanges(LVRange &RangeList) {}

LVScope *LVScope::outermostParent(LVAddress Address) {}

LVScope *LVScope::findIn(const LVScopes *Targets) const {}

bool LVScope::equalNumberOfChildren(const LVScope *Scope) const {}

void LVScope::markMissingParents(const LVScope *Target, bool TraverseChildren) {}

void LVScope::markMissingParents(const LVScopes *References,
                                 const LVScopes *Targets,
                                 bool TraverseChildren) {}

bool LVScope::equals(const LVScope *Scope) const {}

LVScope *LVScope::findEqualScope(const LVScopes *Scopes) const {}

bool LVScope::equals(const LVScopes *References, const LVScopes *Targets) {}

void LVScope::report(LVComparePass Pass) {}

void LVScope::printActiveRanges(raw_ostream &OS, bool Full) const {}

void LVScope::printEncodedArgs(raw_ostream &OS, bool Full) const {}

void LVScope::print(raw_ostream &OS, bool Full) const {}

void LVScope::printExtra(raw_ostream &OS, bool Full) const {}

//===----------------------------------------------------------------------===//
// DWARF Union/Structure/Class.
//===----------------------------------------------------------------------===//
bool LVScopeAggregate::equals(const LVScope *Scope) const {}

LVScope *LVScopeAggregate::findEqualScope(const LVScopes *Scopes) const {}

void LVScopeAggregate::printExtra(raw_ostream &OS, bool Full) const {}

//===----------------------------------------------------------------------===//
// DWARF Template alias.
//===----------------------------------------------------------------------===//
bool LVScopeAlias::equals(const LVScope *Scope) const {}

void LVScopeAlias::printExtra(raw_ostream &OS, bool Full) const {}

//===----------------------------------------------------------------------===//
// DWARF array (DW_TAG_array_type).
//===----------------------------------------------------------------------===//
void LVScopeArray::resolveExtra() {}

bool LVScopeArray::equals(const LVScope *Scope) const {}

void LVScopeArray::printExtra(raw_ostream &OS, bool Full) const {}

//===----------------------------------------------------------------------===//
// An object file (single or multiple CUs).
//===----------------------------------------------------------------------===//
void LVScopeCompileUnit::addSize(LVScope *Scope, LVOffset Lower,
                                 LVOffset Upper) {}

// Update parents and children with pattern information.
void LVScopeCompileUnit::propagatePatternMatch() {}

void LVScopeCompileUnit::processRangeLocationCoverage(
    LVValidLocation ValidLocation) {}

void LVScopeCompileUnit::addMapping(LVLine *Line, LVSectionIndex SectionIndex) {}

LVLine *LVScopeCompileUnit::lineLowerBound(LVAddress Address,
                                           LVScope *Scope) const {}

LVLine *LVScopeCompileUnit::lineUpperBound(LVAddress Address,
                                           LVScope *Scope) const {}

LVLineRange LVScopeCompileUnit::lineRange(LVLocation *Location) const {}

StringRef LVScopeCompileUnit::getFilename(size_t Index) const {}

bool LVScopeCompileUnit::equals(const LVScope *Scope) const {}

void LVScopeCompileUnit::incrementPrintedLines() {}
void LVScopeCompileUnit::incrementPrintedScopes() {}
void LVScopeCompileUnit::incrementPrintedSymbols() {}
void LVScopeCompileUnit::incrementPrintedTypes() {}

// Values are used by '--summary' option (allocated).
void LVScopeCompileUnit::increment(LVLine *Line) {}
void LVScopeCompileUnit::increment(LVScope *Scope) {}
void LVScopeCompileUnit::increment(LVSymbol *Symbol) {}
void LVScopeCompileUnit::increment(LVType *Type) {}

// A new element has been added to the scopes tree. Take the following steps:
// Increase the added element counters, for printing summary.
// During comparison notify the Reader of the new element.
void LVScopeCompileUnit::addedElement(LVLine *Line) {}
void LVScopeCompileUnit::addedElement(LVScope *Scope) {}
void LVScopeCompileUnit::addedElement(LVSymbol *Symbol) {}
void LVScopeCompileUnit::addedElement(LVType *Type) {}

// Record unsuported DWARF tags.
void LVScopeCompileUnit::addDebugTag(dwarf::Tag Target, LVOffset Offset) {}

// Record elements with invalid offsets.
void LVScopeCompileUnit::addInvalidOffset(LVOffset Offset, LVElement *Element) {}

// Record symbols with invalid coverage values.
void LVScopeCompileUnit::addInvalidCoverage(LVSymbol *Symbol) {}

// Record symbols with invalid locations.
void LVScopeCompileUnit::addInvalidLocation(LVLocation *Location) {}

// Record scopes with invalid ranges.
void LVScopeCompileUnit::addInvalidRange(LVLocation *Location) {}

// Record line zero.
void LVScopeCompileUnit::addLineZero(LVLine *Line) {}

void LVScopeCompileUnit::printLocalNames(raw_ostream &OS, bool Full) const {}

void LVScopeCompileUnit::printWarnings(raw_ostream &OS, bool Full) const {}

void LVScopeCompileUnit::printTotals(raw_ostream &OS) const {}

void LVScopeCompileUnit::printScopeSize(const LVScope *Scope, raw_ostream &OS) {}

void LVScopeCompileUnit::printSizes(raw_ostream &OS) const {}

void LVScopeCompileUnit::printSummary(raw_ostream &OS) const {}

// Print summary details for the scopes tree.
void LVScopeCompileUnit::printSummary(raw_ostream &OS, const LVCounter &Counter,
                                      const char *Header) const {}

void LVScopeCompileUnit::printMatchedElements(raw_ostream &OS,
                                              bool UseMatchedElements) {}

void LVScopeCompileUnit::print(raw_ostream &OS, bool Full) const {}

void LVScopeCompileUnit::printExtra(raw_ostream &OS, bool Full) const {}

//===----------------------------------------------------------------------===//
// DWARF enumeration (DW_TAG_enumeration_type).
//===----------------------------------------------------------------------===//
bool LVScopeEnumeration::equals(const LVScope *Scope) const {}

void LVScopeEnumeration::printExtra(raw_ostream &OS, bool Full) const {}

//===----------------------------------------------------------------------===//
// DWARF formal parameter pack (DW_TAG_GNU_formal_parameter_pack).
//===----------------------------------------------------------------------===//
bool LVScopeFormalPack::equals(const LVScope *Scope) const {}

void LVScopeFormalPack::printExtra(raw_ostream &OS, bool Full) const {}

//===----------------------------------------------------------------------===//
// DWARF function.
//===----------------------------------------------------------------------===//
void LVScopeFunction::resolveReferences() {}

void LVScopeFunction::setName(StringRef ObjectName) {}

void LVScopeFunction::resolveExtra() {}

bool LVScopeFunction::equals(const LVScope *Scope) const {}

LVScope *LVScopeFunction::findEqualScope(const LVScopes *Scopes) const {}

void LVScopeFunction::printExtra(raw_ostream &OS, bool Full) const {}

//===----------------------------------------------------------------------===//
// DWARF inlined function (DW_TAG_inlined_function).
//===----------------------------------------------------------------------===//
void LVScopeFunctionInlined::resolveExtra() {}

bool LVScopeFunctionInlined::equals(const LVScope *Scope) const {}

LVScope *LVScopeFunctionInlined::findEqualScope(const LVScopes *Scopes) const {}

void LVScopeFunctionInlined::printExtra(raw_ostream &OS, bool Full) const {}

//===----------------------------------------------------------------------===//
// DWARF subroutine type.
//===----------------------------------------------------------------------===//
// Resolve a Subroutine Type (Callback).
void LVScopeFunctionType::resolveExtra() {}

//===----------------------------------------------------------------------===//
// DWARF namespace (DW_TAG_namespace).
//===----------------------------------------------------------------------===//
bool LVScopeNamespace::equals(const LVScope *Scope) const {}

LVScope *LVScopeNamespace::findEqualScope(const LVScopes *Scopes) const {}

void LVScopeNamespace::printExtra(raw_ostream &OS, bool Full) const {}

//===----------------------------------------------------------------------===//
// An object file (single or multiple CUs).
//===----------------------------------------------------------------------===//
void LVScopeRoot::processRangeInformation() {}

void LVScopeRoot::transformScopedName() {}

bool LVScopeRoot::equals(const LVScope *Scope) const {}

void LVScopeRoot::print(raw_ostream &OS, bool Full) const {}

void LVScopeRoot::printExtra(raw_ostream &OS, bool Full) const {}

Error LVScopeRoot::doPrintMatches(bool Split, raw_ostream &OS,
                                  bool UseMatchedElements) const {}

//===----------------------------------------------------------------------===//
// DWARF template parameter pack (DW_TAG_GNU_template_parameter_pack).
//===----------------------------------------------------------------------===//
bool LVScopeTemplatePack::equals(const LVScope *Scope) const {}

void LVScopeTemplatePack::printExtra(raw_ostream &OS, bool Full) const {}