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

Side by Side Diff: src/IceCfg.h

Issue 837553009: Make fixups reference any constant (allow const float/double pool literals). (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: go back to one arenaallocator type alias Created 5 years, 11 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 | « no previous file | 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
(...skipping 25 matching lines...) Expand all
36 // it through the callers, to make ownership and lifetime and 36 // it through the callers, to make ownership and lifetime and
37 // destruction requirements more explicit. 37 // destruction requirements more explicit.
38 static Cfg *create(GlobalContext *Ctx) { 38 static Cfg *create(GlobalContext *Ctx) {
39 Cfg *Func = new Cfg(Ctx); 39 Cfg *Func = new Cfg(Ctx);
40 CurrentCfg = Func; 40 CurrentCfg = Func;
41 return Func; 41 return Func;
42 } 42 }
43 // Gets a pointer to the current thread's Cfg. 43 // Gets a pointer to the current thread's Cfg.
44 static const Cfg *getCurrentCfg() { return CurrentCfg; } 44 static const Cfg *getCurrentCfg() { return CurrentCfg; }
45 // Gets a pointer to the current thread's Cfg's allocator. 45 // Gets a pointer to the current thread's Cfg's allocator.
46 static ArenaAllocator *getCurrentCfgAllocator() { 46 static ArenaAllocator<> *getCurrentCfgAllocator() {
47 assert(CurrentCfg); 47 assert(CurrentCfg);
48 return CurrentCfg->Allocator.get(); 48 return CurrentCfg->Allocator.get();
49 } 49 }
50 50
51 GlobalContext *getContext() const { return Ctx; } 51 GlobalContext *getContext() const { return Ctx; }
52 52
53 // Manage the name and return type of the function being translated. 53 // Manage the name and return type of the function being translated.
54 void setFunctionName(const IceString &Name) { FunctionName = Name; } 54 void setFunctionName(const IceString &Name) { FunctionName = Name; }
55 IceString getFunctionName() const { return FunctionName; } 55 IceString getFunctionName() const { return FunctionName; }
56 void setReturnType(Type Ty) { ReturnType = Ty; } 56 void setReturnType(Type Ty) { ReturnType = Ty; }
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 bool HasError; 190 bool HasError;
191 bool FocusedTiming; 191 bool FocusedTiming;
192 IceString ErrorMessage; 192 IceString ErrorMessage;
193 CfgNode *Entry; // entry basic block 193 CfgNode *Entry; // entry basic block
194 NodeList Nodes; // linearized node list; Entry should be first 194 NodeList Nodes; // linearized node list; Entry should be first
195 std::vector<IceString> IdentifierNames; 195 std::vector<IceString> IdentifierNames;
196 InstNumberT NextInstNumber; 196 InstNumberT NextInstNumber;
197 VarList Variables; 197 VarList Variables;
198 VarList Args; // subset of Variables, in argument order 198 VarList Args; // subset of Variables, in argument order
199 VarList ImplicitArgs; // subset of Variables 199 VarList ImplicitArgs; // subset of Variables
200 std::unique_ptr<ArenaAllocator> Allocator; 200 std::unique_ptr<ArenaAllocator<>> Allocator;
201 std::unique_ptr<Liveness> Live; 201 std::unique_ptr<Liveness> Live;
202 std::unique_ptr<TargetLowering> Target; 202 std::unique_ptr<TargetLowering> Target;
203 std::unique_ptr<VariablesMetadata> VMetadata; 203 std::unique_ptr<VariablesMetadata> VMetadata;
204 std::unique_ptr<Assembler> TargetAssembler; 204 std::unique_ptr<Assembler> TargetAssembler;
205 205
206 // CurrentNode is maintained during dumping/emitting just for 206 // CurrentNode is maintained during dumping/emitting just for
207 // validating Variable::DefNode. Normally, a traversal over 207 // validating Variable::DefNode. Normally, a traversal over
208 // CfgNodes maintains this, but before global operations like 208 // CfgNodes maintains this, but before global operations like
209 // register allocation, resetCurrentNode() should be called to avoid 209 // register allocation, resetCurrentNode() should be called to avoid
210 // spurious validation failures. 210 // spurious validation failures.
211 const CfgNode *CurrentNode; 211 const CfgNode *CurrentNode;
212 212
213 // Maintain a pointer in TLS to the current Cfg being translated. 213 // Maintain a pointer in TLS to the current Cfg being translated.
214 // This is primarily for accessing its allocator statelessly, but 214 // This is primarily for accessing its allocator statelessly, but
215 // other uses are possible. 215 // other uses are possible.
216 thread_local static const Cfg *CurrentCfg; 216 thread_local static const Cfg *CurrentCfg;
217 }; 217 };
218 218
219 } // end of namespace Ice 219 } // end of namespace Ice
220 220
221 #endif // SUBZERO_SRC_ICECFG_H 221 #endif // SUBZERO_SRC_ICECFG_H
OLDNEW
« no previous file with comments | « no previous file | src/IceCfg.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698