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 |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 namespace Ice { | 26 namespace Ice { |
27 | 27 |
28 ICE_TLS_DEFINE_FIELD(const Cfg *, Cfg, CurrentCfg); | 28 ICE_TLS_DEFINE_FIELD(const Cfg *, Cfg, CurrentCfg); |
29 | 29 |
30 ArenaAllocator<> *getCurrentCfgAllocator() { | 30 ArenaAllocator<> *getCurrentCfgAllocator() { |
31 return Cfg::getCurrentCfgAllocator(); | 31 return Cfg::getCurrentCfgAllocator(); |
32 } | 32 } |
33 | 33 |
34 Cfg::Cfg(GlobalContext *Ctx, uint32_t SequenceNumber) | 34 Cfg::Cfg(GlobalContext *Ctx, uint32_t SequenceNumber) |
35 : Ctx(Ctx), SequenceNumber(SequenceNumber), VMask(Ctx->getVerbose()), | 35 : Ctx(Ctx), SequenceNumber(SequenceNumber), |
36 FunctionName(""), ReturnType(IceType_void), IsInternalLinkage(false), | 36 VMask(Ctx->getFlags().getVerbose()), FunctionName(""), |
37 HasError(false), FocusedTiming(false), ErrorMessage(""), Entry(nullptr), | 37 ReturnType(IceType_void), IsInternalLinkage(false), HasError(false), |
| 38 FocusedTiming(false), ErrorMessage(""), Entry(nullptr), |
38 NextInstNumber(Inst::NumberInitial), Allocator(new ArenaAllocator<>()), | 39 NextInstNumber(Inst::NumberInitial), Allocator(new ArenaAllocator<>()), |
39 Live(nullptr), | 40 Live(nullptr), Target(TargetLowering::createLowering( |
40 Target(TargetLowering::createLowering(Ctx->getTargetArch(), this)), | 41 Ctx->getFlags().getTargetArch(), this)), |
41 VMetadata(new VariablesMetadata(this)), | 42 VMetadata(new VariablesMetadata(this)), |
42 TargetAssembler( | 43 TargetAssembler(TargetLowering::createAssembler( |
43 TargetLowering::createAssembler(Ctx->getTargetArch(), this)), | 44 Ctx->getFlags().getTargetArch(), this)), |
44 CurrentNode(nullptr) { | 45 CurrentNode(nullptr) { |
45 assert(!Ctx->isIRGenerationDisabled() && | 46 assert(!Ctx->isIRGenerationDisabled() && |
46 "Attempt to build cfg when IR generation disabled"); | 47 "Attempt to build cfg when IR generation disabled"); |
47 } | 48 } |
48 | 49 |
49 Cfg::~Cfg() { assert(ICE_TLS_GET_FIELD(CurrentCfg) == nullptr); } | 50 Cfg::~Cfg() { assert(ICE_TLS_GET_FIELD(CurrentCfg) == nullptr); } |
50 | 51 |
51 void Cfg::setError(const IceString &Message) { | 52 void Cfg::setError(const IceString &Message) { |
52 HasError = true; | 53 HasError = true; |
53 ErrorMessage = Message; | 54 ErrorMessage = Message; |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 } | 509 } |
509 } | 510 } |
510 // Print each basic block | 511 // Print each basic block |
511 for (CfgNode *Node : Nodes) | 512 for (CfgNode *Node : Nodes) |
512 Node->dump(this); | 513 Node->dump(this); |
513 if (isVerbose(IceV_Instructions)) | 514 if (isVerbose(IceV_Instructions)) |
514 Str << "}\n"; | 515 Str << "}\n"; |
515 } | 516 } |
516 | 517 |
517 } // end of namespace Ice | 518 } // end of namespace Ice |
OLD | NEW |