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

Side by Side Diff: src/IceGlobalInits.h

Issue 1343843003: Refactor all instances of `typedef y x` to the C++11 `using x = y` syntax. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « src/IceGlobalContext.cpp ('k') | src/IceInst.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceGlobalInits.h - Global declarations -------*- C++ -*-===// 1 //===- subzero/src/IceGlobalInits.h - Global declarations -------*- 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 /// \file 10 /// \file
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 virtual void dumpType(Ostream &Stream) const; 165 virtual void dumpType(Ostream &Stream) const;
166 166
167 protected: 167 protected:
168 explicit Initializer(InitializerKind Kind) : Kind(Kind) {} 168 explicit Initializer(InitializerKind Kind) : Kind(Kind) {}
169 169
170 private: 170 private:
171 const InitializerKind Kind; 171 const InitializerKind Kind;
172 }; 172 };
173 173
174 /// Models the data in a data initializer. 174 /// Models the data in a data initializer.
175 typedef std::vector<char> DataVecType; 175 using DataVecType = std::vector<char>;
176 176
177 /// Defines a sequence of byte values as a data initializer. 177 /// Defines a sequence of byte values as a data initializer.
178 class DataInitializer : public Initializer { 178 class DataInitializer : public Initializer {
179 DataInitializer(const DataInitializer &) = delete; 179 DataInitializer(const DataInitializer &) = delete;
180 DataInitializer &operator=(const DataInitializer &) = delete; 180 DataInitializer &operator=(const DataInitializer &) = delete;
181 181
182 public: 182 public:
183 template <class... Args> 183 template <class... Args>
184 static std::unique_ptr<DataInitializer> create(Args &&... TheArgs) { 184 static std::unique_ptr<DataInitializer> create(Args &&... TheArgs) {
185 return makeUnique<DataInitializer>(std::forward<Args>(TheArgs)...); 185 return makeUnique<DataInitializer>(std::forward<Args>(TheArgs)...);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 RelocInitializer(const GlobalDeclaration *Declaration, RelocOffsetT Offset) 262 RelocInitializer(const GlobalDeclaration *Declaration, RelocOffsetT Offset)
263 : Initializer(RelocInitializerKind), Declaration(Declaration), 263 : Initializer(RelocInitializerKind), Declaration(Declaration),
264 Offset(Offset) {} // The global declaration used in the relocation. 264 Offset(Offset) {} // The global declaration used in the relocation.
265 265
266 const GlobalDeclaration *Declaration; 266 const GlobalDeclaration *Declaration;
267 /// The offset to add to the relocation. 267 /// The offset to add to the relocation.
268 const RelocOffsetT Offset; 268 const RelocOffsetT Offset;
269 }; 269 };
270 270
271 /// Models the list of initializers. 271 /// Models the list of initializers.
272 typedef std::vector<std::unique_ptr<Initializer>> InitializerListType; 272 using InitializerListType = std::vector<std::unique_ptr<Initializer>>;
273 273
274 static VariableDeclaration *create(GlobalContext *Context) { 274 static VariableDeclaration *create(GlobalContext *Context) {
275 return new (Context->allocate<VariableDeclaration>()) VariableDeclaration(); 275 return new (Context->allocate<VariableDeclaration>()) VariableDeclaration();
276 } 276 }
277 277
278 const InitializerListType &getInitializers() const { return *Initializers; } 278 const InitializerListType &getInitializers() const { return *Initializers; }
279 bool getIsConstant() const { return IsConstant; } 279 bool getIsConstant() const { return IsConstant; }
280 void setIsConstant(bool NewValue) { IsConstant = NewValue; } 280 void setIsConstant(bool NewValue) { IsConstant = NewValue; }
281 uint32_t getAlignment() const { return Alignment; } 281 uint32_t getAlignment() const { return Alignment; }
282 void setAlignment(uint32_t NewAlignment) { Alignment = NewAlignment; } 282 void setAlignment(uint32_t NewAlignment) { Alignment = NewAlignment; }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 template <class StreamType> 353 template <class StreamType>
354 inline StreamType &operator<<(StreamType &Stream, 354 inline StreamType &operator<<(StreamType &Stream,
355 const GlobalDeclaration &Addr) { 355 const GlobalDeclaration &Addr) {
356 Addr.dump(Stream); 356 Addr.dump(Stream);
357 return Stream; 357 return Stream;
358 } 358 }
359 359
360 } // end of namespace Ice 360 } // end of namespace Ice
361 361
362 #endif // SUBZERO_SRC_ICEGLOBALINITS_H 362 #endif // SUBZERO_SRC_ICEGLOBALINITS_H
OLDNEW
« no previous file with comments | « src/IceGlobalContext.cpp ('k') | src/IceInst.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698