]> granicus.if.org Git - llvm/commitdiff
[WebAssembly] Remove unused methods from MCWasmObjectTargetWriter
authorSam Clegg <sbc@chromium.org>
Tue, 6 Jun 2017 16:38:59 +0000 (16:38 +0000)
committerSam Clegg <sbc@chromium.org>
Tue, 6 Jun 2017 16:38:59 +0000 (16:38 +0000)
These methods looks like they were originally came from
MCELFObjectTargetWriter but they are never called by the
WasmObjectWriter.

Remove these methods meant the declaration of WasmRelocationEntry
could also move into the cpp file.

Differential Revision: https://reviews.llvm.org/D33905

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

include/llvm/MC/MCWasmObjectWriter.h
lib/MC/MCWasmObjectTargetWriter.cpp
lib/MC/WasmObjectWriter.cpp

index a4dd382706d78f9dad0de2a27060df947297c4e5..25d8c1486d8de6a54aa2cc52dbcb2f1e1e40e648 100644 (file)
@@ -28,27 +28,6 @@ class MCSymbolWasm;
 class MCValue;
 class raw_pwrite_stream;
 
-// Information about a single relocation.
-struct WasmRelocationEntry {
-  uint64_t Offset;            // Where is the relocation.
-  const MCSymbolWasm *Symbol; // The symbol to relocate with.
-  int64_t Addend;             // A value to add to the symbol.
-  unsigned Type;              // The type of the relocation.
-  MCSectionWasm *FixupSection;// The section the relocation is targeting.
-
-  WasmRelocationEntry(uint64_t Offset, const MCSymbolWasm *Symbol,
-                      int64_t Addend, unsigned Type,
-                      MCSectionWasm *FixupSection)
-      : Offset(Offset), Symbol(Symbol), Addend(Addend), Type(Type),
-        FixupSection(FixupSection) {}
-
-  void print(raw_ostream &Out) const {
-    Out << "Off=" << Offset << ", Sym=" << Symbol << ", Addend=" << Addend
-        << ", Type=" << Type << ", FixupSection=" << FixupSection;
-  }
-  void dump() const { print(errs()); }
-};
-
 class MCWasmObjectTargetWriter {
   const unsigned Is64Bit : 1;
 
@@ -56,17 +35,11 @@ protected:
   explicit MCWasmObjectTargetWriter(bool Is64Bit_);
 
 public:
-  virtual ~MCWasmObjectTargetWriter() {}
+  virtual ~MCWasmObjectTargetWriter();
 
   virtual unsigned getRelocType(MCContext &Ctx, const MCValue &Target,
                                 const MCFixup &Fixup, bool IsPCRel) const = 0;
 
-  virtual bool needsRelocateWithSymbol(const MCSymbol &Sym,
-                                       unsigned Type) const;
-
-  virtual void sortRelocs(const MCAssembler &Asm,
-                          std::vector<WasmRelocationEntry> &Relocs);
-
   /// \name Accessors
   /// @{
   bool is64Bit() const { return Is64Bit; }
index a09a17d7a124f60d7cf48250006227533ac81acc..301f30d4f6ecf97d646cb6b1fe36acb3934be96b 100644 (file)
@@ -17,11 +17,5 @@ using namespace llvm;
 MCWasmObjectTargetWriter::MCWasmObjectTargetWriter(bool Is64Bit_)
     : Is64Bit(Is64Bit_) {}
 
-bool MCWasmObjectTargetWriter::needsRelocateWithSymbol(const MCSymbol &Sym,
-                                                       unsigned Type) const {
-  return false;
-}
-
-void MCWasmObjectTargetWriter::sortRelocs(
-    const MCAssembler &Asm, std::vector<WasmRelocationEntry> &Relocs) {
-}
+// Pin the vtable to this object file
+MCWasmObjectTargetWriter::~MCWasmObjectTargetWriter() = default;
index 9b2031f05043bb677ba2602acb23de37cebbd2cc..ee5957a8079e44f8ba29ec7ca564ed418d6a51a4 100644 (file)
@@ -127,6 +127,27 @@ struct WasmGlobal {
   uint32_t ImportIndex;
 };
 
+// Information about a single relocation.
+struct WasmRelocationEntry {
+  uint64_t Offset;            // Where is the relocation.
+  const MCSymbolWasm *Symbol; // The symbol to relocate with.
+  int64_t Addend;             // A value to add to the symbol.
+  unsigned Type;              // The type of the relocation.
+  MCSectionWasm *FixupSection;// The section the relocation is targeting.
+
+  WasmRelocationEntry(uint64_t Offset, const MCSymbolWasm *Symbol,
+                      int64_t Addend, unsigned Type,
+                      MCSectionWasm *FixupSection)
+      : Offset(Offset), Symbol(Symbol), Addend(Addend), Type(Type),
+        FixupSection(FixupSection) {}
+
+  void print(raw_ostream &Out) const {
+    Out << "Off=" << Offset << ", Sym=" << Symbol << ", Addend=" << Addend
+        << ", Type=" << Type << ", FixupSection=" << FixupSection;
+  }
+  void dump() const { print(errs()); }
+};
+
 class WasmObjectWriter : public MCObjectWriter {
   /// Helper struct for containing some precomputed information on symbols.
   struct WasmSymbolData {