llvm.org GIT mirror llvm / e9403c1
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 Eric Christopher 6 years ago
1 changed file(s) with 17 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
1515 #include
1616 using namespace llvm;
1717 using namespace dwarf;
18
19 typedef DWARFDebugLine::LineTable DWARFLineTable;
1820
1921 void DWARFContext::dump(raw_ostream &OS) {
2022 OS << ".debug_abbrev contents:\n";
9395 return Aranges.get();
9496 }
9597
96 const DWARFDebugLine::LineTable *
98 const DWARFLineTable *
9799 DWARFContext::getLineTableForCompileUnit(DWARFCompileUnit *cu) {
98100 if (!Line)
99101 Line.reset(new DWARFDebugLine());
105107 return 0; // No line table for this compile unit.
106108
107109 // See if the line table is cached.
108 if (const DWARFDebugLine::LineTable *lt = Line->getLineTable(stmtOffset))
110 if (const DWARFLineTable *lt = Line->getLineTable(stmtOffset))
109111 return lt;
110112
111113 // We have to parse it first.
162164 return getCompileUnitForOffset(CUOffset);
163165 }
164166
165 static bool getFileNameForCompileUnit(
166 DWARFCompileUnit *CU, const DWARFDebugLine::LineTable *LineTable,
167 uint64_t FileIndex, bool NeedsAbsoluteFilePath, std::string &FileName) {
167 static bool getFileNameForCompileUnit(DWARFCompileUnit *CU,
168 const DWARFLineTable *LineTable,
169 uint64_t FileIndex,
170 bool NeedsAbsoluteFilePath,
171 std::string &FileName) {
168172 if (CU == 0 ||
169173 LineTable == 0 ||
170174 !LineTable->getFileNameByIndex(FileIndex, NeedsAbsoluteFilePath,
182186 return true;
183187 }
184188
185 static bool getFileLineInfoForCompileUnit(
186 DWARFCompileUnit *CU, const DWARFDebugLine::LineTable *LineTable,
187 uint64_t Address, bool NeedsAbsoluteFilePath, std::string &FileName,
188 uint32_t &Line, uint32_t &Column) {
189 static bool getFileLineInfoForCompileUnit(DWARFCompileUnit *CU,
190 const DWARFLineTable *LineTable,
191 uint64_t Address,
192 bool NeedsAbsoluteFilePath,
193 std::string &FileName,
194 uint32_t &Line, uint32_t &Column) {
189195 if (CU == 0 || LineTable == 0)
190196 return false;
191197 // Get the index of row we're looking for in the line table.
224230 }
225231 }
226232 if (Specifier.needs(DILineInfoSpecifier::FileLineInfo)) {
227 const DWARFDebugLine::LineTable *LineTable =
228 getLineTableForCompileUnit(CU);
233 const DWARFLineTable *LineTable = getLineTableForCompileUnit(CU);
229234 const bool NeedsAbsoluteFilePath =
230235 Specifier.needs(DILineInfoSpecifier::AbsoluteFilePath);
231236 getFileLineInfoForCompileUnit(CU, LineTable, Address,
249254
250255 DIInliningInfo InliningInfo;
251256 uint32_t CallFile = 0, CallLine = 0, CallColumn = 0;
252 const DWARFDebugLine::LineTable *LineTable = 0;
257 const DWARFLineTable *LineTable = 0;
253258 for (uint32_t i = 0, n = InlinedChain.size(); i != n; i++) {
254259 const DWARFDebugInfoEntryMinimal &FunctionDIE = InlinedChain[i];
255260 std::string FileName = "";