clang  13.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/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
clang::driver::tools::arm::getARMTargetFeatures
void getARMTargetFeatures(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, std::vector< llvm::StringRef > &Features, bool ForAS)
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::getARMArch
const std::string getARMArch(llvm::StringRef Arch, const llvm::Triple &Triple)
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:908
clang::driver::tools::arm::getReadTPMode
ReadTPMode getReadTPMode(const Driver &D, const llvm::opt::ArgList &Args)
clang::driver::tools::arm::ReadTPMode::Invalid
@ Invalid
clang::driver::tools::arm::isARMMProfile
bool isARMMProfile(const llvm::Triple &Triple)
Definition: ARM.cpp:30
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:43
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:24
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:299
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
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:59
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:37
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:36
clang::driver::tools::arm::ReadTPMode::Soft
@ Soft
clang::driver::tools::arm::useAAPCSForMachO
bool useAAPCSForMachO(const llvm::Triple &T)
Definition: ARM.cpp:142