diff options
author | Eric Christopher <echristo@gmail.com> | 2012-10-16 23:46:25 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2012-10-16 23:46:25 +0000 |
commit | e9403c1fd6647eda9f6c9d46a75ab9370b2354b6 (patch) | |
tree | 3baadb24854db023febe2f46a43b7f15c46d4834 | |
parent | b69b55f54a66d4df9549927a3cce307855d6de49 (diff) |
Use a typedef to reduce some typing and reformat code accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166077 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/DebugInfo/DWARFContext.cpp | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/lib/DebugInfo/DWARFContext.cpp b/lib/DebugInfo/DWARFContext.cpp index a578211bee4..afd614cc356 100644 --- a/lib/DebugInfo/DWARFContext.cpp +++ b/lib/DebugInfo/DWARFContext.cpp @@ -17,6 +17,8 @@ using namespace llvm; using namespace dwarf; +typedef DWARFDebugLine::LineTable DWARFLineTable; + void DWARFContext::dump(raw_ostream &OS) { OS << ".debug_abbrev contents:\n"; getDebugAbbrev()->dump(OS); @@ -94,7 +96,7 @@ const DWARFDebugAranges *DWARFContext::getDebugAranges() { return Aranges.get(); } -const DWARFDebugLine::LineTable * +const DWARFLineTable * DWARFContext::getLineTableForCompileUnit(DWARFCompileUnit *cu) { if (!Line) Line.reset(new DWARFDebugLine()); @@ -106,7 +108,7 @@ DWARFContext::getLineTableForCompileUnit(DWARFCompileUnit *cu) { return 0; // No line table for this compile unit. // See if the line table is cached. - if (const DWARFDebugLine::LineTable *lt = Line->getLineTable(stmtOffset)) + if (const DWARFLineTable *lt = Line->getLineTable(stmtOffset)) return lt; // We have to parse it first. @@ -163,9 +165,11 @@ DWARFCompileUnit *DWARFContext::getCompileUnitForAddress(uint64_t Address) { return getCompileUnitForOffset(CUOffset); } -static bool getFileNameForCompileUnit( - DWARFCompileUnit *CU, const DWARFDebugLine::LineTable *LineTable, - uint64_t FileIndex, bool NeedsAbsoluteFilePath, std::string &FileName) { +static bool getFileNameForCompileUnit(DWARFCompileUnit *CU, + const DWARFLineTable *LineTable, + uint64_t FileIndex, + bool NeedsAbsoluteFilePath, + std::string &FileName) { if (CU == 0 || LineTable == 0 || !LineTable->getFileNameByIndex(FileIndex, NeedsAbsoluteFilePath, @@ -183,10 +187,12 @@ static bool getFileNameForCompileUnit( return true; } -static bool getFileLineInfoForCompileUnit( - DWARFCompileUnit *CU, const DWARFDebugLine::LineTable *LineTable, - uint64_t Address, bool NeedsAbsoluteFilePath, std::string &FileName, - uint32_t &Line, uint32_t &Column) { +static bool getFileLineInfoForCompileUnit(DWARFCompileUnit *CU, + const DWARFLineTable *LineTable, + uint64_t Address, + bool NeedsAbsoluteFilePath, + std::string &FileName, + uint32_t &Line, uint32_t &Column) { if (CU == 0 || LineTable == 0) return false; // Get the index of row we're looking for in the line table. @@ -225,8 +231,7 @@ DILineInfo DWARFContext::getLineInfoForAddress(uint64_t Address, } } if (Specifier.needs(DILineInfoSpecifier::FileLineInfo)) { - const DWARFDebugLine::LineTable *LineTable = - getLineTableForCompileUnit(CU); + const DWARFLineTable *LineTable = getLineTableForCompileUnit(CU); const bool NeedsAbsoluteFilePath = Specifier.needs(DILineInfoSpecifier::AbsoluteFilePath); getFileLineInfoForCompileUnit(CU, LineTable, Address, @@ -250,7 +255,7 @@ DIInliningInfo DWARFContext::getInliningInfoForAddress(uint64_t Address, DIInliningInfo InliningInfo; 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++) { const DWARFDebugInfoEntryMinimal &FunctionDIE = InlinedChain[i]; std::string FileName = "<invalid>"; |