OLD | NEW |
1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering implementation --===// | 1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering 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 skeleton of the TargetLowering class, | 10 // This file implements the skeleton of the TargetLowering class, |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 return TargetX8632::create(Func); | 91 return TargetX8632::create(Func); |
92 #if 0 | 92 #if 0 |
93 if (Target == Target_X8664) | 93 if (Target == Target_X8664) |
94 return IceTargetX8664::create(Func); | 94 return IceTargetX8664::create(Func); |
95 if (Target == Target_ARM32) | 95 if (Target == Target_ARM32) |
96 return IceTargetARM32::create(Func); | 96 return IceTargetARM32::create(Func); |
97 if (Target == Target_ARM64) | 97 if (Target == Target_ARM64) |
98 return IceTargetARM64::create(Func); | 98 return IceTargetARM64::create(Func); |
99 #endif | 99 #endif |
100 Func->setError("Unsupported target"); | 100 Func->setError("Unsupported target"); |
101 return NULL; | 101 return nullptr; |
102 } | 102 } |
103 | 103 |
104 TargetLowering::TargetLowering(Cfg *Func) | 104 TargetLowering::TargetLowering(Cfg *Func) |
105 : Func(Func), Ctx(Func->getContext()), | 105 : Func(Func), Ctx(Func->getContext()), |
106 RandomizeRegisterAllocation(CLRandomizeRegisterAllocation), | 106 RandomizeRegisterAllocation(CLRandomizeRegisterAllocation), |
107 HasComputedFrame(false), CallsReturnsTwice(false), StackAdjustment(0), | 107 HasComputedFrame(false), CallsReturnsTwice(false), StackAdjustment(0), |
108 Context() {} | 108 Context() {} |
109 | 109 |
110 Assembler *TargetLowering::createAssembler(TargetArch Target, Cfg *Func) { | 110 Assembler *TargetLowering::createAssembler(TargetArch Target, Cfg *Func) { |
111 // These statements can be #ifdef'd to specialize the assembler | 111 // These statements can be #ifdef'd to specialize the assembler |
112 // to a subset of the available targets. TODO: use CRTP. | 112 // to a subset of the available targets. TODO: use CRTP. |
113 if (Target == Target_X8632) | 113 if (Target == Target_X8632) |
114 return new x86::AssemblerX86(); | 114 return new x86::AssemblerX86(); |
115 Func->setError("Unsupported target"); | 115 Func->setError("Unsupported target"); |
116 return NULL; | 116 return nullptr; |
117 } | 117 } |
118 | 118 |
119 void TargetLowering::doAddressOpt() { | 119 void TargetLowering::doAddressOpt() { |
120 if (llvm::isa<InstLoad>(*Context.getCur())) | 120 if (llvm::isa<InstLoad>(*Context.getCur())) |
121 doAddressOptLoad(); | 121 doAddressOptLoad(); |
122 else if (llvm::isa<InstStore>(*Context.getCur())) | 122 else if (llvm::isa<InstStore>(*Context.getCur())) |
123 doAddressOptStore(); | 123 doAddressOptStore(); |
124 Context.advanceCur(); | 124 Context.advanceCur(); |
125 Context.advanceNext(); | 125 Context.advanceNext(); |
126 } | 126 } |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 return TargetGlobalInitX8632::create(Ctx); | 260 return TargetGlobalInitX8632::create(Ctx); |
261 #if 0 | 261 #if 0 |
262 if (Target == Target_X8664) | 262 if (Target == Target_X8664) |
263 return IceTargetGlobalInitX8664::create(Ctx); | 263 return IceTargetGlobalInitX8664::create(Ctx); |
264 if (Target == Target_ARM32) | 264 if (Target == Target_ARM32) |
265 return IceTargetGlobalInitARM32::create(Ctx); | 265 return IceTargetGlobalInitARM32::create(Ctx); |
266 if (Target == Target_ARM64) | 266 if (Target == Target_ARM64) |
267 return IceTargetGlobalInitARM64::create(Ctx); | 267 return IceTargetGlobalInitARM64::create(Ctx); |
268 #endif | 268 #endif |
269 llvm_unreachable("Unsupported target"); | 269 llvm_unreachable("Unsupported target"); |
270 return NULL; | 270 return nullptr; |
271 } | 271 } |
272 | 272 |
273 TargetGlobalInitLowering::~TargetGlobalInitLowering() {} | 273 TargetGlobalInitLowering::~TargetGlobalInitLowering() {} |
274 | 274 |
275 } // end of namespace Ice | 275 } // end of namespace Ice |
OLD | NEW |