From 198a87c8f3078f87f2893d82221c35abf5b94c01 Mon Sep 17 00:00:00 2001 From: James Henderson Date: Thu, 10 May 2018 14:36:24 +0000 Subject: [PATCH] [DWARF] Remove unused member and fix(?) the unit-tests on big endian hosts I can't verified the fix on a big endian host, so I'm not 100% certain it will work. llvm-svn: 331986 --- llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp | 3 ++- llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp | 2 +- llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h | 8 +++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp index 22a3fd8..7a0db57 100644 --- a/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp +++ b/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp @@ -48,7 +48,8 @@ struct CommonFixture { Context = createContext(); assert(Context != nullptr && "test state is not valid"); const DWARFObject &Obj = Context->getDWARFObj(); - LineData = DWARFDataExtractor(Obj, Obj.getLineSection(), true, 8); + LineData = DWARFDataExtractor(Obj, Obj.getLineSection(), + sys::IsLittleEndianHost, 8); } std::unique_ptr createContext() { diff --git a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp index 52d92f4..4eb98c2 100644 --- a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp +++ b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp @@ -497,6 +497,6 @@ dwarfgen::CompileUnit &dwarfgen::Generator::addCompileUnit() { dwarfgen::LineTable &dwarfgen::Generator::addLineTable(DwarfFormat Format) { LineTables.push_back( - make_unique(*this, Version, Format, Asm->getPointerSize())); + make_unique(Version, Format, Asm->getPointerSize())); return *LineTables.back(); } diff --git a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h index 01f40e3..9912b89 100644 --- a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h +++ b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h @@ -165,10 +165,9 @@ public: ValueLength Length; }; - LineTable(Generator &DG, uint16_t Version, dwarf::DwarfFormat Format, - uint8_t AddrSize, uint8_t SegSize = 0) - : DG(DG), Version(Version), Format(Format), AddrSize(AddrSize), - SegSize(SegSize) { + LineTable(uint16_t Version, dwarf::DwarfFormat Format, uint8_t AddrSize, + uint8_t SegSize = 0) + : Version(Version), Format(Format), AddrSize(AddrSize), SegSize(SegSize) { assert(Version >= 2 && Version <= 5 && "unsupported version"); } @@ -205,7 +204,6 @@ private: void writeProloguePayload(const DWARFDebugLine::Prologue &Prologue, AsmPrinter &Asm) const; - LLVM_ATTRIBUTE_UNUSED Generator &DG; llvm::Optional Prologue; std::vector CustomPrologue; std::vector Contents; -- 2.7.4