summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2017-06-06 16:38:59 +0000
committerSam Clegg <sbc@chromium.org>2017-06-06 16:38:59 +0000
commit6dc65e9105aad9a6747d48616958b2589489f32c (patch)
treea32a275064b7c521c49715cb1006376136940664 /llvm/lib
parent0e454a9837c312807e8791dfcd8607cbc18d4359 (diff)
downloadbcm5719-llvm-6dc65e9105aad9a6747d48616958b2589489f32c.tar.gz
bcm5719-llvm-6dc65e9105aad9a6747d48616958b2589489f32c.zip
[WebAssembly] Remove unused methods from MCWasmObjectTargetWriter
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 llvm-svn: 304804
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/MCWasmObjectTargetWriter.cpp10
-rw-r--r--llvm/lib/MC/WasmObjectWriter.cpp21
2 files changed, 23 insertions, 8 deletions
diff --git a/llvm/lib/MC/MCWasmObjectTargetWriter.cpp b/llvm/lib/MC/MCWasmObjectTargetWriter.cpp
index a09a17d7a12..301f30d4f6e 100644
--- a/llvm/lib/MC/MCWasmObjectTargetWriter.cpp
+++ b/llvm/lib/MC/MCWasmObjectTargetWriter.cpp
@@ -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;
diff --git a/llvm/lib/MC/WasmObjectWriter.cpp b/llvm/lib/MC/WasmObjectWriter.cpp
index 9b2031f0504..ee5957a8079 100644
--- a/llvm/lib/MC/WasmObjectWriter.cpp
+++ b/llvm/lib/MC/WasmObjectWriter.cpp
@@ -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 {
OpenPOWER on IntegriCloud