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

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: Address Jan's latest comments 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
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 IceCfgNode 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 class IceCfgNode {
22 public:
23 static IceCfgNode *create(IceCfg *Cfg, uint32_t LabelIndex,
24 IceString Name = "") {
25 return new (Cfg->allocate<IceCfgNode>()) IceCfgNode(Cfg, LabelIndex, Name);
26 }
27
28 uint32_t getIndex() const { return Number; }
29 IceString getName() const;
30
31 const IceNodeList &getInEdges() const { return InEdges; }
32 const IceNodeList &getOutEdges() const { return OutEdges; }
33
34 IceInstList &getInsts() { return Insts; }
35 void appendInst(IceInst *Inst);
36
37 void registerEdges();
38
39 void dump(IceOstream &Str) const;
40
41 private:
42 IceCfgNode(IceCfg *Cfg, uint32_t LabelIndex, IceString Name);
43 IceCfg *const Cfg;
44 const uint32_t Number; // label index
45 IceString Name; // for dumping only
46 IceNodeList InEdges; // in no particular order
47 IceNodeList OutEdges; // in no particular order
48 IcePhiList Phis; // unordered set of phi instructions
49 IceInstList Insts; // ordered list of non-phi instructions
50 };
51
52 #endif // SUBZERO_SRC_ICECFGNODE_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698