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

Side by Side Diff: src/IceOperand.cpp

Issue 673783002: Subzero: Improve debugging controls, plus minor refactoring. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 1 month 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/IceLiveness.cpp ('k') | src/IceTargetLoweringX8632.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/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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 } 164 }
165 165
166 void LiveRange::trim(InstNumberT Lower) { 166 void LiveRange::trim(InstNumberT Lower) {
167 while (TrimmedBegin != Range.end() && TrimmedBegin->second <= Lower) 167 while (TrimmedBegin != Range.end() && TrimmedBegin->second <= Lower)
168 ++TrimmedBegin; 168 ++TrimmedBegin;
169 } 169 }
170 170
171 IceString Variable::getName() const { 171 IceString Variable::getName() const {
172 if (!Name.empty()) 172 if (!Name.empty())
173 return Name; 173 return Name;
174 char buf[30]; 174 return "__" + std::to_string(getIndex());
175 snprintf(buf, llvm::array_lengthof(buf), "__%u", getIndex());
176 return buf;
177 } 175 }
178 176
179 Variable Variable::asType(Type Ty) { 177 Variable Variable::asType(Type Ty) {
180 // Note: This returns a Variable, even if the "this" object is a 178 // Note: This returns a Variable, even if the "this" object is a
181 // subclass of Variable. 179 // subclass of Variable.
182 Variable V(kVariable, Ty, Number, Name); 180 Variable V(kVariable, Ty, Number, Name);
183 V.RegNum = RegNum; 181 V.RegNum = RegNum;
184 V.StackOffset = StackOffset; 182 V.StackOffset = StackOffset;
185 return V; 183 return V;
186 } 184 }
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 487
490 Ostream &operator<<(Ostream &Str, const RegWeight &W) { 488 Ostream &operator<<(Ostream &Str, const RegWeight &W) {
491 if (W.getWeight() == RegWeight::Inf) 489 if (W.getWeight() == RegWeight::Inf)
492 Str << "Inf"; 490 Str << "Inf";
493 else 491 else
494 Str << W.getWeight(); 492 Str << W.getWeight();
495 return Str; 493 return Str;
496 } 494 }
497 495
498 } // end of namespace Ice 496 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceLiveness.cpp ('k') | src/IceTargetLoweringX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698