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

Side by Side Diff: src/IceOperand.cpp

Issue 667763002: Fix handling of relocation names, so that prefix mangling works. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 6 years, 2 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/IceGlobalInits.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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 Str << Name; 453 Str << Name;
454 else 454 else
455 Str << Ctx->mangleName(Name); 455 Str << Ctx->mangleName(Name);
456 if (Offset) { 456 if (Offset) {
457 if (Offset > 0) 457 if (Offset > 0)
458 Str << "+"; 458 Str << "+";
459 Str << Offset; 459 Str << Offset;
460 } 460 }
461 } 461 }
462 462
463 void ConstantRelocatable::dump(const Cfg *, Ostream &Str) const { 463 void ConstantRelocatable::dump(const Cfg *Func, Ostream &Str) const {
464 Str << "@" << Name; 464 Str << "@";
465 if (Func && !SuppressMangling) {
466 Str << Func->getContext()->mangleName(Name);
467 } else {
468 Str << Name;
469 }
465 if (Offset) 470 if (Offset)
466 Str << "+" << Offset; 471 Str << "+" << Offset;
467 } 472 }
468 473
469 void LiveRange::dump(Ostream &Str) const { 474 void LiveRange::dump(Ostream &Str) const {
470 Str << "(weight=" << Weight << ") "; 475 Str << "(weight=" << Weight << ") ";
471 bool First = true; 476 bool First = true;
472 for (const RangeElementType &I : Range) { 477 for (const RangeElementType &I : Range) {
473 if (!First) 478 if (!First)
474 Str << ", "; 479 Str << ", ";
475 First = false; 480 First = false;
476 Str << "[" << I.first << ":" << I.second << ")"; 481 Str << "[" << I.first << ":" << I.second << ")";
477 } 482 }
478 } 483 }
479 484
480 Ostream &operator<<(Ostream &Str, const LiveRange &L) { 485 Ostream &operator<<(Ostream &Str, const LiveRange &L) {
481 L.dump(Str); 486 L.dump(Str);
482 return Str; 487 return Str;
483 } 488 }
484 489
485 Ostream &operator<<(Ostream &Str, const RegWeight &W) { 490 Ostream &operator<<(Ostream &Str, const RegWeight &W) {
486 if (W.getWeight() == RegWeight::Inf) 491 if (W.getWeight() == RegWeight::Inf)
487 Str << "Inf"; 492 Str << "Inf";
488 else 493 else
489 Str << W.getWeight(); 494 Str << W.getWeight();
490 return Str; 495 return Str;
491 } 496 }
492 497
493 } // end of namespace Ice 498 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceGlobalInits.cpp ('k') | src/IceTargetLoweringX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698