summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2014-04-24 22:41:09 +0000
committerAlexey Samsonov <samsonov@google.com>2014-04-24 22:41:09 +0000
commit9a5c95ad3adb9cf6dd1957dc36b0d9bf4d73fe55 (patch)
treec43c53bcc9f018e720da13190e197cbb2d572124 /llvm/lib/DebugInfo
parentb0d5e4d6edc8ba67aa9a5b3ceb8f2ef1b20bad3c (diff)
downloadbcm5719-llvm-9a5c95ad3adb9cf6dd1957dc36b0d9bf4d73fe55.tar.gz
bcm5719-llvm-9a5c95ad3adb9cf6dd1957dc36b0d9bf4d73fe55.zip
[DWARF parser] Simplify and re-format a method
llvm-svn: 207151
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r--llvm/lib/DebugInfo/DWARFDebugAbbrev.cpp20
-rw-r--r--llvm/lib/DebugInfo/DWARFDebugAbbrev.h4
2 files changed, 13 insertions, 11 deletions
diff --git a/llvm/lib/DebugInfo/DWARFDebugAbbrev.cpp b/llvm/lib/DebugInfo/DWARFDebugAbbrev.cpp
index 6ff8eca956a..ee1d34d5fb8 100644
--- a/llvm/lib/DebugInfo/DWARFDebugAbbrev.cpp
+++ b/llvm/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/llvm/lib/DebugInfo/DWARFDebugAbbrev.h b/llvm/lib/DebugInfo/DWARFDebugAbbrev.h
index c7c0436866c..a7ab27cbcde 100644
--- a/llvm/lib/DebugInfo/DWARFDebugAbbrev.h
+++ b/llvm/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);
};
OpenPOWER on IntegriCloud