| 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 /// \file | 10 /// \file |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 namespace Ice { | 21 namespace Ice { |
| 22 | 22 |
| 23 /// Low level writer that can that can handle ELFCLASS32/64. | 23 /// Low level writer that can that can handle ELFCLASS32/64. |
| 24 /// Little endian only for now. | 24 /// Little endian only for now. |
| 25 class ELFStreamer { | 25 class ELFStreamer { |
| 26 ELFStreamer() = delete; | 26 ELFStreamer() = delete; |
| 27 ELFStreamer(const ELFStreamer &) = delete; | 27 ELFStreamer(const ELFStreamer &) = delete; |
| 28 ELFStreamer &operator=(const ELFStreamer &) = delete; | 28 ELFStreamer &operator=(const ELFStreamer &) = delete; |
| 29 | 29 |
| 30 public: | 30 public: |
| 31 explicit ELFStreamer(Fdstream &Out) : Out(Out) {} | 31 explicit ELFStreamer(Fdstream &MyOut) : Out(MyOut) {} |
| 32 | 32 |
| 33 void write8(uint8_t Value) { Out << char(Value); } | 33 void write8(uint8_t Value) { Out << char(Value); } |
| 34 | 34 |
| 35 void writeLE16(uint16_t Value) { | 35 void writeLE16(uint16_t Value) { |
| 36 write8(uint8_t(Value)); | 36 write8(uint8_t(Value)); |
| 37 write8(uint8_t(Value >> 8)); | 37 write8(uint8_t(Value >> 8)); |
| 38 } | 38 } |
| 39 | 39 |
| 40 void writeLE32(uint32_t Value) { | 40 void writeLE32(uint32_t Value) { |
| 41 writeLE16(uint16_t(Value)); | 41 writeLE16(uint16_t(Value)); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 void seek(uint64_t Off) { Out.seek(Off); } | 81 void seek(uint64_t Off) { Out.seek(Off); } |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 Fdstream &Out; | 84 Fdstream &Out; |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 } // end of namespace Ice | 87 } // end of namespace Ice |
| 88 | 88 |
| 89 #endif // SUBZERO_SRC_ICEELFSTREAMER_H | 89 #endif // SUBZERO_SRC_ICEELFSTREAMER_H |
| OLD | NEW |