| OLD | NEW |
| 1 //===- subzero/src/IceCfg.cpp - Control flow graph implementation ---------===// | 1 //===- subzero/src/IceCfg.cpp - Control flow graph 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 Cfg class, including constant pool | 10 // This file implements the Cfg class, including constant pool |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 void Cfg::emitTextHeader(const IceString &MangledName, GlobalContext *Ctx, | 457 void Cfg::emitTextHeader(const IceString &MangledName, GlobalContext *Ctx, |
| 458 const Assembler *Asm) { | 458 const Assembler *Asm) { |
| 459 if (!ALLOW_DUMP) | 459 if (!ALLOW_DUMP) |
| 460 return; | 460 return; |
| 461 Ostream &Str = Ctx->getStrEmit(); | 461 Ostream &Str = Ctx->getStrEmit(); |
| 462 Str << "\t.text\n"; | 462 Str << "\t.text\n"; |
| 463 if (Ctx->getFlags().getFunctionSections()) | 463 if (Ctx->getFlags().getFunctionSections()) |
| 464 Str << "\t.section\t.text." << MangledName << ",\"ax\",@progbits\n"; | 464 Str << "\t.section\t.text." << MangledName << ",\"ax\",@progbits\n"; |
| 465 if (!Asm->getInternal() || Ctx->getFlags().getDisableInternal()) { | 465 if (!Asm->getInternal() || Ctx->getFlags().getDisableInternal()) { |
| 466 Str << "\t.globl\t" << MangledName << "\n"; | 466 Str << "\t.globl\t" << MangledName << "\n"; |
| 467 Str << "\t.type\t" << MangledName << ",@function\n"; | 467 Str << "\t.type\t" << MangledName << ",%function\n"; |
| 468 } | 468 } |
| 469 Str << "\t.p2align " << Asm->getBundleAlignLog2Bytes() << ",0x"; | 469 Str << "\t" << Asm->getNonExecPadDirective() << " " |
| 470 << Asm->getBundleAlignLog2Bytes() << ",0x"; |
| 470 for (uint8_t I : Asm->getNonExecBundlePadding()) | 471 for (uint8_t I : Asm->getNonExecBundlePadding()) |
| 471 Str.write_hex(I); | 472 Str.write_hex(I); |
| 472 Str << "\n"; | 473 Str << "\n"; |
| 473 Str << MangledName << ":\n"; | 474 Str << MangledName << ":\n"; |
| 474 } | 475 } |
| 475 | 476 |
| 476 void Cfg::emit() { | 477 void Cfg::emit() { |
| 477 if (!ALLOW_DUMP) | 478 if (!ALLOW_DUMP) |
| 478 return; | 479 return; |
| 479 TimerMarker T(TimerStack::TT_emit, this); | 480 TimerMarker T(TimerStack::TT_emit, this); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 } | 542 } |
| 542 } | 543 } |
| 543 // Print each basic block | 544 // Print each basic block |
| 544 for (CfgNode *Node : Nodes) | 545 for (CfgNode *Node : Nodes) |
| 545 Node->dump(this); | 546 Node->dump(this); |
| 546 if (isVerbose(IceV_Instructions)) | 547 if (isVerbose(IceV_Instructions)) |
| 547 Str << "}\n"; | 548 Str << "}\n"; |
| 548 } | 549 } |
| 549 | 550 |
| 550 } // end of namespace Ice | 551 } // end of namespace Ice |
| OLD | NEW |