[lld] r326276 - [WebAssembly] Remove trivial accessors.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 27 16:20:30 PST 2018
Author: ruiu
Date: Tue Feb 27 16:20:29 2018
New Revision: 326276
URL: http://llvm.org/viewvc/llvm-project?rev=326276&view=rev
Log:
[WebAssembly] Remove trivial accessors.
{set,get}OutputSegment don't hide anything, so remove them.
Differential Revision: https://reviews.llvm.org/D43724
Modified:
lld/trunk/wasm/InputChunks.h
lld/trunk/wasm/OutputSegment.h
lld/trunk/wasm/Symbols.cpp
Modified: lld/trunk/wasm/InputChunks.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/InputChunks.h?rev=326276&r1=326275&r2=326276&view=diff
==============================================================================
--- lld/trunk/wasm/InputChunks.h (original)
+++ lld/trunk/wasm/InputChunks.h Tue Feb 27 16:20:29 2018
@@ -100,17 +100,11 @@ public:
// segment.
uint32_t translateVA(uint32_t Offset) const;
- const OutputSegment *getOutputSegment() const { return OutputSeg; }
-
- void setOutputSegment(const OutputSegment *Segment, uint32_t Offset) {
- OutputSeg = Segment;
- OutputSegmentOffset = Offset;
- }
-
uint32_t getAlignment() const { return Segment.Data.Alignment; }
StringRef getName() const override { return Segment.Data.Name; }
StringRef getComdat() const override { return Segment.Data.Comdat; }
+ const OutputSegment *OutputSeg = nullptr;
int32_t OutputSegmentOffset = 0;
protected:
@@ -120,7 +114,6 @@ protected:
}
const WasmSegment &Segment;
- const OutputSegment *OutputSeg = nullptr;
};
// Represents a single wasm function within and input file. These are
Modified: lld/trunk/wasm/OutputSegment.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/OutputSegment.h?rev=326276&r1=326275&r2=326276&view=diff
==============================================================================
--- lld/trunk/wasm/OutputSegment.h (original)
+++ lld/trunk/wasm/OutputSegment.h Tue Feb 27 16:20:29 2018
@@ -23,12 +23,13 @@ class OutputSegment {
public:
OutputSegment(StringRef N, uint32_t Index) : Name(N), Index(Index) {}
- void addInputSegment(InputSegment *Segment) {
- Alignment = std::max(Alignment, Segment->getAlignment());
- InputSegments.push_back(Segment);
- Size = llvm::alignTo(Size, Segment->getAlignment());
- Segment->setOutputSegment(this, Size);
- Size += Segment->getSize();
+ void addInputSegment(InputSegment *InSeg) {
+ Alignment = std::max(Alignment, InSeg->getAlignment());
+ InputSegments.push_back(InSeg);
+ Size = llvm::alignTo(Size, InSeg->getAlignment());
+ InSeg->OutputSeg = this;
+ InSeg->OutputSegmentOffset = Size;
+ Size += InSeg->getSize();
}
uint32_t getSectionOffset() const { return SectionOffset; }
Modified: lld/trunk/wasm/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/Symbols.cpp?rev=326276&r1=326275&r2=326276&view=diff
==============================================================================
--- lld/trunk/wasm/Symbols.cpp (original)
+++ lld/trunk/wasm/Symbols.cpp Tue Feb 27 16:20:29 2018
@@ -173,7 +173,7 @@ uint32_t DefinedData::getOutputSegmentOf
uint32_t DefinedData::getOutputSegmentIndex() const {
DEBUG(dbgs() << "getOutputSegmentIndex: " << getName() << "\n");
- return Segment->getOutputSegment()->Index;
+ return Segment->OutputSeg->Index;
}
DefinedGlobal::DefinedGlobal(StringRef Name, uint32_t Flags, InputFile *File,
More information about the llvm-commits
mailing list