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 /// \file | 10 /// \file |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 case FT_Iasm: { | 657 case FT_Iasm: { |
658 // The emission needs to be delayed until the after the text section so save | 658 // The emission needs to be delayed until the after the text section so save |
659 // the offsets in the global context. | 659 // the offsets in the global context. |
660 IceString MangledName = Ctx->mangleName(getFunctionName()); | 660 IceString MangledName = Ctx->mangleName(getFunctionName()); |
661 for (const InstJumpTable *JumpTable : JumpTables) { | 661 for (const InstJumpTable *JumpTable : JumpTables) { |
662 SizeT NumTargets = JumpTable->getNumTargets(); | 662 SizeT NumTargets = JumpTable->getNumTargets(); |
663 JumpTableData &JT = | 663 JumpTableData &JT = |
664 Ctx->addJumpTable(MangledName, JumpTable->getId(), NumTargets); | 664 Ctx->addJumpTable(MangledName, JumpTable->getId(), NumTargets); |
665 for (SizeT I = 0; I < NumTargets; ++I) { | 665 for (SizeT I = 0; I < NumTargets; ++I) { |
666 SizeT Index = JumpTable->getTarget(I)->getIndex(); | 666 SizeT Index = JumpTable->getTarget(I)->getIndex(); |
667 JT.pushTarget( | 667 JT.pushTarget(getAssembler()->getCfgNodeLabel(Index)->getPosition()); |
668 getAssembler()->getOrCreateCfgNodeLabel(Index)->getPosition()); | |
669 } | 668 } |
670 } | 669 } |
671 } break; | 670 } break; |
672 case FT_Asm: { | 671 case FT_Asm: { |
673 // Emit the assembly directly so we don't need to hang on to all the names | 672 // Emit the assembly directly so we don't need to hang on to all the names |
674 for (const InstJumpTable *JumpTable : JumpTables) | 673 for (const InstJumpTable *JumpTable : JumpTables) |
675 getTarget()->emitJumpTable(this, JumpTable); | 674 getTarget()->emitJumpTable(this, JumpTable); |
676 } break; | 675 } break; |
677 } | 676 } |
678 } | 677 } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 } | 759 } |
761 } | 760 } |
762 // Print each basic block | 761 // Print each basic block |
763 for (CfgNode *Node : Nodes) | 762 for (CfgNode *Node : Nodes) |
764 Node->dump(this); | 763 Node->dump(this); |
765 if (isVerbose(IceV_Instructions)) | 764 if (isVerbose(IceV_Instructions)) |
766 Str << "}\n"; | 765 Str << "}\n"; |
767 } | 766 } |
768 | 767 |
769 } // end of namespace Ice | 768 } // end of namespace Ice |
OLD | NEW |