OLD | NEW |
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 | 20 |
21 #include "assembler.h" | 21 #include "assembler.h" |
22 #include "IceClFlags.h" | 22 #include "IceClFlags.h" |
23 #include "IceGlobalContext.h" | 23 #include "IceGlobalContext.h" |
24 | 24 |
25 #include "llvm/ADT/OwningPtr.h" | |
26 #include "llvm/Support/Allocator.h" | 25 #include "llvm/Support/Allocator.h" |
27 | 26 |
| 27 #include <memory> |
| 28 |
28 namespace Ice { | 29 namespace Ice { |
29 | 30 |
30 class Cfg { | 31 class Cfg { |
31 public: | 32 public: |
32 Cfg(GlobalContext *Ctx); | 33 Cfg(GlobalContext *Ctx); |
33 ~Cfg(); | 34 ~Cfg(); |
34 | 35 |
35 GlobalContext *getContext() const { return Ctx; } | 36 GlobalContext *getContext() const { return Ctx; } |
36 | 37 |
37 // Manage the name and return type of the function being translated. | 38 // Manage the name and return type of the function being translated. |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 Type ReturnType; | 166 Type ReturnType; |
166 bool IsInternalLinkage; | 167 bool IsInternalLinkage; |
167 bool HasError; | 168 bool HasError; |
168 IceString ErrorMessage; | 169 IceString ErrorMessage; |
169 CfgNode *Entry; // entry basic block | 170 CfgNode *Entry; // entry basic block |
170 NodeList Nodes; // linearized node list; Entry should be first | 171 NodeList Nodes; // linearized node list; Entry should be first |
171 InstNumberT NextInstNumber; | 172 InstNumberT NextInstNumber; |
172 VarList Variables; | 173 VarList Variables; |
173 VarList Args; // subset of Variables, in argument order | 174 VarList Args; // subset of Variables, in argument order |
174 VarList ImplicitArgs; // subset of Variables | 175 VarList ImplicitArgs; // subset of Variables |
175 llvm::OwningPtr<Liveness> Live; | 176 std::unique_ptr<Liveness> Live; |
176 llvm::OwningPtr<TargetLowering> Target; | 177 std::unique_ptr<TargetLowering> Target; |
177 llvm::OwningPtr<VariablesMetadata> VMetadata; | 178 std::unique_ptr<VariablesMetadata> VMetadata; |
178 llvm::OwningPtr<Assembler> TargetAssembler; | 179 std::unique_ptr<Assembler> TargetAssembler; |
179 | 180 |
180 // CurrentNode is maintained during dumping/emitting just for | 181 // CurrentNode is maintained during dumping/emitting just for |
181 // validating Variable::DefNode. Normally, a traversal over | 182 // validating Variable::DefNode. Normally, a traversal over |
182 // CfgNodes maintains this, but before global operations like | 183 // CfgNodes maintains this, but before global operations like |
183 // register allocation, resetCurrentNode() should be called to avoid | 184 // register allocation, resetCurrentNode() should be called to avoid |
184 // spurious validation failures. | 185 // spurious validation failures. |
185 const CfgNode *CurrentNode; | 186 const CfgNode *CurrentNode; |
186 | 187 |
187 Cfg(const Cfg &) LLVM_DELETED_FUNCTION; | 188 Cfg(const Cfg &) LLVM_DELETED_FUNCTION; |
188 Cfg &operator=(const Cfg &) LLVM_DELETED_FUNCTION; | 189 Cfg &operator=(const Cfg &) LLVM_DELETED_FUNCTION; |
189 }; | 190 }; |
190 | 191 |
191 } // end of namespace Ice | 192 } // end of namespace Ice |
192 | 193 |
193 #endif // SUBZERO_SRC_ICECFG_H | 194 #endif // SUBZERO_SRC_ICECFG_H |
OLD | NEW |