Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Side by Side Diff: src/IceCfgNode.h

Issue 656123003: Subzero: Class definition cleanup. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Changes for Karl Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceCfg.cpp ('k') | src/IceConverter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceCfgNode.h - Control flow graph node -------*- C++ -*-===// 1 //===- subzero/src/IceCfgNode.h - Control flow graph node -------*- C++ -*-===//
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 declares the CfgNode class, which represents a single 10 // This file declares the CfgNode class, which represents a single
11 // basic block as its instruction list, in-edge list, and out-edge 11 // basic block as its instruction list, in-edge list, and out-edge
12 // list. 12 // list.
13 // 13 //
14 //===----------------------------------------------------------------------===// 14 //===----------------------------------------------------------------------===//
15 15
16 #ifndef SUBZERO_SRC_ICECFGNODE_H 16 #ifndef SUBZERO_SRC_ICECFGNODE_H
17 #define SUBZERO_SRC_ICECFGNODE_H 17 #define SUBZERO_SRC_ICECFGNODE_H
18 18
19 #include "IceDefs.h" 19 #include "IceDefs.h"
20 20
21 namespace Ice { 21 namespace Ice {
22 22
23 class CfgNode { 23 class CfgNode {
24 CfgNode(const CfgNode &) = delete;
25 CfgNode &operator=(const CfgNode &) = delete;
26
24 public: 27 public:
25 static CfgNode *create(Cfg *Func, SizeT LabelIndex, IceString Name = "") { 28 static CfgNode *create(Cfg *Func, SizeT LabelIndex, IceString Name = "") {
26 return new (Func->allocate<CfgNode>()) CfgNode(Func, LabelIndex, Name); 29 return new (Func->allocate<CfgNode>()) CfgNode(Func, LabelIndex, Name);
27 } 30 }
28 31
29 // Access the label number and name for this node. 32 // Access the label number and name for this node.
30 SizeT getIndex() const { return Number; } 33 SizeT getIndex() const { return Number; }
31 IceString getName() const; 34 IceString getName() const;
32 void setName(IceString &NewName) { 35 void setName(IceString &NewName) {
33 // Make sure that the name can only be set once. 36 // Make sure that the name can only be set once.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 void genCode(); 72 void genCode();
70 void livenessLightweight(); 73 void livenessLightweight();
71 bool liveness(Liveness *Liveness); 74 bool liveness(Liveness *Liveness);
72 void livenessPostprocess(LivenessMode Mode, Liveness *Liveness); 75 void livenessPostprocess(LivenessMode Mode, Liveness *Liveness);
73 void doBranchOpt(const CfgNode *NextNode); 76 void doBranchOpt(const CfgNode *NextNode);
74 void emit(Cfg *Func) const; 77 void emit(Cfg *Func) const;
75 void dump(Cfg *Func) const; 78 void dump(Cfg *Func) const;
76 79
77 private: 80 private:
78 CfgNode(Cfg *Func, SizeT LabelIndex, IceString Name); 81 CfgNode(Cfg *Func, SizeT LabelIndex, IceString Name);
79 CfgNode(const CfgNode &) = delete;
80 CfgNode &operator=(const CfgNode &) = delete;
81 Cfg *const Func; 82 Cfg *const Func;
82 const SizeT Number; // label index 83 const SizeT Number; // label index
83 IceString Name; // for dumping only 84 IceString Name; // for dumping only
84 bool HasReturn; // does this block need an epilog? 85 bool HasReturn; // does this block need an epilog?
85 InstNumberT InstCountEstimate; // rough instruction count estimate 86 InstNumberT InstCountEstimate; // rough instruction count estimate
86 NodeList InEdges; // in no particular order 87 NodeList InEdges; // in no particular order
87 NodeList OutEdges; // in no particular order 88 NodeList OutEdges; // in no particular order
88 PhiList Phis; // unordered set of phi instructions 89 PhiList Phis; // unordered set of phi instructions
89 InstList Insts; // ordered list of non-phi instructions 90 InstList Insts; // ordered list of non-phi instructions
90 }; 91 };
91 92
92 } // end of namespace Ice 93 } // end of namespace Ice
93 94
94 #endif // SUBZERO_SRC_ICECFGNODE_H 95 #endif // SUBZERO_SRC_ICECFGNODE_H
OLDNEW
« no previous file with comments | « src/IceCfg.cpp ('k') | src/IceConverter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698