diff options
Diffstat (limited to 'lld/wasm/OutputSections.h')
-rw-r--r-- | lld/wasm/OutputSections.h | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/lld/wasm/OutputSections.h b/lld/wasm/OutputSections.h index 3045ed7c56b..6b1c2a2eba2 100644 --- a/lld/wasm/OutputSections.h +++ b/lld/wasm/OutputSections.h @@ -20,7 +20,7 @@ namespace lld { namespace wasm { class OutputSection; } -std::string toString(const wasm::OutputSection &Section); +std::string toString(const wasm::OutputSection §ion); namespace wasm { @@ -28,67 +28,67 @@ class OutputSegment; class OutputSection { public: - OutputSection(uint32_t Type, std::string Name = "") - : Type(Type), Name(Name) {} + OutputSection(uint32_t type, std::string name = "") + : type(type), name(name) {} virtual ~OutputSection() = default; StringRef getSectionName() const; - void setOffset(size_t NewOffset) { - log("setOffset: " + toString(*this) + ": " + Twine(NewOffset)); - Offset = NewOffset; + void setOffset(size_t newOffset) { + log("setOffset: " + toString(*this) + ": " + Twine(newOffset)); + offset = newOffset; } - void createHeader(size_t BodySize); + void createHeader(size_t bodySize); virtual bool isNeeded() const { return true; } virtual size_t getSize() const = 0; - virtual void writeTo(uint8_t *Buf) = 0; + virtual void writeTo(uint8_t *buf) = 0; virtual void finalizeContents() = 0; virtual uint32_t getNumRelocations() const { return 0; } - virtual void writeRelocations(raw_ostream &OS) const {} + virtual void writeRelocations(raw_ostream &os) const {} - std::string Header; - uint32_t Type; - uint32_t SectionIndex = UINT32_MAX; - std::string Name; - OutputSectionSymbol *SectionSym = nullptr; + std::string header; + uint32_t type; + uint32_t sectionIndex = UINT32_MAX; + std::string name; + OutputSectionSymbol *sectionSym = nullptr; protected: - size_t Offset = 0; + size_t offset = 0; }; class CodeSection : public OutputSection { public: - explicit CodeSection(ArrayRef<InputFunction *> Functions) - : OutputSection(llvm::wasm::WASM_SEC_CODE), Functions(Functions) {} + explicit CodeSection(ArrayRef<InputFunction *> functions) + : OutputSection(llvm::wasm::WASM_SEC_CODE), functions(functions) {} - size_t getSize() const override { return Header.size() + BodySize; } - void writeTo(uint8_t *Buf) override; + size_t getSize() const override { return header.size() + bodySize; } + void writeTo(uint8_t *buf) override; uint32_t getNumRelocations() const override; - void writeRelocations(raw_ostream &OS) const override; - bool isNeeded() const override { return Functions.size() > 0; } + void writeRelocations(raw_ostream &os) const override; + bool isNeeded() const override { return functions.size() > 0; } void finalizeContents() override; protected: - ArrayRef<InputFunction *> Functions; - std::string CodeSectionHeader; - size_t BodySize = 0; + ArrayRef<InputFunction *> functions; + std::string codeSectionHeader; + size_t bodySize = 0; }; class DataSection : public OutputSection { public: - explicit DataSection(ArrayRef<OutputSegment *> Segments) - : OutputSection(llvm::wasm::WASM_SEC_DATA), Segments(Segments) {} + explicit DataSection(ArrayRef<OutputSegment *> segments) + : OutputSection(llvm::wasm::WASM_SEC_DATA), segments(segments) {} - size_t getSize() const override { return Header.size() + BodySize; } - void writeTo(uint8_t *Buf) override; + size_t getSize() const override { return header.size() + bodySize; } + void writeTo(uint8_t *buf) override; uint32_t getNumRelocations() const override; - void writeRelocations(raw_ostream &OS) const override; - bool isNeeded() const override { return Segments.size() > 0; } + void writeRelocations(raw_ostream &os) const override; + bool isNeeded() const override { return segments.size() > 0; } void finalizeContents() override; protected: - ArrayRef<OutputSegment *> Segments; - std::string DataSectionHeader; - size_t BodySize = 0; + ArrayRef<OutputSegment *> segments; + std::string dataSectionHeader; + size_t bodySize = 0; }; // Represents a custom section in the output file. Wasm custom sections are @@ -100,21 +100,21 @@ protected: // separately and are instead synthesized by the linker. class CustomSection : public OutputSection { public: - CustomSection(std::string Name, ArrayRef<InputSection *> InputSections) - : OutputSection(llvm::wasm::WASM_SEC_CUSTOM, Name), - InputSections(InputSections) {} + CustomSection(std::string name, ArrayRef<InputSection *> inputSections) + : OutputSection(llvm::wasm::WASM_SEC_CUSTOM, name), + inputSections(inputSections) {} size_t getSize() const override { - return Header.size() + NameData.size() + PayloadSize; + return header.size() + nameData.size() + payloadSize; } - void writeTo(uint8_t *Buf) override; + void writeTo(uint8_t *buf) override; uint32_t getNumRelocations() const override; - void writeRelocations(raw_ostream &OS) const override; + void writeRelocations(raw_ostream &os) const override; void finalizeContents() override; protected: - size_t PayloadSize = 0; - ArrayRef<InputSection *> InputSections; - std::string NameData; + size_t payloadSize = 0; + ArrayRef<InputSection *> inputSections; + std::string nameData; }; } // namespace wasm |