| OLD | NEW |
| 1 //===- subzero/src/IceAssembler.h - Integrated assembler --------*- C++ -*-===// | 1 //===- subzero/src/IceAssembler.h - Integrated assembler --------*- C++ -*-===// |
| 2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
| 4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
| 5 // | 5 // |
| 6 // Modified by the Subzero authors. | 6 // Modified by the Subzero authors. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // The Subzero Code Generator | 10 // The Subzero Code Generator |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 virtual bool fixupIsPCRel(FixupKind Kind) const = 0; | 286 virtual bool fixupIsPCRel(FixupKind Kind) const = 0; |
| 287 | 287 |
| 288 /// Return a view of all the bytes of code for the current function. | 288 /// Return a view of all the bytes of code for the current function. |
| 289 llvm::StringRef getBufferView() const; | 289 llvm::StringRef getBufferView() const; |
| 290 | 290 |
| 291 /// Return the value of the given type in the corresponding buffer. | 291 /// Return the value of the given type in the corresponding buffer. |
| 292 template <typename T> T load(intptr_t Position) const { | 292 template <typename T> T load(intptr_t Position) const { |
| 293 return Buffer.load<T>(Position); | 293 return Buffer.load<T>(Position); |
| 294 } | 294 } |
| 295 | 295 |
| 296 template <typename T> void store(intptr_t Position, T Value) { |
| 297 Buffer.store(Position, Value); |
| 298 } |
| 299 |
| 296 /// Emit a fixup at the current location. | 300 /// Emit a fixup at the current location. |
| 297 void emitFixup(AssemblerFixup *Fixup) { Buffer.emitFixup(Fixup); } | 301 void emitFixup(AssemblerFixup *Fixup) { Buffer.emitFixup(Fixup); } |
| 298 | 302 |
| 299 const FixupRefList &fixups() const { return Buffer.fixups(); } | 303 const FixupRefList &fixups() const { return Buffer.fixups(); } |
| 300 | 304 |
| 301 AssemblerFixup *createFixup(FixupKind Kind, const Constant *Value) { | 305 AssemblerFixup *createFixup(FixupKind Kind, const Constant *Value) { |
| 302 return Buffer.createFixup(Kind, Value); | 306 return Buffer.createFixup(Kind, Value); |
| 303 } | 307 } |
| 304 | 308 |
| 305 AssemblerTextFixup *createTextFixup(const std::string &Text, | 309 AssemblerTextFixup *createTextFixup(const std::string &Text, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 protected: | 354 protected: |
| 351 // Buffer's constructor uses the Allocator, so it needs to appear after it. | 355 // Buffer's constructor uses the Allocator, so it needs to appear after it. |
| 352 // TODO(jpp): dependencies on construction order are a nice way of shooting | 356 // TODO(jpp): dependencies on construction order are a nice way of shooting |
| 353 // yourself in the foot. Fix this. | 357 // yourself in the foot. Fix this. |
| 354 AssemblerBuffer Buffer; | 358 AssemblerBuffer Buffer; |
| 355 }; | 359 }; |
| 356 | 360 |
| 357 } // end of namespace Ice | 361 } // end of namespace Ice |
| 358 | 362 |
| 359 #endif // SUBZERO_SRC_ICEASSEMBLER_H_ | 363 #endif // SUBZERO_SRC_ICEASSEMBLER_H_ |
| OLD | NEW |