clang  16.0.0git
ARM.h
Go to the documentation of this file.
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/ARMTargetParser.h"
17 #include "llvm/Support/TargetParser.h"
18 #include <string>
19 #include <vector>
20 
21 namespace clang {
22 namespace driver {
23 namespace tools {
24 namespace arm {
25 
26 std::string getARMTargetCPU(StringRef CPU, llvm::StringRef Arch,
27  const llvm::Triple &Triple);
28 std::string getARMArch(llvm::StringRef Arch, const llvm::Triple &Triple);
29 StringRef getARMCPUForMArch(llvm::StringRef Arch, const llvm::Triple &Triple);
30 llvm::ARM::ArchKind getLLVMArchKindForARM(StringRef CPU, StringRef Arch,
31  const llvm::Triple &Triple);
32 StringRef getLLVMArchSuffixForARM(llvm::StringRef CPU, llvm::StringRef Arch,
33  const llvm::Triple &Triple);
34 
35 void appendBE8LinkFlag(const llvm::opt::ArgList &Args,
36  llvm::opt::ArgStringList &CmdArgs,
37  const llvm::Triple &Triple);
38 enum class ReadTPMode {
39  Invalid,
40  Soft,
41  Cp15,
42 };
43 
44 enum class FloatABI {
45  Invalid,
46  Soft,
47  SoftFP,
48  Hard,
49 };
50 
51 FloatABI getDefaultFloatABI(const llvm::Triple &Triple);
52 FloatABI getARMFloatABI(const ToolChain &TC, const llvm::opt::ArgList &Args);
53 FloatABI getARMFloatABI(const Driver &D, const llvm::Triple &Triple,
54  const llvm::opt::ArgList &Args);
55 void setFloatABIInTriple(const Driver &D, const llvm::opt::ArgList &Args,
56  llvm::Triple &triple);
57 bool isHardTPSupported(const llvm::Triple &Triple);
58 ReadTPMode getReadTPMode(const Driver &D, const llvm::opt::ArgList &Args,
59  const llvm::Triple &Triple, bool ForAS);
60 void setArchNameInTriple(const Driver &D, const llvm::opt::ArgList &Args,
61  types::ID InputType, llvm::Triple &Triple);
62 
63 bool useAAPCSForMachO(const llvm::Triple &T);
64 void getARMArchCPUFromArgs(const llvm::opt::ArgList &Args,
65  llvm::StringRef &Arch, llvm::StringRef &CPU,
66  bool FromAs = false);
67 void getARMTargetFeatures(const Driver &D, const llvm::Triple &Triple,
68  const llvm::opt::ArgList &Args,
69  std::vector<llvm::StringRef> &Features, bool ForAS);
70 int getARMSubArchVersionNumber(const llvm::Triple &Triple);
71 bool isARMMProfile(const llvm::Triple &Triple);
72 bool isARMAProfile(const llvm::Triple &Triple);
73 
74 } // end namespace arm
75 } // end namespace tools
76 } // end namespace driver
77 } // end namespace clang
78 
79 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_ARM_H
clang::driver::tools::arm::isHardTPSupported
bool isHardTPSupported(const llvm::Triple &Triple)
Definition: ARM.cpp:156
clang::driver::tools::arm::setFloatABIInTriple
void setFloatABIInTriple(const Driver &D, const llvm::opt::ArgList &Args, llvm::Triple &triple)
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:22
clang::driver::tools::arm::getARMFloatABI
FloatABI getARMFloatABI(const ToolChain &TC, const llvm::opt::ArgList &Args)
clang::driver::tools::arm::FloatABI::Soft
@ Soft
clang::driver::tools::arm::getLLVMArchKindForARM
llvm::ARM::ArchKind getLLVMArchKindForARM(StringRef CPU, StringRef Arch, const llvm::Triple &Triple)
getLLVMArchSuffixForARM - Get the LLVM ArchKind value to use for a particular CPU (or Arch,...
Definition: ARM.cpp:971
clang::driver::tools::arm::ReadTPMode::Invalid
@ Invalid
clang::driver::tools::arm::isARMMProfile
bool isARMMProfile(const llvm::Triple &Triple)
Definition: ARM.cpp:31
clang::driver::tools::arm::setArchNameInTriple
void setArchNameInTriple(const Driver &D, const llvm::opt::ArgList &Args, types::ID InputType, llvm::Triple &Triple)
clang::driver::tools::arm::FloatABI
FloatABI
Definition: ARM.h:44
clang::driver::tools::arm::getARMCPUForMArch
StringRef getARMCPUForMArch(llvm::StringRef Arch, const llvm::Triple &Triple)
clang::driver::tools::arm::FloatABI::Hard
@ Hard
clang::driver::tools::arm::FloatABI::Invalid
@ Invalid
clang::driver::tools::arm::getARMSubArchVersionNumber
int getARMSubArchVersionNumber(const llvm::Triple &Triple)
Definition: ARM.cpp:25
ToolChain.h
clang::driver::ToolChain
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:91
clang::driver::tools::arm::FloatABI::SoftFP
@ SoftFP
clang::driver::tools::arm::getARMTargetCPU
std::string getARMTargetCPU(StringRef CPU, llvm::StringRef Arch, const llvm::Triple &Triple)
clang::driver::tools::arm::getDefaultFloatABI
FloatABI getDefaultFloatABI(const llvm::Triple &Triple)
Definition: ARM.cpp:318
clang::driver::types::ID
ID
Definition: Types.h:23
clang::driver::tools::arm::getARMArchCPUFromArgs
void getARMArchCPUFromArgs(const llvm::opt::ArgList &Args, llvm::StringRef &Arch, llvm::StringRef &CPU, bool FromAs=false)
clang::driver::tools::arm::getReadTPMode
ReadTPMode getReadTPMode(const Driver &D, const llvm::opt::ArgList &Args, const llvm::Triple &Triple, bool ForAS)
clang
Definition: CalledOnceCheck.h:17
clang::driver::Driver
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:70
clang::driver::tools::arm::getARMArch
std::string getARMArch(llvm::StringRef Arch, const llvm::Triple &Triple)
clang::driver::tools::arm::getLLVMArchSuffixForARM
StringRef getLLVMArchSuffixForARM(llvm::StringRef CPU, llvm::StringRef Arch, const llvm::Triple &Triple)
clang::driver::tools::arm::ReadTPMode::Cp15
@ Cp15
clang::driver::tools::arm::ReadTPMode
ReadTPMode
Definition: ARM.h:38
clang::driver::tools::arm::appendBE8LinkFlag
void appendBE8LinkFlag(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const llvm::Triple &Triple)
clang::driver::tools::arm::isARMAProfile
bool isARMAProfile(const llvm::Triple &Triple)
Definition: ARM.cpp:37
clang::driver::tools::arm::ReadTPMode::Soft
@ Soft
clang::driver::tools::arm::getARMTargetFeatures
void getARMTargetFeatures(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args, std::vector< llvm::StringRef > &Features, bool ForAS)
clang::driver::tools::arm::useAAPCSForMachO
bool useAAPCSForMachO(const llvm::Triple &T)
Definition: ARM.cpp:145