summaryrefslogtreecommitdiffstats
path: root/lld
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2018-02-28 00:20:29 +0000
committerRui Ueyama <ruiu@google.com>2018-02-28 00:20:29 +0000
commit28f3b20db5949328f950a25f96434a57bcfdac19 (patch)
treea57af8a94710b11bb3d08254e835873bf44b1b01 /lld
parent7d696880fbb35e0cfd7bd7cd842dff447b00336d (diff)
downloadbcm5719-llvm-28f3b20db5949328f950a25f96434a57bcfdac19.tar.gz
bcm5719-llvm-28f3b20db5949328f950a25f96434a57bcfdac19.zip
[WebAssembly] Remove trivial accessors.
{set,get}OutputSegment don't hide anything, so remove them. Differential Revision: https://reviews.llvm.org/D43724 llvm-svn: 326276
Diffstat (limited to 'lld')
-rw-r--r--lld/wasm/InputChunks.h9
-rw-r--r--lld/wasm/OutputSegment.h13
-rw-r--r--lld/wasm/Symbols.cpp2
3 files changed, 9 insertions, 15 deletions
diff --git a/lld/wasm/InputChunks.h b/lld/wasm/InputChunks.h
index 9f9a12aba54..1a1eae0c38c 100644
--- a/lld/wasm/InputChunks.h
+++ b/lld/wasm/InputChunks.h
@@ -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
diff --git a/lld/wasm/OutputSegment.h b/lld/wasm/OutputSegment.h
index d3918a5ea1b..79730134290 100644
--- a/lld/wasm/OutputSegment.h
+++ b/lld/wasm/OutputSegment.h
@@ -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; }
diff --git a/lld/wasm/Symbols.cpp b/lld/wasm/Symbols.cpp
index 8f87dcbc9e9..95f9fe81545 100644
--- a/lld/wasm/Symbols.cpp
+++ b/lld/wasm/Symbols.cpp
@@ -173,7 +173,7 @@ uint32_t DefinedData::getOutputSegmentOffset() const {
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,
OpenPOWER on IntegriCloud