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 4684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4695 break; | 4695 break; |
4696 } | 4696 } |
4697 case VariableDeclaration::Initializer::ZeroInitializerKind: | 4697 case VariableDeclaration::Initializer::ZeroInitializerKind: |
4698 Str << "\t.zero\t" << Init->getNumBytes() << "\n"; | 4698 Str << "\t.zero\t" << Init->getNumBytes() << "\n"; |
4699 break; | 4699 break; |
4700 case VariableDeclaration::Initializer::RelocInitializerKind: { | 4700 case VariableDeclaration::Initializer::RelocInitializerKind: { |
4701 const auto Reloc = | 4701 const auto Reloc = |
4702 llvm::cast<VariableDeclaration::RelocInitializer>(Init); | 4702 llvm::cast<VariableDeclaration::RelocInitializer>(Init); |
4703 Str << "\t.long\t"; | 4703 Str << "\t.long\t"; |
4704 Str << Reloc->getDeclaration()->mangleName(Ctx); | 4704 Str << Reloc->getDeclaration()->mangleName(Ctx); |
4705 if (VariableDeclaration::RelocOffsetType Offset = Reloc->getOffset()) { | 4705 if (RelocOffsetT Offset = Reloc->getOffset()) { |
4706 if (Offset >= 0 || (Offset == INT32_MIN)) | 4706 if (Offset >= 0 || (Offset == INT32_MIN)) |
4707 Str << " + " << Offset; | 4707 Str << " + " << Offset; |
4708 else | 4708 else |
4709 Str << " - " << -Offset; | 4709 Str << " - " << -Offset; |
4710 } | 4710 } |
4711 Str << "\n"; | 4711 Str << "\n"; |
4712 break; | 4712 break; |
4713 } | 4713 } |
4714 default: { | 4714 default: { |
4715 std::string Buffer; | 4715 std::string Buffer; |
4716 llvm::raw_string_ostream StrBuf(Buffer); | 4716 llvm::raw_string_ostream StrBuf(Buffer); |
4717 StrBuf << "Unable to lower initializer: "; | 4717 StrBuf << "Unable to lower initializer: "; |
4718 Init->dump(StrBuf); | 4718 Init->dump(StrBuf); |
4719 llvm::report_fatal_error(StrBuf.str()); | 4719 llvm::report_fatal_error(StrBuf.str()); |
4720 break; | 4720 break; |
4721 } | 4721 } |
4722 } | 4722 } |
4723 } | 4723 } |
4724 } else if (IsConstant || IsExternal) | 4724 } else if (IsConstant || IsExternal) |
4725 Str << "\t.zero\t" << Size << "\n"; | 4725 Str << "\t.zero\t" << Size << "\n"; |
4726 // Size is part of .comm. | 4726 // Size is part of .comm. |
4727 | 4727 |
4728 if (IsConstant || HasNonzeroInitializer || IsExternal) | 4728 if (IsConstant || HasNonzeroInitializer || IsExternal) |
4729 Str << "\t.size\t" << MangledName << ", " << Size << "\n"; | 4729 Str << "\t.size\t" << MangledName << ", " << Size << "\n"; |
4730 // Size is part of .comm. | 4730 // Size is part of .comm. |
4731 } | 4731 } |
4732 | 4732 |
4733 } // end of namespace Ice | 4733 } // end of namespace Ice |
OLD | NEW |