diff options
author | Alexey Samsonov <samsonov@google.com> | 2012-07-04 09:42:54 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2012-07-04 09:42:54 +0000 |
commit | a9543aadffcee08d1e49ec9b6904db55671f71f3 (patch) | |
tree | 217cdc9a9ea02bea6d72d5aa98c53edd96f21233 /lib/DebugInfo | |
parent | b163a21940afb639bc8bb57810d48cfc116ea931 (diff) |
Fix a bug in DebugInfo lib, extend a comment for one of the methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159707 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo')
-rw-r--r-- | lib/DebugInfo/DWARFCompileUnit.cpp | 4 | ||||
-rw-r--r-- | lib/DebugInfo/DWARFCompileUnit.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/DebugInfo/DWARFCompileUnit.cpp b/lib/DebugInfo/DWARFCompileUnit.cpp index 2683990e58..6d4c7df8dc 100644 --- a/lib/DebugInfo/DWARFCompileUnit.cpp +++ b/lib/DebugInfo/DWARFCompileUnit.cpp @@ -239,8 +239,8 @@ DWARFCompileUnit::buildAddressRangeTable(DWARFDebugAranges *debug_aranges, const DWARFDebugInfoEntryMinimal* DWARFCompileUnit::getFunctionDIEForAddress(int64_t address) { - size_t n = extractDIEsIfNeeded(false); - for (size_t i = 0; i != n; i++) { + extractDIEsIfNeeded(false); + for (size_t i = 0, n = DieArray.size(); i != n; i++) { if (DieArray[i].addressRangeContainsAddress(this, address)) return &DieArray[i]; } diff --git a/lib/DebugInfo/DWARFCompileUnit.h b/lib/DebugInfo/DWARFCompileUnit.h index dc558da714..e8a97ec716 100644 --- a/lib/DebugInfo/DWARFCompileUnit.h +++ b/lib/DebugInfo/DWARFCompileUnit.h @@ -43,7 +43,7 @@ public: const DWARFAbbreviationDeclarationSet *abbrevs); /// extractDIEsIfNeeded - Parses a compile unit and indexes its DIEs if it - /// hasn't already been done. + /// hasn't already been done. Returns the number of DIEs parsed at this call. size_t extractDIEsIfNeeded(bool cu_die_only); void clear(); void dump(raw_ostream &OS); |