| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 TargetAssembler( | 42 TargetAssembler( |
| 43 TargetLowering::createAssembler(Ctx->getTargetArch(), this)), | 43 TargetLowering::createAssembler(Ctx->getTargetArch(), this)), |
| 44 CurrentNode(nullptr) { | 44 CurrentNode(nullptr) { |
| 45 assert(!Ctx->isIRGenerationDisabled() && | 45 assert(!Ctx->isIRGenerationDisabled() && |
| 46 "Attempt to build cfg when IR generation disabled"); | 46 "Attempt to build cfg when IR generation disabled"); |
| 47 } | 47 } |
| 48 | 48 |
| 49 Cfg::~Cfg() { | 49 Cfg::~Cfg() { |
| 50 assert(ICE_TLS_GET_FIELD(CurrentCfg) == this); | 50 assert(ICE_TLS_GET_FIELD(CurrentCfg) == this); |
| 51 // Reset the thread-local CurrentCfg pointer. | 51 // Reset the thread-local CurrentCfg pointer. |
| 52 ICE_TLS_SET_FIELD(CurrentCfg, nullptr); | 52 updateTLS(nullptr); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void Cfg::setError(const IceString &Message) { | 55 void Cfg::setError(const IceString &Message) { |
| 56 HasError = true; | 56 HasError = true; |
| 57 ErrorMessage = Message; | 57 ErrorMessage = Message; |
| 58 } | 58 } |
| 59 | 59 |
| 60 CfgNode *Cfg::makeNode() { | 60 CfgNode *Cfg::makeNode() { |
| 61 SizeT LabelIndex = Nodes.size(); | 61 SizeT LabelIndex = Nodes.size(); |
| 62 CfgNode *Node = CfgNode::create(this, LabelIndex); | 62 CfgNode *Node = CfgNode::create(this, LabelIndex); |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 } | 519 } |
| 520 } | 520 } |
| 521 // Print each basic block | 521 // Print each basic block |
| 522 for (CfgNode *Node : Nodes) | 522 for (CfgNode *Node : Nodes) |
| 523 Node->dump(this); | 523 Node->dump(this); |
| 524 if (isVerbose(IceV_Instructions)) | 524 if (isVerbose(IceV_Instructions)) |
| 525 Str << "}\n"; | 525 Str << "}\n"; |
| 526 } | 526 } |
| 527 | 527 |
| 528 } // end of namespace Ice | 528 } // end of namespace Ice |
| OLD | NEW |