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

Unified 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 SubzeroPointerType instead of IceType_i32 for pointers Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« README.rst ('K') | « src/IceCfg.cpp ('k') | src/IceCfgNode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfgNode.h
diff --git a/src/IceCfgNode.h b/src/IceCfgNode.h
new file mode 100644
index 0000000000000000000000000000000000000000..f5b075220b767ca22c667e0e77a14e0a67db0b7f
--- /dev/null
+++ b/src/IceCfgNode.h
@@ -0,0 +1,52 @@
+//===- subzero/src/IceCfgNode.h - Control flow graph node -------*- C++ -*-===//
+//
+// The Subzero Code Generator
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file declares the IceCfgNode class, which represents a single
+// basic block as its instruction list, in-edge list, and out-edge
+// list.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef SUBZERO_SRC_ICECFGNODE_H
+#define SUBZERO_SRC_ICECFGNODE_H
+
+#include "IceDefs.h"
+
+class IceCfgNode {
+public:
+ static IceCfgNode *create(IceCfg *Cfg, uint32_t LabelIndex,
+ IceString Name = "") {
+ return new IceCfgNode(Cfg, LabelIndex, Name);
jvoung (off chromium) 2014/03/28 23:21:53 should this new() use the cfg allocator too?
Jim Stichnoth 2014/03/29 14:23:22 Done, also in IceVariable. I'm leaving the IceCon
+ }
+
+ uint32_t getIndex() const { return Number; }
+ IceString getName() const;
+
+ const IceNodeList &getInEdges() const { return InEdges; }
+ const IceNodeList &getOutEdges() const { return OutEdges; }
+
+ IceInstList &getInsts() { return Insts; }
+ void appendInst(IceInst *Inst);
+
+ void registerEdges();
+
+ void dump(IceOstream &Str) const;
+
+private:
+ IceCfgNode(IceCfg *Cfg, uint32_t LabelIndex, IceString Name);
+ IceCfg *const Cfg;
+ const uint32_t Number; // label index
+ IceString Name; // for dumping only
+ IceNodeList InEdges; // in no particular order
+ IceNodeList OutEdges; // in no particular order
+ IcePhiList Phis; // unordered set of phi instructions
+ IceInstList Insts; // ordered list of non-phi instructions
+};
+
+#endif // SUBZERO_SRC_ICECFGNODE_H
« README.rst ('K') | « src/IceCfg.cpp ('k') | src/IceCfgNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698