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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 RegSetMask RegExclude = RegSet_None; | 245 RegSetMask RegExclude = RegSet_None; |
246 RegInclude |= RegSet_CallerSave; | 246 RegInclude |= RegSet_CallerSave; |
247 RegInclude |= RegSet_CalleeSave; | 247 RegInclude |= RegSet_CalleeSave; |
248 if (hasFramePointer()) | 248 if (hasFramePointer()) |
249 RegExclude |= RegSet_FramePointer; | 249 RegExclude |= RegSet_FramePointer; |
250 LinearScan.init(Kind); | 250 LinearScan.init(Kind); |
251 llvm::SmallBitVector RegMask = getRegisterSet(RegInclude, RegExclude); | 251 llvm::SmallBitVector RegMask = getRegisterSet(RegInclude, RegExclude); |
252 LinearScan.scan(RegMask, RandomizeRegisterAllocation); | 252 LinearScan.scan(RegMask, RandomizeRegisterAllocation); |
253 } | 253 } |
254 | 254 |
255 TargetDataLowering *TargetDataLowering::createLowering(GlobalContext *Ctx) { | 255 std::unique_ptr<TargetDataLowering> |
| 256 TargetDataLowering::createLowering(GlobalContext *Ctx) { |
256 // These statements can be #ifdef'd to specialize the code generator | 257 // These statements can be #ifdef'd to specialize the code generator |
257 // to a subset of the available targets. TODO: use CRTP. | 258 // to a subset of the available targets. TODO: use CRTP. |
258 TargetArch Target = Ctx->getTargetArch(); | 259 TargetArch Target = Ctx->getTargetArch(); |
259 if (Target == Target_X8632) | 260 if (Target == Target_X8632) |
260 return TargetDataX8632::create(Ctx); | 261 return std::unique_ptr<TargetDataLowering>(TargetDataX8632::create(Ctx)); |
261 #if 0 | 262 #if 0 |
262 if (Target == Target_X8664) | 263 if (Target == Target_X8664) |
263 return TargetDataX8664::create(Ctx); | 264 return std::unique_ptr<TargetDataLowering>(TargetDataX8664::create(Ctx)); |
264 if (Target == Target_ARM32) | 265 if (Target == Target_ARM32) |
265 return TargetDataARM32::create(Ctx); | 266 return std::unique_ptr<TargetDataLowering>(TargetDataARM32::create(Ctx)); |
266 if (Target == Target_ARM64) | 267 if (Target == Target_ARM64) |
267 return TargetDataARM64::create(Ctx); | 268 return std::unique_ptr<TargetDataLowering>(TargetDataARM64::create(Ctx)); |
268 #endif | 269 #endif |
269 llvm_unreachable("Unsupported target"); | 270 llvm_unreachable("Unsupported target"); |
270 return nullptr; | 271 return nullptr; |
271 } | 272 } |
272 | 273 |
273 TargetDataLowering::~TargetDataLowering() {} | 274 TargetDataLowering::~TargetDataLowering() {} |
274 | 275 |
275 } // end of namespace Ice | 276 } // end of namespace Ice |
OLD | NEW |