1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

[DWARF parser] Simplify and re-format a method

llvm-svn: 207151
This commit is contained in:
Alexey Samsonov 2014-04-24 22:41:09 +00:00
parent 59e03f926f
commit b46122a967
2 changed files with 13 additions and 11 deletions

View File

@ -86,18 +86,18 @@ void DWARFDebugAbbrev::dump(raw_ostream &OS) const {
} }
const DWARFAbbreviationDeclarationSet* const DWARFAbbreviationDeclarationSet*
DWARFDebugAbbrev::getAbbreviationDeclarationSet(uint64_t cu_abbr_offset) const { DWARFDebugAbbrev::getAbbreviationDeclarationSet(uint64_t CUAbbrOffset) const {
DWARFAbbreviationDeclarationCollMapConstIter end = AbbrevCollMap.end(); DWARFAbbreviationDeclarationCollMapConstIter End = AbbrevCollMap.end();
DWARFAbbreviationDeclarationCollMapConstIter pos; if (PrevAbbrOffsetPos != End && PrevAbbrOffsetPos->first == CUAbbrOffset) {
if (PrevAbbrOffsetPos != end &&
PrevAbbrOffsetPos->first == cu_abbr_offset) {
return &(PrevAbbrOffsetPos->second); return &(PrevAbbrOffsetPos->second);
} else {
pos = AbbrevCollMap.find(cu_abbr_offset);
PrevAbbrOffsetPos = pos;
} }
if (pos != AbbrevCollMap.end()) DWARFAbbreviationDeclarationCollMapConstIter Pos =
return &(pos->second); AbbrevCollMap.find(CUAbbrOffset);
if (Pos != End) {
PrevAbbrOffsetPos = Pos;
return &(Pos->second);
}
return nullptr; return nullptr;
} }

View File

@ -62,8 +62,10 @@ private:
public: public:
DWARFDebugAbbrev(); DWARFDebugAbbrev();
const DWARFAbbreviationDeclarationSet * const DWARFAbbreviationDeclarationSet *
getAbbreviationDeclarationSet(uint64_t cu_abbr_offset) const; getAbbreviationDeclarationSet(uint64_t CUAbbrOffset) const;
void dump(raw_ostream &OS) const; void dump(raw_ostream &OS) const;
void parse(DataExtractor data); void parse(DataExtractor data);
}; };