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 /// \file | 10 /// \file |
(...skipping 24 matching lines...) Expand all Loading... |
35 return Cfg::getCurrentCfgAllocator(); | 35 return Cfg::getCurrentCfgAllocator(); |
36 } | 36 } |
37 | 37 |
38 Cfg::Cfg(GlobalContext *Ctx, uint32_t SequenceNumber) | 38 Cfg::Cfg(GlobalContext *Ctx, uint32_t SequenceNumber) |
39 : Ctx(Ctx), SequenceNumber(SequenceNumber), | 39 : Ctx(Ctx), SequenceNumber(SequenceNumber), |
40 VMask(Ctx->getFlags().getVerbose()), NextInstNumber(Inst::NumberInitial), | 40 VMask(Ctx->getFlags().getVerbose()), NextInstNumber(Inst::NumberInitial), |
41 Allocator(new ArenaAllocator<>()), Live(nullptr), | 41 Allocator(new ArenaAllocator<>()), Live(nullptr), |
42 Target(TargetLowering::createLowering(Ctx->getFlags().getTargetArch(), | 42 Target(TargetLowering::createLowering(Ctx->getFlags().getTargetArch(), |
43 this)), | 43 this)), |
44 VMetadata(new VariablesMetadata(this)), | 44 VMetadata(new VariablesMetadata(this)), |
45 TargetAssembler(TargetLowering::createAssembler( | 45 TargetAssembler(Target->createAssembler()) { |
46 Ctx->getFlags().getTargetArch(), this)) { | |
47 if (Ctx->getFlags().getRandomizeAndPoolImmediatesOption() == RPI_Randomize) { | 46 if (Ctx->getFlags().getRandomizeAndPoolImmediatesOption() == RPI_Randomize) { |
48 // If -randomize-pool-immediates=randomize, create a random number | 47 // If -randomize-pool-immediates=randomize, create a random number |
49 // generator to generate a cookie for constant blinding. | 48 // generator to generate a cookie for constant blinding. |
50 RandomNumberGenerator RNG(Ctx->getFlags().getRandomSeed(), | 49 RandomNumberGenerator RNG(Ctx->getFlags().getRandomSeed(), |
51 RPE_ConstantBlinding, this->SequenceNumber); | 50 RPE_ConstantBlinding, this->SequenceNumber); |
52 ConstantBlindingCookie = | 51 ConstantBlindingCookie = |
53 (uint32_t)RNG.next((uint64_t)std::numeric_limits<uint32_t>::max() + 1); | 52 (uint32_t)RNG.next((uint64_t)std::numeric_limits<uint32_t>::max() + 1); |
54 } | 53 } |
55 } | 54 } |
56 | 55 |
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 } | 1095 } |
1097 } | 1096 } |
1098 // Print each basic block | 1097 // Print each basic block |
1099 for (CfgNode *Node : Nodes) | 1098 for (CfgNode *Node : Nodes) |
1100 Node->dump(this); | 1099 Node->dump(this); |
1101 if (isVerbose(IceV_Instructions)) | 1100 if (isVerbose(IceV_Instructions)) |
1102 Str << "}\n"; | 1101 Str << "}\n"; |
1103 } | 1102 } |
1104 | 1103 |
1105 } // end of namespace Ice | 1104 } // end of namespace Ice |
OLD | NEW |