summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2018-01-31 04:21:44 +0000
committerSam Clegg <sbc@chromium.org>2018-01-31 04:21:44 +0000
commit329e76d550a129ff063f68aef07eb9d3f06a9619 (patch)
treefd9c0a982c1922e0246bfb5d112770c55c60cd9f /llvm/lib/MC
parent910f0a06c977a5c0d4bad8d9206adeb9ca378538 (diff)
downloadbcm5719-llvm-329e76d550a129ff063f68aef07eb9d3f06a9619.tar.gz
bcm5719-llvm-329e76d550a129ff063f68aef07eb9d3f06a9619.zip
[WebAssembly] Remove some unused code and tidy logging. NFC.
Patch by Nicholas Wilson! Differential Revision: https://reviews.llvm.org/D42540 llvm-svn: 323846
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r--llvm/lib/MC/WasmObjectWriter.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/llvm/lib/MC/WasmObjectWriter.cpp b/llvm/lib/MC/WasmObjectWriter.cpp
index f5d67d2bec0..4a824b2cae0 100644
--- a/llvm/lib/MC/WasmObjectWriter.cpp
+++ b/llvm/lib/MC/WasmObjectWriter.cpp
@@ -194,15 +194,6 @@ raw_ostream &operator<<(raw_ostream &OS, const WasmRelocationEntry &Rel) {
#endif
class WasmObjectWriter : public MCObjectWriter {
- /// Helper struct for containing some precomputed information on symbols.
- struct WasmSymbolData {
- const MCSymbolWasm *Symbol;
- StringRef Name;
-
- // Support lexicographic sorting.
- bool operator<(const WasmSymbolData &RHS) const { return Name < RHS.Name; }
- };
-
/// The target specific Wasm writer instance.
std::unique_ptr<MCWasmObjectTargetWriter> TargetObjectWriter;
@@ -1122,6 +1113,7 @@ void WasmObjectWriter::writeObject(MCAssembler &Asm,
if (cast<MCSectionWasm>(Sec).getSectionName().startswith(".init_array"))
continue;
+ uint32_t SegmentIndex = DataSegments.size();
DataSize = alignTo(DataSize, Section.getAlignment());
DataSegments.emplace_back();
WasmDataSegment &Segment = DataSegments.back();
@@ -1136,8 +1128,7 @@ void WasmObjectWriter::writeObject(MCAssembler &Asm,
if (const MCSymbolWasm *C = Section.getGroup()) {
Comdats[C->getName()].emplace_back(
- WasmComdatEntry{wasm::WASM_COMDAT_DATA,
- static_cast<uint32_t>(DataSegments.size()) - 1});
+ WasmComdatEntry{wasm::WASM_COMDAT_DATA, SegmentIndex});
}
}
@@ -1150,8 +1141,9 @@ void WasmObjectWriter::writeObject(MCAssembler &Asm,
const auto &WS = static_cast<const MCSymbolWasm &>(S);
DEBUG(dbgs() << "MCSymbol: '" << S << "'"
- << " isDefined=" << S.isDefined() << " isExternal="
- << S.isExternal() << " isTemporary=" << S.isTemporary()
+ << " isDefined=" << S.isDefined()
+ << " isExternal=" << S.isExternal()
+ << " isTemporary=" << S.isTemporary()
<< " isFunction=" << WS.isFunction()
<< " isWeak=" << WS.isWeak()
<< " isHidden=" << WS.isHidden()
@@ -1293,7 +1285,8 @@ void WasmObjectWriter::writeObject(MCAssembler &Asm,
case wasm::R_WEBASSEMBLY_MEMORY_ADDR_SLEB: {
uint32_t Index = SymbolIndices.find(&WS)->second;
IndirectSymbolIndices[&WS] = TableElems.size() + kInitialTableOffset;
- DEBUG(dbgs() << " -> adding to table: " << TableElems.size() << "\n");
+ DEBUG(dbgs() << " -> adding " << WS.getName()
+ << " to table: " << TableElems.size() << "\n");
TableElems.push_back(Index);
registerFunctionType(WS);
break;
OpenPOWER on IntegriCloud