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

Side by Side Diff: src/IceOperand.cpp

Issue 561823002: Fix symbol table handling in functions. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 6 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
OLDNEW
1 //===- subzero/src/IceOperand.cpp - High-level operand implementation -----===// 1 //===- subzero/src/IceOperand.cpp - High-level operand implementation -----===//
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 implements the Operand class and its target-independent 10 // This file implements the Operand class and its target-independent
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 } 181 }
182 182
183 IceString Variable::getName() const { 183 IceString Variable::getName() const {
184 if (!Name.empty()) 184 if (!Name.empty())
185 return Name; 185 return Name;
186 char buf[30]; 186 char buf[30];
187 snprintf(buf, llvm::array_lengthof(buf), "__%u", getIndex()); 187 snprintf(buf, llvm::array_lengthof(buf), "__%u", getIndex());
188 return buf; 188 return buf;
189 } 189 }
190 190
191 void Variable::setName(IceString &NewName) {
192 assert(Name.empty());
Jim Stichnoth 2014/09/10 18:44:23 Document that the assert is to be sure true renami
Karl 2014/09/10 21:14:33 Done.
193 Name = NewName;
194 }
195
191 Variable Variable::asType(Type Ty) { 196 Variable Variable::asType(Type Ty) {
192 Variable V(Ty, DefNode, Number, Name); 197 Variable V(Ty, DefNode, Number, Name);
193 V.RegNum = RegNum; 198 V.RegNum = RegNum;
194 V.StackOffset = StackOffset; 199 V.StackOffset = StackOffset;
195 return V; 200 return V;
196 } 201 }
197 202
198 // ======================== dump routines ======================== // 203 // ======================== dump routines ======================== //
199 204
200 void Variable::emit(const Cfg *Func) const { 205 void Variable::emit(const Cfg *Func) const {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 270
266 Ostream &operator<<(Ostream &Str, const RegWeight &W) { 271 Ostream &operator<<(Ostream &Str, const RegWeight &W) {
267 if (W.getWeight() == RegWeight::Inf) 272 if (W.getWeight() == RegWeight::Inf)
268 Str << "Inf"; 273 Str << "Inf";
269 else 274 else
270 Str << W.getWeight(); 275 Str << W.getWeight();
271 return Str; 276 return Str;
272 } 277 }
273 278
274 } // end of namespace Ice 279 } // end of namespace Ice
OLDNEW
« src/IceOperand.h ('K') | « src/IceOperand.h ('k') | src/PNaClTranslator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698