| OLD | NEW |
| 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// | 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// |
| 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 TargetLoweringX8632 class, which | 10 // This file implements the TargetLoweringX8632 class, which |
| (...skipping 4546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4557 } | 4557 } |
| 4558 | 4558 |
| 4559 void ConstantUndef::emit(GlobalContext *) const { | 4559 void ConstantUndef::emit(GlobalContext *) const { |
| 4560 llvm_unreachable("undef value encountered by emitter."); | 4560 llvm_unreachable("undef value encountered by emitter."); |
| 4561 } | 4561 } |
| 4562 | 4562 |
| 4563 TargetGlobalInitX8632::TargetGlobalInitX8632(GlobalContext *Ctx) | 4563 TargetGlobalInitX8632::TargetGlobalInitX8632(GlobalContext *Ctx) |
| 4564 : TargetGlobalInitLowering(Ctx) {} | 4564 : TargetGlobalInitLowering(Ctx) {} |
| 4565 | 4565 |
| 4566 void TargetGlobalInitX8632::lower(const VariableDeclaration &Var) { | 4566 void TargetGlobalInitX8632::lower(const VariableDeclaration &Var) { |
| 4567 // TODO(jvoung): handle this without text. |
| 4568 if (Ctx->getFlags().UseELFWriter) |
| 4569 return; |
| 4567 | 4570 |
| 4568 Ostream &Str = Ctx->getStrEmit(); | 4571 Ostream &Str = Ctx->getStrEmit(); |
| 4569 | 4572 |
| 4570 const VariableDeclaration::InitializerListType &Initializers = | 4573 const VariableDeclaration::InitializerListType &Initializers = |
| 4571 Var.getInitializers(); | 4574 Var.getInitializers(); |
| 4572 | 4575 |
| 4573 // If external and not initialized, this must be a cross test. | 4576 // If external and not initialized, this must be a cross test. |
| 4574 // Don't generate a declaration for such cases. | 4577 // Don't generate a declaration for such cases. |
| 4575 bool IsExternal = Var.isExternal() || Ctx->getFlags().DisableInternal; | 4578 bool IsExternal = Var.isExternal() || Ctx->getFlags().DisableInternal; |
| 4576 if (IsExternal && !Var.hasInitializer()) return; | 4579 if (IsExternal && !Var.hasInitializer()) return; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4650 } else if (IsConstant || IsExternal) | 4653 } else if (IsConstant || IsExternal) |
| 4651 Str << "\t.zero\t" << Size << "\n"; | 4654 Str << "\t.zero\t" << Size << "\n"; |
| 4652 // Size is part of .comm. | 4655 // Size is part of .comm. |
| 4653 | 4656 |
| 4654 if (IsConstant || HasNonzeroInitializer || IsExternal) | 4657 if (IsConstant || HasNonzeroInitializer || IsExternal) |
| 4655 Str << "\t.size\t" << MangledName << ", " << Size << "\n"; | 4658 Str << "\t.size\t" << MangledName << ", " << Size << "\n"; |
| 4656 // Size is part of .comm. | 4659 // Size is part of .comm. |
| 4657 } | 4660 } |
| 4658 | 4661 |
| 4659 } // end of namespace Ice | 4662 } // end of namespace Ice |
| OLD | NEW |