OLD | NEW |
1 //===- subzero/src/IceGlobalContext.h - Global context defs -----*- C++ -*-===// | 1 //===- subzero/src/IceGlobalContext.h - Global context defs -----*- 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 // This file declares aspects of the compilation that persist across | 10 // This file declares aspects of the compilation that persist across |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 // Manage Constants. | 71 // Manage Constants. |
72 // getConstant*() functions are not const because they might add | 72 // getConstant*() functions are not const because they might add |
73 // something to the constant pool. | 73 // something to the constant pool. |
74 Constant *getConstantInt(Type Ty, uint64_t ConstantInt64); | 74 Constant *getConstantInt(Type Ty, uint64_t ConstantInt64); |
75 Constant *getConstantFloat(float Value); | 75 Constant *getConstantFloat(float Value); |
76 Constant *getConstantDouble(double Value); | 76 Constant *getConstantDouble(double Value); |
77 // Returns a symbolic constant. | 77 // Returns a symbolic constant. |
78 Constant *getConstantSym(Type Ty, int64_t Offset, const IceString &Name = "", | 78 Constant *getConstantSym(Type Ty, int64_t Offset, const IceString &Name = "", |
79 bool SuppressMangling = false); | 79 bool SuppressMangling = false); |
| 80 // getConstantPool() returns a copy of the constant pool for |
| 81 // constants of a given type. |
| 82 ConstantList getConstantPool(Type Ty) const; |
80 | 83 |
81 // Allocate data of type T using the global allocator. | 84 // Allocate data of type T using the global allocator. |
82 template <typename T> T *allocate() { return Allocator.Allocate<T>(); } | 85 template <typename T> T *allocate() { return Allocator.Allocate<T>(); } |
83 | 86 |
84 private: | 87 private: |
85 Ostream StrDump; // Stream for dumping / diagnostics | 88 Ostream StrDump; // Stream for dumping / diagnostics |
86 Ostream StrEmit; // Stream for code emission | 89 Ostream StrEmit; // Stream for code emission |
87 | 90 |
88 llvm::BumpPtrAllocator Allocator; | 91 llvm::BumpPtrAllocator Allocator; |
89 VerboseMask VMask; | 92 VerboseMask VMask; |
90 llvm::OwningPtr<class ConstantPool> ConstPool; | 93 llvm::OwningPtr<class ConstantPool> ConstPool; |
91 const TargetArch Arch; | 94 const TargetArch Arch; |
92 const OptLevel Opt; | 95 const OptLevel Opt; |
93 const IceString TestPrefix; | 96 const IceString TestPrefix; |
94 bool HasEmittedFirstMethod; | 97 bool HasEmittedFirstMethod; |
95 GlobalContext(const GlobalContext &) LLVM_DELETED_FUNCTION; | 98 GlobalContext(const GlobalContext &) LLVM_DELETED_FUNCTION; |
96 GlobalContext &operator=(const GlobalContext &) LLVM_DELETED_FUNCTION; | 99 GlobalContext &operator=(const GlobalContext &) LLVM_DELETED_FUNCTION; |
97 }; | 100 }; |
98 | 101 |
99 } // end of namespace Ice | 102 } // end of namespace Ice |
100 | 103 |
101 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H | 104 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H |
OLD | NEW |