xref: /freebsd/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/ARM.h (revision cfd6422a5217410fbd66f7a7a8a64d9d85e61229)
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 getARMFloatABI(const ToolChain &TC, const llvm::opt::ArgList &Args);
51 FloatABI getARMFloatABI(const Driver &D, const llvm::Triple &Triple,
52                         const llvm::opt::ArgList &Args);
53 ReadTPMode getReadTPMode(const Driver &D, const llvm::opt::ArgList &Args);
54 
55 bool useAAPCSForMachO(const llvm::Triple &T);
56 void getARMArchCPUFromArgs(const llvm::opt::ArgList &Args,
57                            llvm::StringRef &Arch, llvm::StringRef &CPU,
58                            bool FromAs = false);
59 void getARMTargetFeatures(const Driver &D, const llvm::Triple &Triple,
60                           const llvm::opt::ArgList &Args,
61                           llvm::opt::ArgStringList &CmdArgs,
62                           std::vector<llvm::StringRef> &Features, bool ForAS);
63 int getARMSubArchVersionNumber(const llvm::Triple &Triple);
64 bool isARMMProfile(const llvm::Triple &Triple);
65 
66 } // end namespace arm
67 } // end namespace tools
68 } // end namespace driver
69 } // end namespace clang
70 
71 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_ARM_H
72