| 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 3502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3513 case 'd': | 3513 case 'd': |
| 3514 case 'S': | 3514 case 'S': |
| 3515 case 'D': | 3515 case 'D': |
| 3516 return Size <= 32; | 3516 return Size <= 32; |
| 3517 case 'A': | 3517 case 'A': |
| 3518 return Size <= 64; | 3518 return Size <= 64; |
| 3519 } | 3519 } |
| 3520 | 3520 |
| 3521 return X86TargetInfo::validateOperandSize(Constraint, Size); | 3521 return X86TargetInfo::validateOperandSize(Constraint, Size); |
| 3522 } | 3522 } |
| 3523 |
| 3523 // @LOCALMOD-START | 3524 // @LOCALMOD-START |
| 3524 bool handleTargetFeatures(std::vector<std::string> &Features, | 3525 bool handleLLVMArgs(std::vector<std::string> &Args) override { |
| 3525 DiagnosticsEngine &Diags) override { | |
| 3526 HasAlignedDouble = false; | 3526 HasAlignedDouble = false; |
| 3527 auto it = std::find(Features.begin(), Features.end(), "+align-double"); | 3527 auto it = std::find(Args.begin(), Args.end(), "-malign-double"); |
| 3528 if (it != Features.end()) { | 3528 if (it != Args.end()) { |
| 3529 HasAlignedDouble = true; | 3529 HasAlignedDouble = true; |
| 3530 Features.erase(it); | |
| 3531 } | 3530 } |
| 3532 | |
| 3533 setDescriptionString(); | 3531 setDescriptionString(); |
| 3534 | 3532 return true; |
| 3535 return X86TargetInfo::handleTargetFeatures(Features, Diags); | |
| 3536 } | 3533 } |
| 3537 // @LOCALMOD-END | 3534 // @LOCALMOD-END |
| 3538 }; | 3535 }; |
| 3539 | 3536 |
| 3540 class NetBSDI386TargetInfo : public NetBSDTargetInfo<X86_32TargetInfo> { | 3537 class NetBSDI386TargetInfo : public NetBSDTargetInfo<X86_32TargetInfo> { |
| 3541 public: | 3538 public: |
| 3542 NetBSDI386TargetInfo(const llvm::Triple &Triple) | 3539 NetBSDI386TargetInfo(const llvm::Triple &Triple) |
| 3543 : NetBSDTargetInfo<X86_32TargetInfo>(Triple) {} | 3540 : NetBSDTargetInfo<X86_32TargetInfo>(Triple) {} |
| 3544 | 3541 |
| 3545 unsigned getFloatEvalMethod() const override { | 3542 unsigned getFloatEvalMethod() const override { |
| (...skipping 3752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7298 // | 7295 // |
| 7299 // FIXME: If we are completely confident that we have the right set, we only | 7296 // FIXME: If we are completely confident that we have the right set, we only |
| 7300 // need to pass the minuses. | 7297 // need to pass the minuses. |
| 7301 Opts->Features.clear(); | 7298 Opts->Features.clear(); |
| 7302 for (llvm::StringMap<bool>::const_iterator it = Features.begin(), | 7299 for (llvm::StringMap<bool>::const_iterator it = Features.begin(), |
| 7303 ie = Features.end(); it != ie; ++it) | 7300 ie = Features.end(); it != ie; ++it) |
| 7304 Opts->Features.push_back((it->second ? "+" : "-") + it->first().str()); | 7301 Opts->Features.push_back((it->second ? "+" : "-") + it->first().str()); |
| 7305 if (!Target->handleTargetFeatures(Opts->Features, Diags)) | 7302 if (!Target->handleTargetFeatures(Opts->Features, Diags)) |
| 7306 return nullptr; | 7303 return nullptr; |
| 7307 | 7304 |
| 7305 // @LOCALMOD-START |
| 7306 if (!Target->handleLLVMArgs(Opts->LLVMArgs)) |
| 7307 return nullptr; |
| 7308 // @LOCALMOD-END |
| 7309 |
| 7308 return Target.release(); | 7310 return Target.release(); |
| 7309 } | 7311 } |
| OLD | NEW |