[llvm] r331986 - [DWARF] Remove unused member and fix(?) the unit-tests on big endian hosts

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Thu May 10 07:36:24 PDT 2018


Author: jhenderson
Date: Thu May 10 07:36:24 2018
New Revision: 331986

URL: http://llvm.org/viewvc/llvm-project?rev=331986&view=rev
Log:
[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.

Modified:
    llvm/trunk/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
    llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
    llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.h

Modified: llvm/trunk/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp?rev=331986&r1=331985&r2=331986&view=diff
==============================================================================
--- llvm/trunk/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp (original)
+++ llvm/trunk/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp Thu May 10 07:36:24 2018
@@ -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() {

Modified: llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.cpp?rev=331986&r1=331985&r2=331986&view=diff
==============================================================================
--- llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.cpp (original)
+++ llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.cpp Thu May 10 07:36:24 2018
@@ -497,6 +497,6 @@ dwarfgen::CompileUnit &dwarfgen::Generat
 
 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();
 }

Modified: llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.h?rev=331986&r1=331985&r2=331986&view=diff
==============================================================================
--- llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.h (original)
+++ llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.h Thu May 10 07:36:24 2018
@@ -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;




More information about the llvm-commits mailing list