LLVM 17.0.0git
XCOFFWriter.h
Go to the documentation of this file.
1//===- XCOFFWriter.h --------------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_LIB_OBJCOPY_XCOFF_XCOFFWRITER_H
10#define LLVM_LIB_OBJCOPY_XCOFF_XCOFFWRITER_H
11
13#include "XCOFFObject.h"
14
15#include <cstdint>
16#include <vector>
17
18namespace llvm {
19namespace objcopy {
20namespace xcoff {
21
23public:
24 virtual ~XCOFFWriter() {}
25 XCOFFWriter(Object &Obj, raw_ostream &Out) : Obj(Obj), Out(Out) {}
26 Error write();
27
28private:
29 Object &Obj;
30 raw_ostream &Out;
31 std::unique_ptr<WritableMemoryBuffer> Buf;
32 size_t FileSize;
33
34 void finalizeHeaders();
35 void finalizeSections();
36 void finalizeSymbolStringTable();
37 void finalize();
38
39 void writeHeaders();
40 void writeSections();
41 void writeSymbolStringTable();
42};
43
44} // end namespace xcoff
45} // end namespace objcopy
46} // end namespace llvm
47
48#endif // LLVM_LIB_OBJCOPY_XCOFF_XCOFFWRITER_H
Lightweight error class with error context and mandatory checking.
Definition: Error.h:156
XCOFFWriter(Object &Obj, raw_ostream &Out)
Definition: XCOFFWriter.h:25
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18