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 25 matching lines...) Expand all Loading... |
36 | 36 |
37 Cfg::Cfg(GlobalContext *Ctx, uint32_t SequenceNumber) | 37 Cfg::Cfg(GlobalContext *Ctx, uint32_t SequenceNumber) |
38 : Ctx(Ctx), SequenceNumber(SequenceNumber), | 38 : Ctx(Ctx), SequenceNumber(SequenceNumber), |
39 VMask(Ctx->getFlags().getVerbose()), NextInstNumber(Inst::NumberInitial), | 39 VMask(Ctx->getFlags().getVerbose()), NextInstNumber(Inst::NumberInitial), |
40 Allocator(new ArenaAllocator<>()), Live(nullptr), | 40 Allocator(new ArenaAllocator<>()), Live(nullptr), |
41 Target(TargetLowering::createLowering(Ctx->getFlags().getTargetArch(), | 41 Target(TargetLowering::createLowering(Ctx->getFlags().getTargetArch(), |
42 this)), | 42 this)), |
43 VMetadata(new VariablesMetadata(this)), | 43 VMetadata(new VariablesMetadata(this)), |
44 TargetAssembler(TargetLowering::createAssembler( | 44 TargetAssembler(TargetLowering::createAssembler( |
45 Ctx->getFlags().getTargetArch(), this)) { | 45 Ctx->getFlags().getTargetArch(), this)) { |
46 assert(!Ctx->isIRGenerationDisabled() && | |
47 "Attempt to build cfg when IR generation disabled"); | |
48 } | 46 } |
49 | 47 |
50 Cfg::~Cfg() { assert(ICE_TLS_GET_FIELD(CurrentCfg) == nullptr); } | 48 Cfg::~Cfg() { assert(ICE_TLS_GET_FIELD(CurrentCfg) == nullptr); } |
51 | 49 |
52 void Cfg::setError(const IceString &Message) { | 50 void Cfg::setError(const IceString &Message) { |
53 HasError = true; | 51 HasError = true; |
54 ErrorMessage = Message; | 52 ErrorMessage = Message; |
55 } | 53 } |
56 | 54 |
57 CfgNode *Cfg::makeNode() { | 55 CfgNode *Cfg::makeNode() { |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 } | 759 } |
762 } | 760 } |
763 // Print each basic block | 761 // Print each basic block |
764 for (CfgNode *Node : Nodes) | 762 for (CfgNode *Node : Nodes) |
765 Node->dump(this); | 763 Node->dump(this); |
766 if (isVerbose(IceV_Instructions)) | 764 if (isVerbose(IceV_Instructions)) |
767 Str << "}\n"; | 765 Str << "}\n"; |
768 } | 766 } |
769 | 767 |
770 } // end of namespace Ice | 768 } // end of namespace Ice |
OLD | NEW |