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

Side by Side Diff: src/IceTypes.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/IceTranslator.cpp ('k') | src/PNaClTranslator.cpp » ('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/IceTypes.h - Primitive ICE types -------------*- C++ -*-===// 1 //===- subzero/src/IceTypes.h - Primitive ICE types -------------*- 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 a few properties of the primitive types allowed 10 // This file declares a few properties of the primitive types allowed
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 /// Models a type signature for a function. 124 /// Models a type signature for a function.
125 class FuncSigType { 125 class FuncSigType {
126 FuncSigType &operator=(const FuncSigType &Ty) = delete; 126 FuncSigType &operator=(const FuncSigType &Ty) = delete;
127 127
128 public: 128 public:
129 typedef std::vector<Type> ArgListType; 129 typedef std::vector<Type> ArgListType;
130 130
131 // Creates a function signature type with the given return type. 131 // Creates a function signature type with the given return type.
132 // Parameter types should be added using calls to appendArgType. 132 // Parameter types should be added using calls to appendArgType.
133 FuncSigType() : ReturnType(IceType_void) {} 133 FuncSigType() = default;
134 FuncSigType(const FuncSigType &Ty) = default; 134 FuncSigType(const FuncSigType &Ty) = default;
135 135
136 void appendArgType(Type ArgType) { ArgList.push_back(ArgType); } 136 void appendArgType(Type ArgType) { ArgList.push_back(ArgType); }
137 137
138 Type getReturnType() const { return ReturnType; } 138 Type getReturnType() const { return ReturnType; }
139 void setReturnType(Type NewType) { ReturnType = NewType; } 139 void setReturnType(Type NewType) { ReturnType = NewType; }
140 SizeT getNumArgs() const { return ArgList.size(); } 140 SizeT getNumArgs() const { return ArgList.size(); }
141 Type getArgType(SizeT Index) const { 141 Type getArgType(SizeT Index) const {
142 assert(Index < ArgList.size()); 142 assert(Index < ArgList.size());
143 return ArgList[Index]; 143 return ArgList[Index];
144 } 144 }
145 const ArgListType &getArgList() const { return ArgList; } 145 const ArgListType &getArgList() const { return ArgList; }
146 void dump(Ostream &Stream) const; 146 void dump(Ostream &Stream) const;
147 147
148 private: 148 private:
149 // The return type. 149 // The return type.
150 Type ReturnType; 150 Type ReturnType = IceType_void;
151 // The list of parameters. 151 // The list of parameters.
152 ArgListType ArgList; 152 ArgListType ArgList;
153 }; 153 };
154 154
155 inline Ostream &operator<<(Ostream &Stream, const FuncSigType &Sig) { 155 inline Ostream &operator<<(Ostream &Stream, const FuncSigType &Sig) {
156 Sig.dump(Stream); 156 Sig.dump(Stream);
157 return Stream; 157 return Stream;
158 } 158 }
159 159
160 } // end of namespace Ice 160 } // end of namespace Ice
161 161
162 #endif // SUBZERO_SRC_ICETYPES_H 162 #endif // SUBZERO_SRC_ICETYPES_H
OLDNEW
« no previous file with comments | « src/IceTranslator.cpp ('k') | src/PNaClTranslator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698