| 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 6547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6558 Names = nullptr; | 6558 Names = nullptr; |
| 6559 NumNames = 0; | 6559 NumNames = 0; |
| 6560 } | 6560 } |
| 6561 | 6561 |
| 6562 void PNaClTargetInfo::getGCCRegAliases(const GCCRegAlias *&Aliases, | 6562 void PNaClTargetInfo::getGCCRegAliases(const GCCRegAlias *&Aliases, |
| 6563 unsigned &NumAliases) const { | 6563 unsigned &NumAliases) const { |
| 6564 Aliases = nullptr; | 6564 Aliases = nullptr; |
| 6565 NumAliases = 0; | 6565 NumAliases = 0; |
| 6566 } | 6566 } |
| 6567 | 6567 |
| 6568 // We attempt to use PNaCl (le32) frontend and Mips32EL backend. |
| 6569 class NaClMips32ELTargetInfo : public Mips32ELTargetInfo { |
| 6570 public: |
| 6571 NaClMips32ELTargetInfo(const llvm::Triple &Triple) : |
| 6572 Mips32ELTargetInfo(Triple) { |
| 6573 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 0; |
| 6574 } |
| 6575 |
| 6576 BuiltinVaListKind getBuiltinVaListKind() const override { |
| 6577 return TargetInfo::PNaClABIBuiltinVaList; |
| 6578 } |
| 6579 }; |
| 6580 |
| 6568 class Le64TargetInfo : public TargetInfo { | 6581 class Le64TargetInfo : public TargetInfo { |
| 6569 static const Builtin::Info BuiltinInfo[]; | 6582 static const Builtin::Info BuiltinInfo[]; |
| 6570 | 6583 |
| 6571 public: | 6584 public: |
| 6572 Le64TargetInfo(const llvm::Triple &Triple) : TargetInfo(Triple) { | 6585 Le64TargetInfo(const llvm::Triple &Triple) : TargetInfo(Triple) { |
| 6573 BigEndian = false; | 6586 BigEndian = false; |
| 6574 NoAsmVariants = true; | 6587 NoAsmVariants = true; |
| 6575 LongWidth = LongAlign = PointerWidth = PointerAlign = 64; | 6588 LongWidth = LongAlign = PointerWidth = PointerAlign = 64; |
| 6576 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64; | 6589 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64; |
| 6577 DescriptionString = | 6590 DescriptionString = |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6924 switch (os) { | 6937 switch (os) { |
| 6925 case llvm::Triple::Linux: | 6938 case llvm::Triple::Linux: |
| 6926 return new LinuxTargetInfo<Mips32ELTargetInfo>(Triple); | 6939 return new LinuxTargetInfo<Mips32ELTargetInfo>(Triple); |
| 6927 case llvm::Triple::RTEMS: | 6940 case llvm::Triple::RTEMS: |
| 6928 return new RTEMSTargetInfo<Mips32ELTargetInfo>(Triple); | 6941 return new RTEMSTargetInfo<Mips32ELTargetInfo>(Triple); |
| 6929 case llvm::Triple::FreeBSD: | 6942 case llvm::Triple::FreeBSD: |
| 6930 return new FreeBSDTargetInfo<Mips32ELTargetInfo>(Triple); | 6943 return new FreeBSDTargetInfo<Mips32ELTargetInfo>(Triple); |
| 6931 case llvm::Triple::NetBSD: | 6944 case llvm::Triple::NetBSD: |
| 6932 return new NetBSDTargetInfo<Mips32ELTargetInfo>(Triple); | 6945 return new NetBSDTargetInfo<Mips32ELTargetInfo>(Triple); |
| 6933 case llvm::Triple::NaCl: | 6946 case llvm::Triple::NaCl: |
| 6934 return new NaClTargetInfo<Mips32ELTargetInfo>(Triple); | 6947 return new NaClTargetInfo<NaClMips32ELTargetInfo>(Triple); |
| 6935 default: | 6948 default: |
| 6936 return new Mips32ELTargetInfo(Triple); | 6949 return new Mips32ELTargetInfo(Triple); |
| 6937 } | 6950 } |
| 6938 | 6951 |
| 6939 case llvm::Triple::mips64: | 6952 case llvm::Triple::mips64: |
| 6940 switch (os) { | 6953 switch (os) { |
| 6941 case llvm::Triple::Linux: | 6954 case llvm::Triple::Linux: |
| 6942 return new LinuxTargetInfo<Mips64EBTargetInfo>(Triple); | 6955 return new LinuxTargetInfo<Mips64EBTargetInfo>(Triple); |
| 6943 case llvm::Triple::RTEMS: | 6956 case llvm::Triple::RTEMS: |
| 6944 return new RTEMSTargetInfo<Mips64EBTargetInfo>(Triple); | 6957 return new RTEMSTargetInfo<Mips64EBTargetInfo>(Triple); |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7252 // need to pass the minuses. | 7265 // need to pass the minuses. |
| 7253 Opts->Features.clear(); | 7266 Opts->Features.clear(); |
| 7254 for (llvm::StringMap<bool>::const_iterator it = Features.begin(), | 7267 for (llvm::StringMap<bool>::const_iterator it = Features.begin(), |
| 7255 ie = Features.end(); it != ie; ++it) | 7268 ie = Features.end(); it != ie; ++it) |
| 7256 Opts->Features.push_back((it->second ? "+" : "-") + it->first().str()); | 7269 Opts->Features.push_back((it->second ? "+" : "-") + it->first().str()); |
| 7257 if (!Target->handleTargetFeatures(Opts->Features, Diags)) | 7270 if (!Target->handleTargetFeatures(Opts->Features, Diags)) |
| 7258 return nullptr; | 7271 return nullptr; |
| 7259 | 7272 |
| 7260 return Target.release(); | 7273 return Target.release(); |
| 7261 } | 7274 } |
| OLD | NEW |