summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-07-04 09:42:54 +0000
committerAlexey Samsonov <samsonov@google.com>2012-07-04 09:42:54 +0000
commit5cbbf4ca57ff459c4a3c74485b03741c89f34421 (patch)
tree91d189e698e90d0ddde2d308e83d7ed847c15959
parente06a8887d8ee8831619c558a459f1f17dbe8e4d0 (diff)
downloadbcm5719-llvm-5cbbf4ca57ff459c4a3c74485b03741c89f34421.tar.gz
bcm5719-llvm-5cbbf4ca57ff459c4a3c74485b03741c89f34421.zip
Fix a bug in DebugInfo lib, extend a comment for one of the methods
llvm-svn: 159707
-rw-r--r--llvm/lib/DebugInfo/DWARFCompileUnit.cpp4
-rw-r--r--llvm/lib/DebugInfo/DWARFCompileUnit.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/DebugInfo/DWARFCompileUnit.cpp b/llvm/lib/DebugInfo/DWARFCompileUnit.cpp
index 2683990e589..6d4c7df8dcd 100644
--- a/llvm/lib/DebugInfo/DWARFCompileUnit.cpp
+++ b/llvm/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/llvm/lib/DebugInfo/DWARFCompileUnit.h b/llvm/lib/DebugInfo/DWARFCompileUnit.h
index dc558da7141..e8a97ec716b 100644
--- a/llvm/lib/DebugInfo/DWARFCompileUnit.h
+++ b/llvm/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);
OpenPOWER on IntegriCloud