[llvm] r303162 - Revert r303159 "[DWARF] - Use DWARFAddressRange struct instead of uint64_t pair for DWARFAddressRangesVector."
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Tue May 16 05:05:03 PDT 2017
Author: grimar
Date: Tue May 16 07:05:03 2017
New Revision: 303162
URL: http://llvm.org/viewvc/llvm-project?rev=303162&view=rev
Log:
Revert r303159 "[DWARF] - Use DWARFAddressRange struct instead of uint64_t pair for DWARFAddressRangesVector."
Something went wrong, it broke BB.
http://green.lab.llvm.org/green//job/clang-stage1-cmake-RA-incremental_build/38477/consoleFull#-200034420049ba4694-19c4-4d7e-bec5-911270d8a58c
Modified:
llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h
llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp
llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp
Modified: llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h?rev=303162&r1=303161&r2=303162&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h Tue May 16 07:05:03 2017
@@ -22,13 +22,8 @@ namespace llvm {
class raw_ostream;
-struct DWARFAddressRange {
- uint64_t LowPC;
- uint64_t HighPC;
-};
-
/// DWARFAddressRangesVector - represents a set of absolute address ranges.
-typedef std::vector<DWARFAddressRange> DWARFAddressRangesVector;
+typedef std::vector<std::pair<uint64_t, uint64_t>> DWARFAddressRangesVector;
class DWARFDebugRangeList {
public:
Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp?rev=303162&r1=303161&r2=303162&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp Tue May 16 07:05:03 2017
@@ -54,8 +54,10 @@ void DWARFDebugAranges::generate(DWARFCo
if (ParsedCUOffsets.insert(CUOffset).second) {
DWARFAddressRangesVector CURanges;
CU->collectAddressRanges(CURanges);
- for (const auto &R : CURanges)
- appendRange(CUOffset, R.LowPC, R.HighPC);
+ for (const auto &R : CURanges) {
+ appendRange(CUOffset, R.first, R.second);
+ }
+ }
}
construct();
Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp?rev=303162&r1=303161&r2=303162&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp Tue May 16 07:05:03 2017
@@ -60,8 +60,8 @@ static void dumpRanges(raw_ostream &OS,
OS << '\n';
OS.indent(Indent);
OS << format("[0x%0*" PRIx64 " - 0x%0*" PRIx64 ")",
- AddressSize*2, Range.LowPC,
- AddressSize*2, Range.HighPC);
+ AddressSize*2, Range.first,
+ AddressSize*2, Range.second);
}
}
@@ -229,9 +229,9 @@ DWARFDie::getAddressRanges() const {
return DWARFAddressRangesVector();
// Single range specified by low/high PC.
uint64_t LowPC, HighPC;
- if (getLowAndHighPC(LowPC, HighPC))
- return {{LowPC, HighPC}};
-
+ if (getLowAndHighPC(LowPC, HighPC)) {
+ return DWARFAddressRangesVector(1, std::make_pair(LowPC, HighPC));
+ }
// Multiple ranges from .debug_ranges section.
auto RangesOffset = toSectionOffset(find(DW_AT_ranges));
if (RangesOffset) {
@@ -257,7 +257,7 @@ DWARFDie::collectChildrenAddressRanges(D
bool DWARFDie::addressRangeContainsAddress(const uint64_t Address) const {
for (const auto& R : getAddressRanges()) {
- if (R.LowPC <= Address && Address < R.HighPC)
+ if (R.first <= Address && Address < R.second)
return true;
}
return false;
More information about the llvm-commits
mailing list