Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: src/IceGlobalContext.h

Issue 622443002: Subzero: Change llvm::OwningPtr to C++11's std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Remove ErrorOr for now Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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" 18 #include <memory>
19
19 #include "llvm/Support/Allocator.h" 20 #include "llvm/Support/Allocator.h"
20 #include "llvm/Support/raw_ostream.h" 21 #include "llvm/Support/raw_ostream.h"
21 22
22 #include "IceDefs.h" 23 #include "IceDefs.h"
23 #include "IceIntrinsics.h" 24 #include "IceIntrinsics.h"
24 #include "IceRNG.h" 25 #include "IceRNG.h"
25 #include "IceTypes.h" 26 #include "IceTypes.h"
26 27
27 namespace Ice { 28 namespace Ice {
28 29
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 void pushTimer(TimerIdT ID); 155 void pushTimer(TimerIdT ID);
155 void popTimer(TimerIdT ID); 156 void popTimer(TimerIdT ID);
156 void dumpTimers(); 157 void dumpTimers();
157 158
158 private: 159 private:
159 Ostream *StrDump; // Stream for dumping / diagnostics 160 Ostream *StrDump; // Stream for dumping / diagnostics
160 Ostream *StrEmit; // Stream for code emission 161 Ostream *StrEmit; // Stream for code emission
161 162
162 llvm::BumpPtrAllocator Allocator; 163 llvm::BumpPtrAllocator Allocator;
163 VerboseMask VMask; 164 VerboseMask VMask;
164 llvm::OwningPtr<class ConstantPool> ConstPool; 165 std::unique_ptr<class ConstantPool> ConstPool;
165 Intrinsics IntrinsicsInfo; 166 Intrinsics IntrinsicsInfo;
166 const TargetArch Arch; 167 const TargetArch Arch;
167 const OptLevel Opt; 168 const OptLevel Opt;
168 const IceString TestPrefix; 169 const IceString TestPrefix;
169 const ClFlags &Flags; 170 const ClFlags &Flags;
170 bool HasEmittedFirstMethod; 171 bool HasEmittedFirstMethod;
171 RandomNumberGenerator RNG; 172 RandomNumberGenerator RNG;
172 CodeStats StatsFunction; 173 CodeStats StatsFunction;
173 CodeStats StatsCumulative; 174 CodeStats StatsCumulative;
174 llvm::OwningPtr<class TimerStack> Timers; 175 std::unique_ptr<class TimerStack> Timers;
175 GlobalContext(const GlobalContext &) LLVM_DELETED_FUNCTION; 176 GlobalContext(const GlobalContext &) LLVM_DELETED_FUNCTION;
176 GlobalContext &operator=(const GlobalContext &) LLVM_DELETED_FUNCTION; 177 GlobalContext &operator=(const GlobalContext &) LLVM_DELETED_FUNCTION;
177 178
178 // Private helpers for mangleName() 179 // Private helpers for mangleName()
179 typedef llvm::SmallVector<char, 32> ManglerVector; 180 typedef llvm::SmallVector<char, 32> ManglerVector;
180 void incrementSubstitutions(ManglerVector &OldName) const; 181 void incrementSubstitutions(ManglerVector &OldName) const;
181 }; 182 };
182 183
183 // Helper class to push and pop a timer marker. The constructor 184 // Helper class to push and pop a timer marker. The constructor
184 // pushes a marker, and the destructor pops it. This is for 185 // pushes a marker, and the destructor pops it. This is for
(...skipping 15 matching lines...) Expand all
200 201
201 private: 202 private:
202 TimerIdT ID; 203 TimerIdT ID;
203 GlobalContext *const Ctx; 204 GlobalContext *const Ctx;
204 const bool Active; 205 const bool Active;
205 }; 206 };
206 207
207 } // end of namespace Ice 208 } // end of namespace Ice
208 209
209 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H 210 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H
OLDNEW
« no previous file with comments | « src/IceDefs.h ('k') | src/IceGlobalContext.cpp » ('j') | src/PNaClTranslator.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698