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

Side by Side Diff: src/IceCfgNode.h

Issue 205613002: Initial skeleton of Subzero. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Use non-anonymous structs so that array_lengthof works Created 6 years, 8 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/IceCfgNode.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 //===- subzero/src/IceCfgNode.h - Control flow graph node -------*- C++ -*-===//
2 //
3 // The Subzero Code Generator
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares the CfgNode class, which represents a single
11 // basic block as its instruction list, in-edge list, and out-edge
12 // list.
13 //
14 //===----------------------------------------------------------------------===//
15
16 #ifndef SUBZERO_SRC_ICECFGNODE_H
17 #define SUBZERO_SRC_ICECFGNODE_H
18
19 #include "IceDefs.h"
20
21 namespace Ice {
22
23 class CfgNode {
24 public:
25 static CfgNode *create(Cfg *Func, SizeT LabelIndex, IceString Name = "") {
26 return new (Func->allocate<CfgNode>()) CfgNode(Func, LabelIndex, Name);
27 }
28
29 // Access the label number and name for this node.
30 SizeT getIndex() const { return Number; }
31 IceString getName() const;
32
33 // Access predecessor and successor edge lists.
34 const NodeList &getInEdges() const { return InEdges; }
35 const NodeList &getOutEdges() const { return OutEdges; }
36
37 // Manage the instruction list.
38 InstList &getInsts() { return Insts; }
39 void appendInst(Inst *Inst);
40
41 // Add a predecessor edge to the InEdges list for each of this
42 // node's successors.
43 void computePredecessors();
44
45 void dump(Cfg *Func) const;
46
47 private:
48 CfgNode(Cfg *Func, SizeT LabelIndex, IceString Name);
49 CfgNode(const CfgNode &) LLVM_DELETED_FUNCTION;
50 CfgNode &operator=(const CfgNode &) LLVM_DELETED_FUNCTION;
51 Cfg *const Func;
52 const SizeT Number; // label index
53 IceString Name; // for dumping only
54 NodeList InEdges; // in no particular order
55 NodeList OutEdges; // in no particular order
56 PhiList Phis; // unordered set of phi instructions
57 InstList Insts; // ordered list of non-phi instructions
58 };
59
60 } // end of namespace Ice
61
62 #endif // SUBZERO_SRC_ICECFGNODE_H
OLDNEW
« no previous file with comments | « src/IceCfg.cpp ('k') | src/IceCfgNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698