| 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 |
| 11 // multiple functions. | 11 // multiple functions. |
| 12 // | 12 // |
| 13 //===----------------------------------------------------------------------===// | 13 //===----------------------------------------------------------------------===// |
| 14 | 14 |
| 15 #ifndef SUBZERO_SRC_ICEGLOBALCONTEXT_H | 15 #ifndef SUBZERO_SRC_ICEGLOBALCONTEXT_H |
| 16 #define SUBZERO_SRC_ICEGLOBALCONTEXT_H | 16 #define SUBZERO_SRC_ICEGLOBALCONTEXT_H |
| 17 | 17 |
| 18 #include "llvm/ADT/OwningPtr.h" | |
| 19 #include "llvm/Support/Allocator.h" | 18 #include "llvm/Support/Allocator.h" |
| 20 #include "llvm/Support/raw_ostream.h" | 19 #include "llvm/Support/raw_ostream.h" |
| 21 | 20 |
| 22 #include "IceDefs.h" | 21 #include "IceDefs.h" |
| 23 #include "IceIntrinsics.h" | 22 #include "IceIntrinsics.h" |
| 24 #include "IceRNG.h" | 23 #include "IceRNG.h" |
| 25 #include "IceTypes.h" | 24 #include "IceTypes.h" |
| 26 | 25 |
| 26 #include <memory> |
| 27 |
| 27 namespace Ice { | 28 namespace Ice { |
| 28 | 29 |
| 29 class ClFlags; | 30 class ClFlags; |
| 30 | 31 |
| 31 // This class collects rudimentary statistics during translation. | 32 // This class collects rudimentary statistics during translation. |
| 32 class CodeStats { | 33 class CodeStats { |
| 33 public: | 34 public: |
| 34 CodeStats() | 35 CodeStats() |
| 35 : InstructionsEmitted(0), RegistersSaved(0), FrameBytes(0), Spills(0), | 36 : InstructionsEmitted(0), RegistersSaved(0), FrameBytes(0), Spills(0), |
| 36 Fills(0) {} | 37 Fills(0) {} |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 StatsFunction.updateFills(); | 154 StatsFunction.updateFills(); |
| 154 StatsCumulative.updateFills(); | 155 StatsCumulative.updateFills(); |
| 155 } | 156 } |
| 156 | 157 |
| 157 private: | 158 private: |
| 158 Ostream *StrDump; // Stream for dumping / diagnostics | 159 Ostream *StrDump; // Stream for dumping / diagnostics |
| 159 Ostream *StrEmit; // Stream for code emission | 160 Ostream *StrEmit; // Stream for code emission |
| 160 | 161 |
| 161 llvm::BumpPtrAllocator Allocator; | 162 llvm::BumpPtrAllocator Allocator; |
| 162 VerboseMask VMask; | 163 VerboseMask VMask; |
| 163 llvm::OwningPtr<class ConstantPool> ConstPool; | 164 std::unique_ptr<class ConstantPool> ConstPool; |
| 164 Intrinsics IntrinsicsInfo; | 165 Intrinsics IntrinsicsInfo; |
| 165 const TargetArch Arch; | 166 const TargetArch Arch; |
| 166 const OptLevel Opt; | 167 const OptLevel Opt; |
| 167 const IceString TestPrefix; | 168 const IceString TestPrefix; |
| 168 const ClFlags &Flags; | 169 const ClFlags &Flags; |
| 169 bool HasEmittedFirstMethod; | 170 bool HasEmittedFirstMethod; |
| 170 RandomNumberGenerator RNG; | 171 RandomNumberGenerator RNG; |
| 171 CodeStats StatsFunction; | 172 CodeStats StatsFunction; |
| 172 CodeStats StatsCumulative; | 173 CodeStats StatsCumulative; |
| 173 GlobalContext(const GlobalContext &) LLVM_DELETED_FUNCTION; | 174 GlobalContext(const GlobalContext &) LLVM_DELETED_FUNCTION; |
| 174 GlobalContext &operator=(const GlobalContext &) LLVM_DELETED_FUNCTION; | 175 GlobalContext &operator=(const GlobalContext &) LLVM_DELETED_FUNCTION; |
| 175 | 176 |
| 176 // Private helpers for mangleName() | 177 // Private helpers for mangleName() |
| 177 typedef llvm::SmallVector<char, 32> ManglerVector; | 178 typedef llvm::SmallVector<char, 32> ManglerVector; |
| 178 void incrementSubstitutions(ManglerVector &OldName) const; | 179 void incrementSubstitutions(ManglerVector &OldName) const; |
| 179 }; | 180 }; |
| 180 | 181 |
| 181 } // end of namespace Ice | 182 } // end of namespace Ice |
| 182 | 183 |
| 183 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H | 184 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H |
| OLD | NEW |