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