mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
Use a typedef to reduce some typing and reformat code accordingly.
llvm-svn: 166077
This commit is contained in:
parent
e411070efb
commit
98ed8efd11
@ -17,6 +17,8 @@
|
|||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
using namespace dwarf;
|
using namespace dwarf;
|
||||||
|
|
||||||
|
typedef DWARFDebugLine::LineTable DWARFLineTable;
|
||||||
|
|
||||||
void DWARFContext::dump(raw_ostream &OS) {
|
void DWARFContext::dump(raw_ostream &OS) {
|
||||||
OS << ".debug_abbrev contents:\n";
|
OS << ".debug_abbrev contents:\n";
|
||||||
getDebugAbbrev()->dump(OS);
|
getDebugAbbrev()->dump(OS);
|
||||||
@ -94,7 +96,7 @@ const DWARFDebugAranges *DWARFContext::getDebugAranges() {
|
|||||||
return Aranges.get();
|
return Aranges.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
const DWARFDebugLine::LineTable *
|
const DWARFLineTable *
|
||||||
DWARFContext::getLineTableForCompileUnit(DWARFCompileUnit *cu) {
|
DWARFContext::getLineTableForCompileUnit(DWARFCompileUnit *cu) {
|
||||||
if (!Line)
|
if (!Line)
|
||||||
Line.reset(new DWARFDebugLine());
|
Line.reset(new DWARFDebugLine());
|
||||||
@ -106,7 +108,7 @@ DWARFContext::getLineTableForCompileUnit(DWARFCompileUnit *cu) {
|
|||||||
return 0; // No line table for this compile unit.
|
return 0; // No line table for this compile unit.
|
||||||
|
|
||||||
// See if the line table is cached.
|
// See if the line table is cached.
|
||||||
if (const DWARFDebugLine::LineTable *lt = Line->getLineTable(stmtOffset))
|
if (const DWARFLineTable *lt = Line->getLineTable(stmtOffset))
|
||||||
return lt;
|
return lt;
|
||||||
|
|
||||||
// We have to parse it first.
|
// We have to parse it first.
|
||||||
@ -163,9 +165,11 @@ DWARFCompileUnit *DWARFContext::getCompileUnitForAddress(uint64_t Address) {
|
|||||||
return getCompileUnitForOffset(CUOffset);
|
return getCompileUnitForOffset(CUOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool getFileNameForCompileUnit(
|
static bool getFileNameForCompileUnit(DWARFCompileUnit *CU,
|
||||||
DWARFCompileUnit *CU, const DWARFDebugLine::LineTable *LineTable,
|
const DWARFLineTable *LineTable,
|
||||||
uint64_t FileIndex, bool NeedsAbsoluteFilePath, std::string &FileName) {
|
uint64_t FileIndex,
|
||||||
|
bool NeedsAbsoluteFilePath,
|
||||||
|
std::string &FileName) {
|
||||||
if (CU == 0 ||
|
if (CU == 0 ||
|
||||||
LineTable == 0 ||
|
LineTable == 0 ||
|
||||||
!LineTable->getFileNameByIndex(FileIndex, NeedsAbsoluteFilePath,
|
!LineTable->getFileNameByIndex(FileIndex, NeedsAbsoluteFilePath,
|
||||||
@ -183,9 +187,11 @@ static bool getFileNameForCompileUnit(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool getFileLineInfoForCompileUnit(
|
static bool getFileLineInfoForCompileUnit(DWARFCompileUnit *CU,
|
||||||
DWARFCompileUnit *CU, const DWARFDebugLine::LineTable *LineTable,
|
const DWARFLineTable *LineTable,
|
||||||
uint64_t Address, bool NeedsAbsoluteFilePath, std::string &FileName,
|
uint64_t Address,
|
||||||
|
bool NeedsAbsoluteFilePath,
|
||||||
|
std::string &FileName,
|
||||||
uint32_t &Line, uint32_t &Column) {
|
uint32_t &Line, uint32_t &Column) {
|
||||||
if (CU == 0 || LineTable == 0)
|
if (CU == 0 || LineTable == 0)
|
||||||
return false;
|
return false;
|
||||||
@ -225,8 +231,7 @@ DILineInfo DWARFContext::getLineInfoForAddress(uint64_t Address,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Specifier.needs(DILineInfoSpecifier::FileLineInfo)) {
|
if (Specifier.needs(DILineInfoSpecifier::FileLineInfo)) {
|
||||||
const DWARFDebugLine::LineTable *LineTable =
|
const DWARFLineTable *LineTable = getLineTableForCompileUnit(CU);
|
||||||
getLineTableForCompileUnit(CU);
|
|
||||||
const bool NeedsAbsoluteFilePath =
|
const bool NeedsAbsoluteFilePath =
|
||||||
Specifier.needs(DILineInfoSpecifier::AbsoluteFilePath);
|
Specifier.needs(DILineInfoSpecifier::AbsoluteFilePath);
|
||||||
getFileLineInfoForCompileUnit(CU, LineTable, Address,
|
getFileLineInfoForCompileUnit(CU, LineTable, Address,
|
||||||
@ -250,7 +255,7 @@ DIInliningInfo DWARFContext::getInliningInfoForAddress(uint64_t Address,
|
|||||||
|
|
||||||
DIInliningInfo InliningInfo;
|
DIInliningInfo InliningInfo;
|
||||||
uint32_t CallFile = 0, CallLine = 0, CallColumn = 0;
|
uint32_t CallFile = 0, CallLine = 0, CallColumn = 0;
|
||||||
const DWARFDebugLine::LineTable *LineTable = 0;
|
const DWARFLineTable *LineTable = 0;
|
||||||
for (uint32_t i = 0, n = InlinedChain.size(); i != n; i++) {
|
for (uint32_t i = 0, n = InlinedChain.size(); i != n; i++) {
|
||||||
const DWARFDebugInfoEntryMinimal &FunctionDIE = InlinedChain[i];
|
const DWARFDebugInfoEntryMinimal &FunctionDIE = InlinedChain[i];
|
||||||
std::string FileName = "<invalid>";
|
std::string FileName = "<invalid>";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user