14#ifndef LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVREADER_H
15#define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVREADER_H
26namespace logicalview {
34 std::unique_ptr<ToolOutputFile> OutputFile;
48 OutputFile->os().close();
67 using LVCompileUnits = std::map<LVOffset, LVScopeCompileUnit *>;
68 LVCompileUnits CompileUnits;
77 Error createSplitFolder();
78 bool OutputSplit =
false;
81#define LV_OBJECT_ALLOCATOR(KIND) \
82 llvm::SpecificBumpPtrAllocator<LV##KIND> Allocated##KIND;
122#undef LV_OBJECT_ALLOCATOR
142 Root = createScopeRoot();
144 if (
options().getAttributeFormat())
163 return std::string(Path);
174 : BinaryType(BinaryType), OutputSplit(
options().getOutputSplit()),
176 OS(
W.getOStream()) {}
188#define LV_CREATE_OBJECT(KIND) \
189 LV##KIND *create##KIND() { \
190 return new (Allocated##KIND.Allocate()) LV##KIND(); \
228#undef LV_CREATE_OBJECT
248 assert(Scope && Scope->isCompileUnit() &&
"Scope is not a compile unit");
284 if (!
options().getCompareContext() &&
options().getCompareLines())
288 if (!
options().getCompareContext() &&
options().getCompareScopes())
292 if (!
options().getCompareContext() &&
options().getCompareSymbols())
293 Symbols.push_back(Symbol);
296 if (!
options().getCompareContext() &&
options().getCompareTypes())
328#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
BlockVerifier::State From
#define LV_CREATE_OBJECT(KIND)
#define LV_OBJECT_ALLOCATOR(KIND)
mir Rename Register Operands
PowerPC Reduce CR logical Operation
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
StringRef - Represent a constant reference to a string, i.e.
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 setName(StringRef ElementName) override
bool printObject(const LVLocation *Location) const
bool printElement(const LVLine *Line) const
The logical reader owns of all the logical elements created during the debug information parsing.
virtual void sortScopes()
StringRef getFileFormatName() const
void addCompileUnitOffset(LVOffset Offset, LVScopeCompileUnit *CompileUnit)
bool doPrintLine(const LVLine *Line) const
void print(raw_ostream &OS) const
const LVTypes & getTypes() const
std::string FileFormatName
void notifyAddedElement(LVType *Type)
void notifyAddedElement(LVLine *Line)
virtual std::string getRegisterName(LVSmall Opcode, ArrayRef< uint64_t > Operands)
const LVSymbols & getSymbols() const
void notifyAddedElement(LVSymbol *Symbol)
raw_ostream & outputStream()
codeview::CPUType getCompileUnitCPUType()
std::string createAlternativePath(StringRef From)
const LVLines & getLines() const
LVReader(const LVReader &)=delete
bool doPrintSymbol(const LVSymbol *Symbol) const
void setFilename(std::string Name)
bool isBinaryTypeCOFF() const
bool isBinaryTypeNone() const
LVSectionIndex getDotTextSectionIndex() const
void setCompileUnitCPUType(codeview::CPUType Type)
LVReader & operator=(const LVReader &)=delete
bool doPrintLocation(const LVLocation *Location) const
virtual bool isSystemEntry(LVElement *Element, StringRef Name={}) const
std::string InputFilename
LVSplitContext & getSplitContext()
bool isBinaryTypeELF() const
virtual ~LVReader()=default
StringRef getFilename() const
static LVReader & getInstance()
const LVScopes & getScopes() const
LVScopeCompileUnit * CompileUnit
static void setInstance(LVReader *Reader)
LVReader(StringRef InputFilename, StringRef FileFormatName, ScopedPrinter &W, LVBinaryType BinaryType=LVBinaryType::NONE)
LVScopeCompileUnit * getCompileUnit() const
LVScopeRoot * getScopesRoot() const
virtual LVSectionIndex getSectionIndex(LVScope *Scope)
LVSectionIndex DotTextSectionIndex
void setCompileUnit(LVScope *Scope)
LVOperation * createOperation(LVSmall OpCode, ArrayRef< LVUnsigned > Operands)
bool doPrintType(const LVType *Type) const
virtual Error printMatchedElements(bool UseMatchedElements)
virtual Error printScopes()
virtual Error createScopes()
bool doPrintScope(const LVScope *Scope) const
void notifyAddedElement(LVScope *Scope)
virtual void printRecords(raw_ostream &OS) const
void setFileFormatName(StringRef FileFormatName)
std::string getLocation() const
LVSplitContext(const LVSplitContext &)=delete
LVSplitContext & operator=(const LVSplitContext &)=delete
Error createSplitFolder(StringRef Where)
std::error_code open(std::string Name, std::string Extension, raw_ostream &OS)
~LVSplitContext()=default
A raw_ostream that writes to a file descriptor.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
CPUType
These values correspond to the CV_CPU_TYPE_e enumeration, and are documented here: https://msdn....
constexpr LVSectionIndex UndefinedSectionIndex
LVScopeCompileUnit * getReaderCompileUnit()
LVSplitContext & getReaderSplitContext()
StringRef filename(StringRef path, Style style=Style::native)
Get filename.
StringRef parent_path(StringRef path, Style style=Style::native)
Get parent path.
std::string convert_to_slash(StringRef path, Style style=Style::native)
Replaces backslashes with slashes if Windows.
void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
This is an optimization pass for GlobalISel generic memory operations.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.