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 28 matching lines...) Expand all Loading... |
39 /// A Label can be in one of three states: | 39 /// A Label can be in one of three states: |
40 /// - Unused. | 40 /// - Unused. |
41 /// - Linked, unplaced and tracking the position of branches to the label. | 41 /// - Linked, unplaced and tracking the position of branches to the label. |
42 /// - Bound, placed and tracking its position. | 42 /// - Bound, placed and tracking its position. |
43 class Label { | 43 class Label { |
44 Label(const Label &) = delete; | 44 Label(const Label &) = delete; |
45 Label &operator=(const Label &) = delete; | 45 Label &operator=(const Label &) = delete; |
46 | 46 |
47 public: | 47 public: |
48 Label() = default; | 48 Label() = default; |
49 ~Label() = default; | 49 virtual ~Label() = default; |
50 | 50 |
51 virtual void finalCheck() const { | 51 virtual void finalCheck() const { |
52 // Assert if label is being destroyed with unresolved branches pending. | 52 // Assert if label is being destroyed with unresolved branches pending. |
53 assert(!isLinked()); | 53 assert(!isLinked()); |
54 } | 54 } |
55 | 55 |
56 /// Returns the encoded position stored in the label. | 56 /// Returns the encoded position stored in the label. |
57 intptr_t getEncodedPosition() const { return Position; } | 57 intptr_t getEncodedPosition() const { return Position; } |
58 | 58 |
59 /// Returns the position for bound labels (branches that come after this are | 59 /// Returns the position for bound labels (branches that come after this are |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 protected: | 361 protected: |
362 // Buffer's constructor uses the Allocator, so it needs to appear after it. | 362 // Buffer's constructor uses the Allocator, so it needs to appear after it. |
363 // TODO(jpp): dependencies on construction order are a nice way of shooting | 363 // TODO(jpp): dependencies on construction order are a nice way of shooting |
364 // yourself in the foot. Fix this. | 364 // yourself in the foot. Fix this. |
365 AssemblerBuffer Buffer; | 365 AssemblerBuffer Buffer; |
366 }; | 366 }; |
367 | 367 |
368 } // end of namespace Ice | 368 } // end of namespace Ice |
369 | 369 |
370 #endif // SUBZERO_SRC_ICEASSEMBLER_H_ | 370 #endif // SUBZERO_SRC_ICEASSEMBLER_H_ |
OLD | NEW |