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/Option/ArgList.h"
15#include "llvm/Option/Option.h"
16#include "llvm/TargetParser/ARMTargetParser.h"
17#include "llvm/TargetParser/Triple.h"
18#include <string>
19#include <vector>
20
21namespace clang {
22namespace driver {
23namespace tools {
24namespace arm {
25
26std::string getARMTargetCPU(StringRef CPU, llvm::StringRef Arch,
27 const llvm::Triple &Triple);
28std::string getARMArch(llvm::StringRef Arch, const llvm::Triple &Triple);
29StringRef getARMCPUForMArch(llvm::StringRef Arch, const llvm::Triple &Triple);
30llvm::ARM::ArchKind getLLVMArchKindForARM(StringRef CPU, StringRef Arch,
31 const llvm::Triple &Triple);
32StringRef getLLVMArchSuffixForARM(llvm::StringRef CPU, llvm::StringRef Arch,
33 const llvm::Triple &Triple);
34
35void appendBE8LinkFlag(const llvm::opt::ArgList &Args,
36 llvm::opt::ArgStringList &CmdArgs,
37 const llvm::Triple &Triple);
38enum class ReadTPMode {
39 Invalid,
40 Soft,
41 TPIDRURW,
42 TPIDRURO,
43 TPIDRPRW,
44};
45
46enum class FloatABI {
47 Invalid,
48 Soft,
49 SoftFP,
50 Hard,
51};
52
53FloatABI getDefaultFloatABI(const llvm::Triple &Triple);
54FloatABI getARMFloatABI(const ToolChain &TC, const llvm::opt::ArgList &Args);
55FloatABI getARMFloatABI(const Driver &D, const llvm::Triple &Triple,
56 const llvm::opt::ArgList &Args);
57void setFloatABIInTriple(const Driver &D, const llvm::opt::ArgList &Args,
58 llvm::Triple &triple);
59bool isHardTPSupported(const llvm::Triple &Triple);
60ReadTPMode getReadTPMode(const Driver &D, const llvm::opt::ArgList &Args,
61 const llvm::Triple &Triple, bool ForAS);
62void setArchNameInTriple(const Driver &D, const llvm::opt::ArgList &Args,
63 types::ID InputType, llvm::Triple &Triple);
64
65bool useAAPCSForMachO(const llvm::Triple &T);
66void getARMArchCPUFromArgs(const llvm::opt::ArgList &Args,
67 llvm::StringRef &Arch, llvm::StringRef &CPU,
68 bool FromAs = false);
69llvm::ARM::FPUKind getARMTargetFeatures(const Driver &D,
70 const llvm::Triple &Triple,
71 const llvm::opt::ArgList &Args,
72 std::vector<llvm::StringRef> &Features,
73 bool ForAS, bool ForMultilib = false);
74int getARMSubArchVersionNumber(const llvm::Triple &Triple);
75bool isARMMProfile(const llvm::Triple &Triple);
76bool isARMAProfile(const llvm::Triple &Triple);
77bool isARMBigEndian(const llvm::Triple &Triple, const llvm::opt::ArgList &Args);
78
79} // end namespace arm
80} // end namespace tools
81} // end namespace driver
82} // end namespace clang
83
84#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_ARM_H
85