OLD | NEW |
1 //===--- Targets.cpp - Implement -arch option and targets -----------------===// | 1 //===--- Targets.cpp - Implement -arch option and targets -----------------===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
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 construction of a TargetInfo object from a | 10 // This file implements construction of a TargetInfo object from a |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 this->LongDoubleWidth = 64; | 651 this->LongDoubleWidth = 64; |
652 this->LongDoubleAlign = 64; | 652 this->LongDoubleAlign = 64; |
653 this->LongLongWidth = 64; | 653 this->LongLongWidth = 64; |
654 this->LongLongAlign = 64; | 654 this->LongLongAlign = 64; |
655 this->SizeType = TargetInfo::UnsignedInt; | 655 this->SizeType = TargetInfo::UnsignedInt; |
656 this->PtrDiffType = TargetInfo::SignedInt; | 656 this->PtrDiffType = TargetInfo::SignedInt; |
657 this->IntPtrType = TargetInfo::SignedInt; | 657 this->IntPtrType = TargetInfo::SignedInt; |
658 // RegParmMax is inherited from the underlying architecture | 658 // RegParmMax is inherited from the underlying architecture |
659 this->LongDoubleFormat = &llvm::APFloat::IEEEdouble; | 659 this->LongDoubleFormat = &llvm::APFloat::IEEEdouble; |
660 if (Triple.getArch() == llvm::Triple::arm) { | 660 if (Triple.getArch() == llvm::Triple::arm) { |
661 this->DescriptionString = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S128"; | 661 // @LOCALMOD |
| 662 // Handled in ARM's setABI(). |
662 } else if (Triple.getArch() == llvm::Triple::x86) { | 663 } else if (Triple.getArch() == llvm::Triple::x86) { |
663 this->DescriptionString = "e-m:e-p:32:32-i64:64-f80:32-n8:16:32-S128"; | 664 this->DescriptionString = "e-m:e-p:32:32-i64:64-f80:32-n8:16:32-S128"; |
664 } else if (Triple.getArch() == llvm::Triple::x86_64) { | 665 } else if (Triple.getArch() == llvm::Triple::x86_64) { |
665 this->DescriptionString = "e-m:e-p:32:32-i64:64-f80:128-n8:16:32:64-S128"; | 666 this->DescriptionString = "e-m:e-p:32:32-i64:64-f80:128-n8:16:32:64-S128"; |
666 } else if (Triple.getArch() == llvm::Triple::mipsel) { | 667 } else if (Triple.getArch() == llvm::Triple::mipsel) { |
667 // Handled on mips' setDescriptionString. | 668 // Handled on mips' setDescriptionString. |
668 } else { | 669 } else { |
669 assert(Triple.getArch() == llvm::Triple::le32); | 670 assert(Triple.getArch() == llvm::Triple::le32); |
670 this->DescriptionString = "e-p:32:32-i64:64"; | 671 this->DescriptionString = "e-p:32:32-i64:64"; |
671 } | 672 } |
(...skipping 2908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3580 "E-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:64-" | 3581 "E-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:64-" |
3581 "v128:64:128-a:0:32-n32-S64" : | 3582 "v128:64:128-a:0:32-n32-S64" : |
3582 "e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:64-" | 3583 "e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:64-" |
3583 "v128:64:128-a:0:32-n32-S64"; | 3584 "v128:64:128-a:0:32-n32-S64"; |
3584 } | 3585 } |
3585 } else { | 3586 } else { |
3586 if (T.isOSBinFormatMachO()) | 3587 if (T.isOSBinFormatMachO()) |
3587 DescriptionString = BigEndian ? | 3588 DescriptionString = BigEndian ? |
3588 "E-m:o-p:32:32-i64:64-v128:64:128-n32-S64" : | 3589 "E-m:o-p:32:32-i64:64-v128:64:128-n32-S64" : |
3589 "e-m:o-p:32:32-i64:64-v128:64:128-n32-S64"; | 3590 "e-m:o-p:32:32-i64:64-v128:64:128-n32-S64"; |
3590 else | 3591 // @LOCALMOD-BEGIN |
| 3592 else if (T.isOSNaCl()) { |
| 3593 assert(!BigEndian && "NaCl on ARM does not support big endian"); |
| 3594 DescriptionString = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S128"; |
| 3595 } else |
| 3596 // @LOCALMOD-END |
3591 DescriptionString = BigEndian ? | 3597 DescriptionString = BigEndian ? |
3592 "E-m:e-p:32:32-i64:64-v128:64:128-n32-S64" : | 3598 "E-m:e-p:32:32-i64:64-v128:64:128-n32-S64" : |
3593 "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"; | 3599 "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"; |
3594 } | 3600 } |
3595 | 3601 |
3596 // FIXME: Enumerated types are variable width in straight AAPCS. | 3602 // FIXME: Enumerated types are variable width in straight AAPCS. |
3597 } | 3603 } |
3598 | 3604 |
3599 void setABIAPCS() { | 3605 void setABIAPCS() { |
3600 const llvm::Triple &T = getTriple(); | 3606 const llvm::Triple &T = getTriple(); |
(...skipping 2836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6437 // need to pass the minuses. | 6443 // need to pass the minuses. |
6438 Opts->Features.clear(); | 6444 Opts->Features.clear(); |
6439 for (llvm::StringMap<bool>::const_iterator it = Features.begin(), | 6445 for (llvm::StringMap<bool>::const_iterator it = Features.begin(), |
6440 ie = Features.end(); it != ie; ++it) | 6446 ie = Features.end(); it != ie; ++it) |
6441 Opts->Features.push_back((it->second ? "+" : "-") + it->first().str()); | 6447 Opts->Features.push_back((it->second ? "+" : "-") + it->first().str()); |
6442 if (!Target->handleTargetFeatures(Opts->Features, Diags)) | 6448 if (!Target->handleTargetFeatures(Opts->Features, Diags)) |
6443 return nullptr; | 6449 return nullptr; |
6444 | 6450 |
6445 return Target.release(); | 6451 return Target.release(); |
6446 } | 6452 } |
OLD | NEW |