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

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 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « 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..bf96aefc23731c42777d901f0dfd6f5f874f2e7e
--- /dev/null
+++ b/src/IceCfgNode.h
@@ -0,0 +1,62 @@
+//===- 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 CfgNode 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"
+
+namespace Ice {
+
+class CfgNode {
+public:
+ static CfgNode *create(Cfg *Func, SizeT LabelIndex, IceString Name = "") {
+ return new (Func->allocate<CfgNode>()) CfgNode(Func, LabelIndex, Name);
+ }
+
+ // Access the label number and name for this node.
+ SizeT getIndex() const { return Number; }
+ IceString getName() const;
+
+ // Access predecessor and successor edge lists.
+ const NodeList &getInEdges() const { return InEdges; }
+ const NodeList &getOutEdges() const { return OutEdges; }
+
+ // Manage the instruction list.
+ InstList &getInsts() { return Insts; }
+ void appendInst(Inst *Inst);
+
+ // Add a predecessor edge to the InEdges list for each of this
+ // node's successors.
+ void computePredecessors();
+
+ void dump(Cfg *Func) const;
+
+private:
+ CfgNode(Cfg *Func, SizeT LabelIndex, IceString Name);
+ CfgNode(const CfgNode &) LLVM_DELETED_FUNCTION;
+ CfgNode &operator=(const CfgNode &) LLVM_DELETED_FUNCTION;
+ Cfg *const Func;
+ const SizeT Number; // label index
+ IceString Name; // for dumping only
+ NodeList InEdges; // in no particular order
+ NodeList OutEdges; // in no particular order
+ PhiList Phis; // unordered set of phi instructions
+ InstList Insts; // ordered list of non-phi instructions
+};
+
+} // end of namespace Ice
+
+#endif // SUBZERO_SRC_ICECFGNODE_H
« 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