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

Side by Side Diff: src/IceGlobalInits.h

Issue 1197223002: Subzero: Use C++11 member initializers where practical. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Rebase Created 5 years, 6 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 // This file declares the representation of function declarations, 10 // This file declares the representation of function declarations,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 bool isInternal() const { 47 bool isInternal() const {
48 return Linkage == llvm::GlobalValue::InternalLinkage; 48 return Linkage == llvm::GlobalValue::InternalLinkage;
49 } 49 }
50 llvm::GlobalValue::LinkageTypes getLinkage() const { return Linkage; } 50 llvm::GlobalValue::LinkageTypes getLinkage() const { return Linkage; }
51 bool isExternal() const { 51 bool isExternal() const {
52 return Linkage == llvm::GlobalValue::ExternalLinkage; 52 return Linkage == llvm::GlobalValue::ExternalLinkage;
53 } 53 }
54 void setLinkage(llvm::GlobalValue::LinkageTypes NewLinkage) { 54 void setLinkage(llvm::GlobalValue::LinkageTypes NewLinkage) {
55 Linkage = NewLinkage; 55 Linkage = NewLinkage;
56 } 56 }
57 virtual ~GlobalDeclaration() {} 57 virtual ~GlobalDeclaration() = default;
58 58
59 /// Prints out type of the global declaration. 59 /// Prints out type of the global declaration.
60 virtual void dumpType(Ostream &Stream) const = 0; 60 virtual void dumpType(Ostream &Stream) const = 0;
61 61
62 /// Prints out the global declaration. 62 /// Prints out the global declaration.
63 virtual void dump(GlobalContext *Ctx, Ostream &Stream) const = 0; 63 virtual void dump(GlobalContext *Ctx, Ostream &Stream) const = 0;
64 void dump(Ostream &Stream) const { 64 void dump(Ostream &Stream) const {
65 if (!ALLOW_DUMP) 65 if (!ALLOW_DUMP)
66 return; 66 return;
67 GlobalContext *const Ctx = nullptr; 67 GlobalContext *const Ctx = nullptr;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 Initializer &operator=(const Initializer &) = delete; 135 Initializer &operator=(const Initializer &) = delete;
136 136
137 public: 137 public:
138 /// Discriminator for LLVM-style RTTI. 138 /// Discriminator for LLVM-style RTTI.
139 enum InitializerKind { 139 enum InitializerKind {
140 DataInitializerKind, 140 DataInitializerKind,
141 ZeroInitializerKind, 141 ZeroInitializerKind,
142 RelocInitializerKind 142 RelocInitializerKind
143 }; 143 };
144 InitializerKind getKind() const { return Kind; } 144 InitializerKind getKind() const { return Kind; }
145 virtual ~Initializer() {} 145 virtual ~Initializer() = default;
146 virtual SizeT getNumBytes() const = 0; 146 virtual SizeT getNumBytes() const = 0;
147 virtual void dump(GlobalContext *Ctx, Ostream &Stream) const = 0; 147 virtual void dump(GlobalContext *Ctx, Ostream &Stream) const = 0;
148 void dump(Ostream &Stream) const { 148 void dump(Ostream &Stream) const {
149 if (ALLOW_DUMP) 149 if (ALLOW_DUMP)
150 dump(nullptr, Stream); 150 dump(nullptr, Stream);
151 } 151 }
152 virtual void dumpType(Ostream &Stream) const; 152 virtual void dumpType(Ostream &Stream) const;
153 153
154 protected: 154 protected:
155 explicit Initializer(InitializerKind Kind) : Kind(Kind) {} 155 explicit Initializer(InitializerKind Kind) : Kind(Kind) {}
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 template <class StreamType> 319 template <class StreamType>
320 inline StreamType &operator<<(StreamType &Stream, 320 inline StreamType &operator<<(StreamType &Stream,
321 const GlobalDeclaration &Addr) { 321 const GlobalDeclaration &Addr) {
322 Addr.dump(Stream); 322 Addr.dump(Stream);
323 return Stream; 323 return Stream;
324 } 324 }
325 325
326 } // end of namespace Ice 326 } // end of namespace Ice
327 327
328 #endif // SUBZERO_SRC_ICEGLOBALINITS_H 328 #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