Replace a std::pair with a struct.

This is more readable and should reduce the noise in a followup patch.

llvm-svn: 328164
This commit is contained in:
Rafael Espindola 2018-03-21 22:32:17 +00:00
parent 556f8f6adc
commit c08e5afb7c
2 changed files with 7 additions and 3 deletions

View File

@ -183,11 +183,11 @@ ObjFile<ELFT>::getVariableLoc(StringRef Name) {
// Take file name string from line table. // Take file name string from line table.
std::string FileName; std::string FileName;
if (!LT->getFileNameByIndex( if (!LT->getFileNameByIndex(
It->second.first /* File */, nullptr, It->second.File, nullptr,
DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, FileName)) DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, FileName))
return None; return None;
return std::make_pair(FileName, It->second.second /*Line*/); return std::make_pair(FileName, It->second.Line);
} }
// Returns source line information for a given offset // Returns source line information for a given offset

View File

@ -216,7 +216,11 @@ private:
// single object file, so we cache debugging information in order to // single object file, so we cache debugging information in order to
// parse it only once for each object file we link. // parse it only once for each object file we link.
std::unique_ptr<llvm::DWARFDebugLine> DwarfLine; std::unique_ptr<llvm::DWARFDebugLine> DwarfLine;
llvm::DenseMap<StringRef, std::pair<unsigned, unsigned>> VariableLoc; struct VarLoc {
unsigned File;
unsigned Line;
};
llvm::DenseMap<StringRef, VarLoc> VariableLoc;
llvm::once_flag InitDwarfLine; llvm::once_flag InitDwarfLine;
}; };