1 //===--- ARM.h - ARM-specific (not AArch64) Tool Helpers --------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_ARM_H 10 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_ARM_H 11 12 #include "clang/Driver/ToolChain.h" 13 #include "llvm/ADT/StringRef.h" 14 #include "llvm/ADT/Triple.h" 15 #include "llvm/Option/Option.h" 16 #include "llvm/Support/TargetParser.h" 17 #include <string> 18 #include <vector> 19 20 namespace clang { 21 namespace driver { 22 namespace tools { 23 namespace arm { 24 25 std::string getARMTargetCPU(StringRef CPU, llvm::StringRef Arch, 26 const llvm::Triple &Triple); 27 const std::string getARMArch(llvm::StringRef Arch, const llvm::Triple &Triple); 28 StringRef getARMCPUForMArch(llvm::StringRef Arch, const llvm::Triple &Triple); 29 llvm::ARM::ArchKind getLLVMArchKindForARM(StringRef CPU, StringRef Arch, 30 const llvm::Triple &Triple); 31 StringRef getLLVMArchSuffixForARM(llvm::StringRef CPU, llvm::StringRef Arch, 32 const llvm::Triple &Triple); 33 34 void appendBE8LinkFlag(const llvm::opt::ArgList &Args, 35 llvm::opt::ArgStringList &CmdArgs, 36 const llvm::Triple &Triple); 37 enum class ReadTPMode { 38 Invalid, 39 Soft, 40 Cp15, 41 }; 42 43 enum class FloatABI { 44 Invalid, 45 Soft, 46 SoftFP, 47 Hard, 48 }; 49 50 FloatABI getDefaultFloatABI(const llvm::Triple &Triple); 51 FloatABI getARMFloatABI(const ToolChain &TC, const llvm::opt::ArgList &Args); 52 FloatABI getARMFloatABI(const Driver &D, const llvm::Triple &Triple, 53 const llvm::opt::ArgList &Args); 54 void setFloatABIInTriple(const Driver &D, const llvm::opt::ArgList &Args, 55 llvm::Triple &triple); 56 ReadTPMode getReadTPMode(const Driver &D, const llvm::opt::ArgList &Args); 57 void setArchNameInTriple(const Driver &D, const llvm::opt::ArgList &Args, 58 types::ID InputType, llvm::Triple &Triple); 59 60 bool useAAPCSForMachO(const llvm::Triple &T); 61 void getARMArchCPUFromArgs(const llvm::opt::ArgList &Args, 62 llvm::StringRef &Arch, llvm::StringRef &CPU, 63 bool FromAs = false); 64 void getARMTargetFeatures(const Driver &D, const llvm::Triple &Triple, 65 const llvm::opt::ArgList &Args, 66 llvm::opt::ArgStringList &CmdArgs, 67 std::vector<llvm::StringRef> &Features, bool ForAS); 68 int getARMSubArchVersionNumber(const llvm::Triple &Triple); 69 bool isARMMProfile(const llvm::Triple &Triple); 70 bool isARMAProfile(const llvm::Triple &Triple); 71 72 } // end namespace arm 73 } // end namespace tools 74 } // end namespace driver 75 } // end namespace clang 76 77 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_ARM_H 78