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