| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // | 4 // |
| 5 // Modified by the Subzero authors. | 5 // Modified by the Subzero authors. |
| 6 // | 6 // |
| 7 //===- subzero/src/assembler.h - Integrated assembler -----------*- C++ -*-===// | 7 //===- subzero/src/assembler.h - Integrated assembler -----------*- C++ -*-===// |
| 8 // | 8 // |
| 9 // The Subzero Code Generator | 9 // The Subzero Code Generator |
| 10 // | 10 // |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 AssemblerFixup(FixupKind Kind, const ConstantRelocatable *Value) | 57 AssemblerFixup(FixupKind Kind, const ConstantRelocatable *Value) |
| 58 : position_(0), kind_(Kind), value_(Value) {} | 58 : position_(0), kind_(Kind), value_(Value) {} |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 intptr_t position_; | 61 intptr_t position_; |
| 62 FixupKind kind_; | 62 FixupKind kind_; |
| 63 const ConstantRelocatable *value_; | 63 const ConstantRelocatable *value_; |
| 64 | 64 |
| 65 void set_position(intptr_t position) { position_ = position; } | 65 void set_position(intptr_t position) { position_ = position; } |
| 66 | 66 |
| 67 AssemblerFixup(const AssemblerFixup &) LLVM_DELETED_FUNCTION; | 67 AssemblerFixup(const AssemblerFixup &) = delete; |
| 68 AssemblerFixup &operator=(const AssemblerFixup &) LLVM_DELETED_FUNCTION; | 68 AssemblerFixup &operator=(const AssemblerFixup &) = delete; |
| 69 friend class AssemblerBuffer; | 69 friend class AssemblerBuffer; |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 // Assembler buffers are used to emit binary code. They grow on demand. | 72 // Assembler buffers are used to emit binary code. They grow on demand. |
| 73 class AssemblerBuffer { | 73 class AssemblerBuffer { |
| 74 public: | 74 public: |
| 75 AssemblerBuffer(Assembler &); | 75 AssemblerBuffer(Assembler &); |
| 76 ~AssemblerBuffer(); | 76 ~AssemblerBuffer(); |
| 77 | 77 |
| 78 // Basic support for emitting, loading, and storing. | 78 // Basic support for emitting, loading, and storing. |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 const size_t Alignment = 16; | 206 const size_t Alignment = 16; |
| 207 return reinterpret_cast<uintptr_t>(Allocator.Allocate(bytes, Alignment)); | 207 return reinterpret_cast<uintptr_t>(Allocator.Allocate(bytes, Alignment)); |
| 208 } | 208 } |
| 209 | 209 |
| 210 // Allocate data of type T using the per-Assembler allocator. | 210 // Allocate data of type T using the per-Assembler allocator. |
| 211 template <typename T> T *Allocate() { return Allocator.Allocate<T>(); } | 211 template <typename T> T *Allocate() { return Allocator.Allocate<T>(); } |
| 212 | 212 |
| 213 private: | 213 private: |
| 214 llvm::BumpPtrAllocator Allocator; | 214 llvm::BumpPtrAllocator Allocator; |
| 215 | 215 |
| 216 Assembler(const Assembler &) LLVM_DELETED_FUNCTION; | 216 Assembler(const Assembler &) = delete; |
| 217 Assembler &operator=(const Assembler &) LLVM_DELETED_FUNCTION; | 217 Assembler &operator=(const Assembler &) = delete; |
| 218 }; | 218 }; |
| 219 | 219 |
| 220 } // end of namespace Ice | 220 } // end of namespace Ice |
| 221 | 221 |
| 222 #endif // SUBZERO_SRC_ASSEMBLER_H_ | 222 #endif // SUBZERO_SRC_ASSEMBLER_H_ |
| OLD | NEW |