[DWARF parser] Simplify and re-format a method
authorAlexey Samsonov <samsonov@google.com>
Thu, 24 Apr 2014 22:41:09 +0000 (22:41 +0000)
committerAlexey Samsonov <samsonov@google.com>
Thu, 24 Apr 2014 22:41:09 +0000 (22:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207151 91177308-0d34-0410-b5e6-96231b3b80d8

lib/DebugInfo/DWARFDebugAbbrev.cpp
lib/DebugInfo/DWARFDebugAbbrev.h

index 6ff8eca956ac6304f91830e44db1ad089b785b1f..ee1d34d5fb81ca33af4c4a35f8f0df1d2c09f008 100644 (file)
@@ -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;
 }
index c7c0436866c402c6b180914aaa9067e2cdfbf7dd..a7ab27cbcdefa4d0e61de7701bdbc96fb33fcc70 100644 (file)
@@ -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);
 };