OLD | NEW |
1 //===- subzero/src/IceCfg.cpp - Control flow graph implementation ---------===// | 1 //===- subzero/src/IceCfg.cpp - Control flow graph implementation ---------===// |
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 implements the Cfg class, including constant pool | 10 // This file implements the Cfg class, including constant pool |
11 // management. | 11 // management. |
12 // | 12 // |
13 //===----------------------------------------------------------------------===// | 13 //===----------------------------------------------------------------------===// |
14 | 14 |
15 #include "IceCfg.h" | 15 #include "IceCfg.h" |
16 #include "IceCfgNode.h" | 16 #include "IceCfgNode.h" |
17 #include "IceClFlags.h" | 17 #include "IceClFlags.h" |
18 #include "IceDefs.h" | 18 #include "IceDefs.h" |
19 #include "IceInst.h" | 19 #include "IceInst.h" |
20 #include "IceLiveness.h" | 20 #include "IceLiveness.h" |
21 #include "IceOperand.h" | 21 #include "IceOperand.h" |
22 #include "IceTargetLowering.h" | 22 #include "IceTargetLowering.h" |
23 | 23 |
24 namespace Ice { | 24 namespace Ice { |
25 | 25 |
26 thread_local const Cfg *Cfg::CurrentCfg = nullptr; | 26 thread_local const Cfg *Cfg::CurrentCfg = nullptr; |
27 | 27 |
28 ArenaAllocator *getCurrentCfgAllocator() { | 28 ArenaAllocator<> *getCurrentCfgAllocator() { |
29 return Cfg::getCurrentCfgAllocator(); | 29 return Cfg::getCurrentCfgAllocator(); |
30 } | 30 } |
31 | 31 |
32 Cfg::Cfg(GlobalContext *Ctx) | 32 Cfg::Cfg(GlobalContext *Ctx) |
33 : Ctx(Ctx), FunctionName(""), ReturnType(IceType_void), | 33 : Ctx(Ctx), FunctionName(""), ReturnType(IceType_void), |
34 IsInternalLinkage(false), HasError(false), FocusedTiming(false), | 34 IsInternalLinkage(false), HasError(false), FocusedTiming(false), |
35 ErrorMessage(""), Entry(nullptr), NextInstNumber(Inst::NumberInitial), | 35 ErrorMessage(""), Entry(nullptr), NextInstNumber(Inst::NumberInitial), |
36 Allocator(new ArenaAllocator()), Live(nullptr), | 36 Allocator(new ArenaAllocator<>()), Live(nullptr), |
37 Target(TargetLowering::createLowering(Ctx->getTargetArch(), this)), | 37 Target(TargetLowering::createLowering(Ctx->getTargetArch(), this)), |
38 VMetadata(new VariablesMetadata(this)), | 38 VMetadata(new VariablesMetadata(this)), |
39 TargetAssembler( | 39 TargetAssembler( |
40 TargetLowering::createAssembler(Ctx->getTargetArch(), this)), | 40 TargetLowering::createAssembler(Ctx->getTargetArch(), this)), |
41 CurrentNode(nullptr) { | 41 CurrentNode(nullptr) { |
42 assert(!Ctx->isIRGenerationDisabled() && | 42 assert(!Ctx->isIRGenerationDisabled() && |
43 "Attempt to build cfg when IR generation disabled"); | 43 "Attempt to build cfg when IR generation disabled"); |
44 } | 44 } |
45 | 45 |
46 Cfg::~Cfg() { | 46 Cfg::~Cfg() { |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 } | 507 } |
508 } | 508 } |
509 // Print each basic block | 509 // Print each basic block |
510 for (CfgNode *Node : Nodes) | 510 for (CfgNode *Node : Nodes) |
511 Node->dump(this); | 511 Node->dump(this); |
512 if (getContext()->isVerbose(IceV_Instructions)) | 512 if (getContext()->isVerbose(IceV_Instructions)) |
513 Str << "}\n"; | 513 Str << "}\n"; |
514 } | 514 } |
515 | 515 |
516 } // end of namespace Ice | 516 } // end of namespace Ice |
OLD | NEW |