| 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 4433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4444 | 4444 |
| 4445 void TargetGlobalInitX8632::lower(const VariableDeclaration &Var) { | 4445 void TargetGlobalInitX8632::lower(const VariableDeclaration &Var) { |
| 4446 | 4446 |
| 4447 Ostream &Str = Ctx->getStrEmit(); | 4447 Ostream &Str = Ctx->getStrEmit(); |
| 4448 | 4448 |
| 4449 const VariableDeclaration::InitializerListType &Initializers = | 4449 const VariableDeclaration::InitializerListType &Initializers = |
| 4450 Var.getInitializers(); | 4450 Var.getInitializers(); |
| 4451 | 4451 |
| 4452 // If external and not initialized, this must be a cross test. | 4452 // If external and not initialized, this must be a cross test. |
| 4453 // Don't generate a declaration for such cases. | 4453 // Don't generate a declaration for such cases. |
| 4454 bool IsExternal = Var.isExternal(); | 4454 bool IsExternal = Var.isExternal() || Ctx->getFlags().DisableInternal; |
| 4455 if (IsExternal && !Var.hasInitializer()) return; | 4455 if (IsExternal && !Var.hasInitializer()) return; |
| 4456 | 4456 |
| 4457 bool HasNonzeroInitializer = Var.hasNonzeroInitializer(); | 4457 bool HasNonzeroInitializer = Var.hasNonzeroInitializer(); |
| 4458 bool IsConstant = Var.getIsConstant(); | 4458 bool IsConstant = Var.getIsConstant(); |
| 4459 uint32_t Align = Var.getAlignment(); | 4459 uint32_t Align = Var.getAlignment(); |
| 4460 SizeT Size = Var.getNumBytes(); | 4460 SizeT Size = Var.getNumBytes(); |
| 4461 IceString MangledName = Var.mangleName(Ctx); | 4461 IceString MangledName = Var.mangleName(Ctx); |
| 4462 IceString SectionSuffix = ""; | 4462 IceString SectionSuffix = ""; |
| 4463 if (Ctx->getFlags().DataSections) | 4463 if (Ctx->getFlags().DataSections) |
| 4464 SectionSuffix = "." + MangledName; | 4464 SectionSuffix = "." + MangledName; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4529 } else if (IsConstant || IsExternal) | 4529 } else if (IsConstant || IsExternal) |
| 4530 Str << "\t.zero\t" << Size << "\n"; | 4530 Str << "\t.zero\t" << Size << "\n"; |
| 4531 // Size is part of .comm. | 4531 // Size is part of .comm. |
| 4532 | 4532 |
| 4533 if (IsConstant || HasNonzeroInitializer || IsExternal) | 4533 if (IsConstant || HasNonzeroInitializer || IsExternal) |
| 4534 Str << "\t.size\t" << MangledName << ", " << Size << "\n"; | 4534 Str << "\t.size\t" << MangledName << ", " << Size << "\n"; |
| 4535 // Size is part of .comm. | 4535 // Size is part of .comm. |
| 4536 } | 4536 } |
| 4537 | 4537 |
| 4538 } // end of namespace Ice | 4538 } // end of namespace Ice |
| OLD | NEW |