diff options
author | Alexey Samsonov <samsonov@google.com> | 2014-04-24 22:41:09 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2014-04-24 22:41:09 +0000 |
commit | f93114e7ed44ea52754f03d52663ce5c335b40eb (patch) | |
tree | 039cc0ede2cd0a92f7548c5d942245db75fd8466 /lib/DebugInfo | |
parent | 2a25daa0a94a677c1143876953fa501c78a332d4 (diff) | |
download | llvm-f93114e7ed44ea52754f03d52663ce5c335b40eb.tar.gz llvm-f93114e7ed44ea52754f03d52663ce5c335b40eb.tar.bz2 llvm-f93114e7ed44ea52754f03d52663ce5c335b40eb.tar.xz |
[DWARF parser] Simplify and re-format a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207151 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo')
-rw-r--r-- | lib/DebugInfo/DWARFDebugAbbrev.cpp | 20 | ||||
-rw-r--r-- | lib/DebugInfo/DWARFDebugAbbrev.h | 4 |
2 files changed, 13 insertions, 11 deletions
diff --git a/lib/DebugInfo/DWARFDebugAbbrev.cpp b/lib/DebugInfo/DWARFDebugAbbrev.cpp index 6ff8eca956..ee1d34d5fb 100644 --- a/lib/DebugInfo/DWARFDebugAbbrev.cpp +++ b/lib/DebugInfo/DWARFDebugAbbrev.cpp @@ -86,18 +86,18 @@ void DWARFDebugAbbrev::dump(raw_ostream &OS) const { } const DWARFAbbreviationDeclarationSet* -DWARFDebugAbbrev::getAbbreviationDeclarationSet(uint64_t cu_abbr_offset) const { - DWARFAbbreviationDeclarationCollMapConstIter end = AbbrevCollMap.end(); - DWARFAbbreviationDeclarationCollMapConstIter pos; - if (PrevAbbrOffsetPos != end && - PrevAbbrOffsetPos->first == cu_abbr_offset) { +DWARFDebugAbbrev::getAbbreviationDeclarationSet(uint64_t CUAbbrOffset) const { + DWARFAbbreviationDeclarationCollMapConstIter End = AbbrevCollMap.end(); + if (PrevAbbrOffsetPos != End && PrevAbbrOffsetPos->first == CUAbbrOffset) { return &(PrevAbbrOffsetPos->second); - } else { - pos = AbbrevCollMap.find(cu_abbr_offset); - PrevAbbrOffsetPos = pos; } - if (pos != AbbrevCollMap.end()) - return &(pos->second); + DWARFAbbreviationDeclarationCollMapConstIter Pos = + AbbrevCollMap.find(CUAbbrOffset); + if (Pos != End) { + PrevAbbrOffsetPos = Pos; + return &(Pos->second); + } + return nullptr; } diff --git a/lib/DebugInfo/DWARFDebugAbbrev.h b/lib/DebugInfo/DWARFDebugAbbrev.h index c7c0436866..a7ab27cbcd 100644 --- a/lib/DebugInfo/DWARFDebugAbbrev.h +++ b/lib/DebugInfo/DWARFDebugAbbrev.h @@ -62,8 +62,10 @@ private: public: DWARFDebugAbbrev(); + const DWARFAbbreviationDeclarationSet * - getAbbreviationDeclarationSet(uint64_t cu_abbr_offset) const; + getAbbreviationDeclarationSet(uint64_t CUAbbrOffset) const; + void dump(raw_ostream &OS) const; void parse(DataExtractor data); }; |