OSDN Git Service

[DWARF] Remove unused member and fix(?) the unit-tests on big endian hosts
authorJames Henderson <jh7370@my.bristol.ac.uk>
Thu, 10 May 2018 14:36:24 +0000 (14:36 +0000)
committerJames Henderson <jh7370@my.bristol.ac.uk>
Thu, 10 May 2018 14:36:24 +0000 (14:36 +0000)
I can't verified the fix on a big endian host, so I'm not 100% certain it
will work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331986 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
unittests/DebugInfo/DWARF/DwarfGenerator.cpp
unittests/DebugInfo/DWARF/DwarfGenerator.h

index 22a3fd8..7a0db57 100644 (file)
@@ -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<DWARFContext> createContext() {
index 52d92f4..4eb98c2 100644 (file)
@@ -497,6 +497,6 @@ dwarfgen::CompileUnit &dwarfgen::Generator::addCompileUnit() {
 
 dwarfgen::LineTable &dwarfgen::Generator::addLineTable(DwarfFormat Format) {
   LineTables.push_back(
-      make_unique<LineTable>(*this, Version, Format, Asm->getPointerSize()));
+      make_unique<LineTable>(Version, Format, Asm->getPointerSize()));
   return *LineTables.back();
 }
index 01f40e3..9912b89 100644 (file)
@@ -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<DWARFDebugLine::Prologue> Prologue;
   std::vector<ValueAndLength> CustomPrologue;
   std::vector<ValueAndLength> Contents;