| 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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 } | 416 } |
| 417 } | 417 } |
| 418 | 418 |
| 419 // ======================== Dump routines ======================== // | 419 // ======================== Dump routines ======================== // |
| 420 | 420 |
| 421 // emitTextHeader() is not target-specific (apart from what is | 421 // emitTextHeader() is not target-specific (apart from what is |
| 422 // abstracted by the Assembler), so it is defined here rather than in | 422 // abstracted by the Assembler), so it is defined here rather than in |
| 423 // the target lowering class. | 423 // the target lowering class. |
| 424 void Cfg::emitTextHeader(const IceString &MangledName, GlobalContext *Ctx, | 424 void Cfg::emitTextHeader(const IceString &MangledName, GlobalContext *Ctx, |
| 425 const Assembler *Asm) { | 425 const Assembler *Asm) { |
| 426 // Note: Still used by emit IAS. | 426 if (!ALLOW_DUMP) |
| 427 return; |
| 427 Ostream &Str = Ctx->getStrEmit(); | 428 Ostream &Str = Ctx->getStrEmit(); |
| 428 Str << "\t.text\n"; | 429 Str << "\t.text\n"; |
| 429 if (Ctx->getFlags().getFunctionSections()) | 430 if (Ctx->getFlags().getFunctionSections()) |
| 430 Str << "\t.section\t.text." << MangledName << ",\"ax\",@progbits\n"; | 431 Str << "\t.section\t.text." << MangledName << ",\"ax\",@progbits\n"; |
| 431 if (!Asm->getInternal() || Ctx->getFlags().getDisableInternal()) { | 432 if (!Asm->getInternal() || Ctx->getFlags().getDisableInternal()) { |
| 432 Str << "\t.globl\t" << MangledName << "\n"; | 433 Str << "\t.globl\t" << MangledName << "\n"; |
| 433 Str << "\t.type\t" << MangledName << ",@function\n"; | 434 Str << "\t.type\t" << MangledName << ",@function\n"; |
| 434 } | 435 } |
| 435 Str << "\t.p2align " << Asm->getBundleAlignLog2Bytes() << ",0x"; | 436 Str << "\t.p2align " << Asm->getBundleAlignLog2Bytes() << ",0x"; |
| 436 for (uint8_t I : Asm->getNonExecBundlePadding()) | 437 for (uint8_t I : Asm->getNonExecBundlePadding()) |
| 437 Str.write_hex(I); | 438 Str.write_hex(I); |
| 438 Str << "\n"; | 439 Str << "\n"; |
| 439 if (Ctx->getFlags().getUseSandboxing()) | |
| 440 Str << "\t.bundle_align_mode " << Asm->getBundleAlignLog2Bytes() << "\n"; | |
| 441 Str << MangledName << ":\n"; | 440 Str << MangledName << ":\n"; |
| 442 } | 441 } |
| 443 | 442 |
| 444 void Cfg::emit() { | 443 void Cfg::emit() { |
| 445 if (!ALLOW_DUMP) | 444 if (!ALLOW_DUMP) |
| 446 return; | 445 return; |
| 447 TimerMarker T(TimerStack::TT_emit, this); | 446 TimerMarker T(TimerStack::TT_emit, this); |
| 448 if (Ctx->getFlags().getDecorateAsm()) { | 447 if (Ctx->getFlags().getDecorateAsm()) { |
| 449 renumberInstructions(); | 448 renumberInstructions(); |
| 450 getVMetadata()->init(VMK_Uses); | 449 getVMetadata()->init(VMK_Uses); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 } | 508 } |
| 510 } | 509 } |
| 511 // Print each basic block | 510 // Print each basic block |
| 512 for (CfgNode *Node : Nodes) | 511 for (CfgNode *Node : Nodes) |
| 513 Node->dump(this); | 512 Node->dump(this); |
| 514 if (isVerbose(IceV_Instructions)) | 513 if (isVerbose(IceV_Instructions)) |
| 515 Str << "}\n"; | 514 Str << "}\n"; |
| 516 } | 515 } |
| 517 | 516 |
| 518 } // end of namespace Ice | 517 } // end of namespace Ice |
| OLD | NEW |