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 26 matching lines...) Expand all Loading... |
37 } | 37 } |
38 | 38 |
39 Cfg::~Cfg() {} | 39 Cfg::~Cfg() {} |
40 | 40 |
41 void Cfg::setError(const IceString &Message) { | 41 void Cfg::setError(const IceString &Message) { |
42 HasError = true; | 42 HasError = true; |
43 ErrorMessage = Message; | 43 ErrorMessage = Message; |
44 Ctx->getStrDump() << "ICE translation error: " << ErrorMessage << "\n"; | 44 Ctx->getStrDump() << "ICE translation error: " << ErrorMessage << "\n"; |
45 } | 45 } |
46 | 46 |
47 CfgNode *Cfg::makeNode(const IceString &Name) { | 47 CfgNode *Cfg::makeNode() { |
48 SizeT LabelIndex = Nodes.size(); | 48 SizeT LabelIndex = Nodes.size(); |
49 CfgNode *Node = CfgNode::create(this, LabelIndex, Name); | 49 CfgNode *Node = CfgNode::create(this, LabelIndex); |
50 Nodes.push_back(Node); | 50 Nodes.push_back(Node); |
51 return Node; | 51 return Node; |
52 } | 52 } |
53 | 53 |
54 void Cfg::addArg(Variable *Arg) { | 54 void Cfg::addArg(Variable *Arg) { |
55 Arg->setIsArg(); | 55 Arg->setIsArg(); |
56 Args.push_back(Arg); | 56 Args.push_back(Arg); |
57 } | 57 } |
58 | 58 |
59 void Cfg::addImplicitArg(Variable *Arg) { | 59 void Cfg::addImplicitArg(Variable *Arg) { |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 } | 502 } |
503 } | 503 } |
504 // Print each basic block | 504 // Print each basic block |
505 for (CfgNode *Node : Nodes) | 505 for (CfgNode *Node : Nodes) |
506 Node->dump(this); | 506 Node->dump(this); |
507 if (getContext()->isVerbose(IceV_Instructions)) | 507 if (getContext()->isVerbose(IceV_Instructions)) |
508 Str << "}\n"; | 508 Str << "}\n"; |
509 } | 509 } |
510 | 510 |
511 } // end of namespace Ice | 511 } // end of namespace Ice |
OLD | NEW |