xlC doesn't like Header being both a type and a member variable. Rename the

member variable.

Patch by Kai <kai@redstar.de>

llvm-svn: 177575
This commit is contained in:
Rafael Espindola 2013-03-20 21:03:41 +00:00
parent 69bba1ba51
commit 43e553de45
2 changed files with 20 additions and 20 deletions

View File

@ -16,7 +16,7 @@ using namespace llvm;
void DWARFDebugArangeSet::clear() { void DWARFDebugArangeSet::clear() {
Offset = -1U; Offset = -1U;
std::memset(&Header, 0, sizeof(Header)); std::memset(&HeaderData, 0, sizeof(Header));
ArangeDescriptors.clear(); ArangeDescriptors.clear();
} }
@ -66,15 +66,15 @@ DWARFDebugArangeSet::extract(DataExtractor data, uint32_t *offset_ptr) {
// descriptor on the target system. This header is followed by a series // descriptor on the target system. This header is followed by a series
// of tuples. Each tuple consists of an address and a length, each in // of tuples. Each tuple consists of an address and a length, each in
// the size appropriate for an address on the target architecture. // the size appropriate for an address on the target architecture.
Header.Length = data.getU32(offset_ptr); HeaderData.Length = data.getU32(offset_ptr);
Header.Version = data.getU16(offset_ptr); HeaderData.Version = data.getU16(offset_ptr);
Header.CuOffset = data.getU32(offset_ptr); HeaderData.CuOffset = data.getU32(offset_ptr);
Header.AddrSize = data.getU8(offset_ptr); HeaderData.AddrSize = data.getU8(offset_ptr);
Header.SegSize = data.getU8(offset_ptr); HeaderData.SegSize = data.getU8(offset_ptr);
// Perform basic validation of the header fields. // Perform basic validation of the header fields.
if (!data.isValidOffsetForDataOfSize(Offset, Header.Length) || if (!data.isValidOffsetForDataOfSize(Offset, HeaderData.Length) ||
(Header.AddrSize != 4 && Header.AddrSize != 8)) { (HeaderData.AddrSize != 4 && HeaderData.AddrSize != 8)) {
clear(); clear();
return false; return false;
} }
@ -84,7 +84,7 @@ DWARFDebugArangeSet::extract(DataExtractor data, uint32_t *offset_ptr) {
// size of an address). The header is padded, if necessary, to the // size of an address). The header is padded, if necessary, to the
// appropriate boundary. // appropriate boundary.
const uint32_t header_size = *offset_ptr - Offset; const uint32_t header_size = *offset_ptr - Offset;
const uint32_t tuple_size = Header.AddrSize * 2; const uint32_t tuple_size = HeaderData.AddrSize * 2;
uint32_t first_tuple_offset = 0; uint32_t first_tuple_offset = 0;
while (first_tuple_offset < header_size) while (first_tuple_offset < header_size)
first_tuple_offset += tuple_size; first_tuple_offset += tuple_size;
@ -94,11 +94,11 @@ DWARFDebugArangeSet::extract(DataExtractor data, uint32_t *offset_ptr) {
Descriptor arangeDescriptor; Descriptor arangeDescriptor;
assert(sizeof(arangeDescriptor.Address) == sizeof(arangeDescriptor.Length)); assert(sizeof(arangeDescriptor.Address) == sizeof(arangeDescriptor.Length));
assert(sizeof(arangeDescriptor.Address) >= Header.AddrSize); assert(sizeof(arangeDescriptor.Address) >= HeaderData.AddrSize);
while (data.isValidOffset(*offset_ptr)) { while (data.isValidOffset(*offset_ptr)) {
arangeDescriptor.Address = data.getUnsigned(offset_ptr, Header.AddrSize); arangeDescriptor.Address = data.getUnsigned(offset_ptr, HeaderData.AddrSize);
arangeDescriptor.Length = data.getUnsigned(offset_ptr, Header.AddrSize); arangeDescriptor.Length = data.getUnsigned(offset_ptr, HeaderData.AddrSize);
// Each set of tuples is terminated by a 0 for the address and 0 // Each set of tuples is terminated by a 0 for the address and 0
// for the length. // for the length.
@ -115,11 +115,11 @@ DWARFDebugArangeSet::extract(DataExtractor data, uint32_t *offset_ptr) {
void DWARFDebugArangeSet::dump(raw_ostream &OS) const { void DWARFDebugArangeSet::dump(raw_ostream &OS) const {
OS << format("Address Range Header: length = 0x%8.8x, version = 0x%4.4x, ", OS << format("Address Range Header: length = 0x%8.8x, version = 0x%4.4x, ",
Header.Length, Header.Version) HeaderData.Length, HeaderData.Version)
<< format("cu_offset = 0x%8.8x, addr_size = 0x%2.2x, seg_size = 0x%2.2x\n", << format("cu_offset = 0x%8.8x, addr_size = 0x%2.2x, seg_size = 0x%2.2x\n",
Header.CuOffset, Header.AddrSize, Header.SegSize); HeaderData.CuOffset, HeaderData.AddrSize, HeaderData.SegSize);
const uint32_t hex_width = Header.AddrSize * 2; const uint32_t hex_width = HeaderData.AddrSize * 2;
for (DescriptorConstIter pos = ArangeDescriptors.begin(), for (DescriptorConstIter pos = ArangeDescriptors.begin(),
end = ArangeDescriptors.end(); pos != end; ++pos) end = ArangeDescriptors.end(); pos != end; ++pos)
OS << format("[0x%*.*" PRIx64 " -", hex_width, hex_width, pos->Address) OS << format("[0x%*.*" PRIx64 " -", hex_width, hex_width, pos->Address)
@ -145,7 +145,7 @@ uint32_t DWARFDebugArangeSet::findAddress(uint64_t address) const {
std::find_if(ArangeDescriptors.begin(), end, // Range std::find_if(ArangeDescriptors.begin(), end, // Range
DescriptorContainsAddress(address)); // Predicate DescriptorContainsAddress(address)); // Predicate
if (pos != end) if (pos != end)
return Header.CuOffset; return HeaderData.CuOffset;
return -1U; return -1U;
} }

View File

@ -48,7 +48,7 @@ private:
typedef DescriptorColl::const_iterator DescriptorConstIter; typedef DescriptorColl::const_iterator DescriptorConstIter;
uint32_t Offset; uint32_t Offset;
Header Header; Header HeaderData;
DescriptorColl ArangeDescriptors; DescriptorColl ArangeDescriptors;
public: public:
@ -58,11 +58,11 @@ public:
bool extract(DataExtractor data, uint32_t *offset_ptr); bool extract(DataExtractor data, uint32_t *offset_ptr);
void dump(raw_ostream &OS) const; void dump(raw_ostream &OS) const;
uint32_t getCompileUnitDIEOffset() const { return Header.CuOffset; } uint32_t getCompileUnitDIEOffset() const { return HeaderData.CuOffset; }
uint32_t getOffsetOfNextEntry() const { return Offset + Header.Length + 4; } uint32_t getOffsetOfNextEntry() const { return Offset + HeaderData.Length + 4; }
uint32_t findAddress(uint64_t address) const; uint32_t findAddress(uint64_t address) const;
uint32_t getNumDescriptors() const { return ArangeDescriptors.size(); } uint32_t getNumDescriptors() const { return ArangeDescriptors.size(); }
const struct Header &getHeader() const { return Header; } const struct Header &getHeader() const { return HeaderData; }
const Descriptor *getDescriptor(uint32_t i) const { const Descriptor *getDescriptor(uint32_t i) const {
if (i < ArangeDescriptors.size()) if (i < ArangeDescriptors.size())
return &ArangeDescriptors[i]; return &ArangeDescriptors[i];