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 13 matching lines...) Expand all Loading... |
24 namespace Ice { | 24 namespace Ice { |
25 | 25 |
26 Cfg::Cfg(GlobalContext *Ctx) | 26 Cfg::Cfg(GlobalContext *Ctx) |
27 : Ctx(Ctx), FunctionName(""), ReturnType(IceType_void), | 27 : Ctx(Ctx), FunctionName(""), ReturnType(IceType_void), |
28 IsInternalLinkage(false), HasError(false), FocusedTiming(false), | 28 IsInternalLinkage(false), HasError(false), FocusedTiming(false), |
29 ErrorMessage(""), Entry(NULL), NextInstNumber(1), Live(nullptr), | 29 ErrorMessage(""), Entry(NULL), NextInstNumber(1), Live(nullptr), |
30 Target(TargetLowering::createLowering(Ctx->getTargetArch(), this)), | 30 Target(TargetLowering::createLowering(Ctx->getTargetArch(), this)), |
31 VMetadata(new VariablesMetadata(this)), | 31 VMetadata(new VariablesMetadata(this)), |
32 TargetAssembler( | 32 TargetAssembler( |
33 TargetLowering::createAssembler(Ctx->getTargetArch(), this)), | 33 TargetLowering::createAssembler(Ctx->getTargetArch(), this)), |
34 CurrentNode(NULL) {} | 34 CurrentNode(NULL) { |
| 35 assert(!Ctx->isIRGenerationDisabled() && |
| 36 "Attempt to build cfg when IR generation disabled"); |
| 37 } |
35 | 38 |
36 Cfg::~Cfg() {} | 39 Cfg::~Cfg() {} |
37 | 40 |
38 void Cfg::setError(const IceString &Message) { | 41 void Cfg::setError(const IceString &Message) { |
39 HasError = true; | 42 HasError = true; |
40 ErrorMessage = Message; | 43 ErrorMessage = Message; |
41 Ctx->getStrDump() << "ICE translation error: " << ErrorMessage << "\n"; | 44 Ctx->getStrDump() << "ICE translation error: " << ErrorMessage << "\n"; |
42 } | 45 } |
43 | 46 |
44 CfgNode *Cfg::makeNode(const IceString &Name) { | 47 CfgNode *Cfg::makeNode(const IceString &Name) { |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 } | 482 } |
480 } | 483 } |
481 // Print each basic block | 484 // Print each basic block |
482 for (CfgNode *Node : Nodes) | 485 for (CfgNode *Node : Nodes) |
483 Node->dump(this); | 486 Node->dump(this); |
484 if (getContext()->isVerbose(IceV_Instructions)) | 487 if (getContext()->isVerbose(IceV_Instructions)) |
485 Str << "}\n"; | 488 Str << "}\n"; |
486 } | 489 } |
487 | 490 |
488 } // end of namespace Ice | 491 } // end of namespace Ice |
OLD | NEW |