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

Side by Side Diff: src/IceCfg.h

Issue 476323004: Start adding an integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: make fixups part of address Created 6 years, 3 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 | « Makefile.standalone ('k') | src/IceCfg.cpp » ('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/IceCfg.h - Control flow graph ----------------*- C++ -*-===// 1 //===- subzero/src/IceCfg.h - Control flow graph ----------------*- 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 Cfg class, which represents the control flow 10 // This file declares the Cfg class, which represents the control flow
11 // graph and the overall per-function compilation context. 11 // graph and the overall per-function compilation context.
12 // 12 //
13 //===----------------------------------------------------------------------===// 13 //===----------------------------------------------------------------------===//
14 14
15 #ifndef SUBZERO_SRC_ICECFG_H 15 #ifndef SUBZERO_SRC_ICECFG_H
16 #define SUBZERO_SRC_ICECFG_H 16 #define SUBZERO_SRC_ICECFG_H
17 17
18 #include "IceDefs.h" 18 #include "IceDefs.h"
19 #include "IceTypes.h" 19 #include "IceTypes.h"
20
21 #include "assembler.h"
22 #include "IceClFlags.h"
20 #include "IceGlobalContext.h" 23 #include "IceGlobalContext.h"
21 24
22 #include "llvm/ADT/OwningPtr.h" 25 #include "llvm/ADT/OwningPtr.h"
23 #include "llvm/Support/Allocator.h" 26 #include "llvm/Support/Allocator.h"
24 27
25 namespace Ice { 28 namespace Ice {
26 29
27 class Cfg { 30 class Cfg {
28 public: 31 public:
29 Cfg(GlobalContext *Ctx); 32 Cfg(GlobalContext *Ctx);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 const VarList &getVariables() const { return Variables; } 70 const VarList &getVariables() const { return Variables; }
68 71
69 // Manage arguments to the function. 72 // Manage arguments to the function.
70 void addArg(Variable *Arg); 73 void addArg(Variable *Arg);
71 const VarList &getArgs() const { return Args; } 74 const VarList &getArgs() const { return Args; }
72 VarList &getArgs() { return Args; } 75 VarList &getArgs() { return Args; }
73 76
74 // Miscellaneous accessors. 77 // Miscellaneous accessors.
75 TargetLowering *getTarget() const { return Target.get(); } 78 TargetLowering *getTarget() const { return Target.get(); }
76 Liveness *getLiveness() const { return Live.get(); } 79 Liveness *getLiveness() const { return Live.get(); }
80 template <typename T> T *getAssembler() const {
81 return static_cast<T *>(TargetAssembler.get());
82 }
83 bool UseIntegratedAssembler() const {
84 return getContext()->getFlags().UseIntegratedAssembler;
85 }
77 bool hasComputedFrame() const; 86 bool hasComputedFrame() const;
78 87
79 // Passes over the CFG. 88 // Passes over the CFG.
80 void translate(); 89 void translate();
81 // After the CFG is fully constructed, iterate over the nodes and 90 // After the CFG is fully constructed, iterate over the nodes and
82 // compute the predecessor edges, in the form of 91 // compute the predecessor edges, in the form of
83 // CfgNode::InEdges[]. 92 // CfgNode::InEdges[].
84 void computePredecessors(); 93 void computePredecessors();
85 void renumberInstructions(); 94 void renumberInstructions();
86 void placePhiLoads(); 95 void placePhiLoads();
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 bool IsInternalLinkage; 152 bool IsInternalLinkage;
144 bool HasError; 153 bool HasError;
145 IceString ErrorMessage; 154 IceString ErrorMessage;
146 CfgNode *Entry; // entry basic block 155 CfgNode *Entry; // entry basic block
147 NodeList Nodes; // linearized node list; Entry should be first 156 NodeList Nodes; // linearized node list; Entry should be first
148 InstNumberT NextInstNumber; 157 InstNumberT NextInstNumber;
149 VarList Variables; 158 VarList Variables;
150 VarList Args; // subset of Variables, in argument order 159 VarList Args; // subset of Variables, in argument order
151 llvm::OwningPtr<Liveness> Live; 160 llvm::OwningPtr<Liveness> Live;
152 llvm::OwningPtr<TargetLowering> Target; 161 llvm::OwningPtr<TargetLowering> Target;
162 llvm::OwningPtr<Assembler> TargetAssembler;
153 163
154 // CurrentNode is maintained during dumping/emitting just for 164 // CurrentNode is maintained during dumping/emitting just for
155 // validating Variable::DefNode. Normally, a traversal over 165 // validating Variable::DefNode. Normally, a traversal over
156 // CfgNodes maintains this, but before global operations like 166 // CfgNodes maintains this, but before global operations like
157 // register allocation, setCurrentNode(NULL) should be called to 167 // register allocation, setCurrentNode(NULL) should be called to
158 // avoid spurious validation failures. 168 // avoid spurious validation failures.
159 const CfgNode *CurrentNode; 169 const CfgNode *CurrentNode;
160 170
161 Cfg(const Cfg &) LLVM_DELETED_FUNCTION; 171 Cfg(const Cfg &) LLVM_DELETED_FUNCTION;
162 Cfg &operator=(const Cfg &) LLVM_DELETED_FUNCTION; 172 Cfg &operator=(const Cfg &) LLVM_DELETED_FUNCTION;
163 }; 173 };
164 174
165 } // end of namespace Ice 175 } // end of namespace Ice
166 176
167 #endif // SUBZERO_SRC_ICECFG_H 177 #endif // SUBZERO_SRC_ICECFG_H
OLDNEW
« no previous file with comments | « Makefile.standalone ('k') | src/IceCfg.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698