OLD | NEW |
1 //===- subzero/src/IceELFStreamer.h - Low level ELF writing -----*- C++ -*-===// | 1 //===- subzero/src/IceELFStreamer.h - Low level ELF writing -----*- C++ -*-===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // Interface for serializing bits for common ELF types (words, extended words, | 10 // Interface for serializing bits for common ELF types (words, extended words, |
11 // etc.), based on the ELF Class. | 11 // etc.), based on the ELF Class. |
12 // | 12 // |
13 //===----------------------------------------------------------------------===// | 13 //===----------------------------------------------------------------------===// |
14 | 14 |
15 #ifndef SUBZERO_SRC_ICEELFSTREAMER_H | 15 #ifndef SUBZERO_SRC_ICEELFSTREAMER_H |
16 #define SUBZERO_SRC_ICEELFSTREAMER_H | 16 #define SUBZERO_SRC_ICEELFSTREAMER_H |
17 | 17 |
18 #include "IceDefs.h" | 18 #include "IceDefs.h" |
19 | 19 |
20 namespace Ice { | 20 namespace Ice { |
21 | 21 |
22 // Low level writer that can that can handle ELFCLASS32/64. | 22 // Low level writer that can that can handle ELFCLASS32/64. |
23 // Little endian only for now. | 23 // Little endian only for now. |
24 class ELFStreamer { | 24 class ELFStreamer { |
| 25 ELFStreamer() = delete; |
| 26 ELFStreamer(const ELFStreamer &) = delete; |
| 27 ELFStreamer &operator=(const ELFStreamer &) = delete; |
| 28 |
25 public: | 29 public: |
26 explicit ELFStreamer(Fdstream &Out) : Out(Out) {} | 30 explicit ELFStreamer(Fdstream &Out) : Out(Out) {} |
27 | 31 |
28 void write8(uint8_t Value) { Out << char(Value); } | 32 void write8(uint8_t Value) { Out << char(Value); } |
29 | 33 |
30 void writeLE16(uint16_t Value) { | 34 void writeLE16(uint16_t Value) { |
31 write8(uint8_t(Value)); | 35 write8(uint8_t(Value)); |
32 write8(uint8_t(Value >> 8)); | 36 write8(uint8_t(Value >> 8)); |
33 } | 37 } |
34 | 38 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 79 |
76 void seek(uint64_t Off) { Out.seek(Off); } | 80 void seek(uint64_t Off) { Out.seek(Off); } |
77 | 81 |
78 private: | 82 private: |
79 Fdstream &Out; | 83 Fdstream &Out; |
80 }; | 84 }; |
81 | 85 |
82 } // end of namespace Ice | 86 } // end of namespace Ice |
83 | 87 |
84 #endif // SUBZERO_SRC_ICEELFSTREAMER_H | 88 #endif // SUBZERO_SRC_ICEELFSTREAMER_H |
OLD | NEW |