| OLD | NEW |
| 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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 int32_t Offset = getStackOffset(); | 463 int32_t Offset = getStackOffset(); |
| 464 if (Offset) { | 464 if (Offset) { |
| 465 if (Offset > 0) | 465 if (Offset > 0) |
| 466 Str << "+"; | 466 Str << "+"; |
| 467 Str << Offset; | 467 Str << Offset; |
| 468 } | 468 } |
| 469 Str << "]"; | 469 Str << "]"; |
| 470 } | 470 } |
| 471 } | 471 } |
| 472 | 472 |
| 473 void ConstantRelocatable::emit(GlobalContext *Ctx) const { | 473 void ConstantRelocatable::emitWithoutDollar(GlobalContext *Ctx) const { |
| 474 Ostream &Str = Ctx->getStrEmit(); | 474 Ostream &Str = Ctx->getStrEmit(); |
| 475 if (SuppressMangling) | 475 if (SuppressMangling) |
| 476 Str << Name; | 476 Str << Name; |
| 477 else | 477 else |
| 478 Str << Ctx->mangleName(Name); | 478 Str << Ctx->mangleName(Name); |
| 479 if (Offset) { | 479 if (Offset) { |
| 480 if (Offset > 0) | 480 if (Offset > 0) |
| 481 Str << "+"; | 481 Str << "+"; |
| 482 Str << Offset; | 482 Str << Offset; |
| 483 } | 483 } |
| 484 } | 484 } |
| 485 | 485 |
| 486 void ConstantRelocatable::emit(GlobalContext *Ctx) const { |
| 487 Ostream &Str = Ctx->getStrEmit(); |
| 488 Str << "$"; |
| 489 emitWithoutDollar(Ctx); |
| 490 } |
| 491 |
| 486 void ConstantRelocatable::dump(const Cfg *Func, Ostream &Str) const { | 492 void ConstantRelocatable::dump(const Cfg *Func, Ostream &Str) const { |
| 487 Str << "@"; | 493 Str << "@"; |
| 488 if (Func && !SuppressMangling) { | 494 if (Func && !SuppressMangling) { |
| 489 Str << Func->getContext()->mangleName(Name); | 495 Str << Func->getContext()->mangleName(Name); |
| 490 } else { | 496 } else { |
| 491 Str << Name; | 497 Str << Name; |
| 492 } | 498 } |
| 493 if (Offset) | 499 if (Offset) |
| 494 Str << "+" << Offset; | 500 Str << "+" << Offset; |
| 495 } | 501 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 512 | 518 |
| 513 Ostream &operator<<(Ostream &Str, const RegWeight &W) { | 519 Ostream &operator<<(Ostream &Str, const RegWeight &W) { |
| 514 if (W.getWeight() == RegWeight::Inf) | 520 if (W.getWeight() == RegWeight::Inf) |
| 515 Str << "Inf"; | 521 Str << "Inf"; |
| 516 else | 522 else |
| 517 Str << W.getWeight(); | 523 Str << W.getWeight(); |
| 518 return Str; | 524 return Str; |
| 519 } | 525 } |
| 520 | 526 |
| 521 } // end of namespace Ice | 527 } // end of namespace Ice |
| OLD | NEW |