clang  13.0.0git
TargetOptions.h
Go to the documentation of this file.
1 //===--- TargetOptions.h ----------------------------------------*- 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 /// \file
10 /// Defines the clang::TargetOptions class.
11 ///
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CLANG_BASIC_TARGETOPTIONS_H
15 #define LLVM_CLANG_BASIC_TARGETOPTIONS_H
16 
18 #include "llvm/Support/VersionTuple.h"
19 #include "llvm/Target/TargetOptions.h"
20 #include <string>
21 #include <vector>
22 
23 namespace clang {
24 
25 /// Options for controlling the target.
27 public:
28  /// The name of the target triple to compile for.
30 
31  /// When compiling for the device side, contains the triple used to compile
32  /// for the host.
34 
35  /// If given, the name of the target CPU to generate code for.
37 
38  /// If given, the name of the target CPU to tune code for.
40 
41  /// If given, the unit to use for floating point math.
43 
44  /// If given, the name of the target ABI to use.
46 
47  /// The EABI version to use
48  llvm::EABI EABIVersion;
49 
50  /// If given, the version string of the linker in use.
52 
53  /// The list of target specific features to enable or disable, as written on the command line.
54  std::vector<std::string> FeaturesAsWritten;
55 
56  /// The list of target specific features to enable or disable -- this should
57  /// be a list of strings starting with by '+' or '-'.
58  std::vector<std::string> Features;
59 
60  /// The map of which features have been enabled disabled based on the command
61  /// line.
62  llvm::StringMap<bool> FeatureMap;
63 
64  /// Supported OpenCL extensions and optional core features.
65  llvm::StringMap<bool> OpenCLFeaturesMap;
66 
67  /// The list of OpenCL extensions to enable or disable, as written on
68  /// the command line.
69  std::vector<std::string> OpenCLExtensionsAsWritten;
70 
71  /// If given, enables support for __int128_t and __uint128_t types.
72  bool ForceEnableInt128 = false;
73 
74  /// \brief If enabled, use 32-bit pointers for accessing const/local/shared
75  /// address space.
76  bool NVPTXUseShortPointers = false;
77 
78  /// \brief If enabled, allow AMDGPU unsafe floating point atomics.
80 
81  // The code model to be used as specified by the user. Corresponds to
82  // CodeModel::Model enum defined in include/llvm/Support/CodeGen.h, plus
83  // "default" for the case when the user has not explicitly specified a
84  // code model.
86 
87  /// The version of the SDK which was used during the compilation.
88  /// The option is used for two different purposes:
89  /// * on darwin the version is propagated to LLVM where it's used
90  /// to support SDK Version metadata (See D55673).
91  /// * CUDA compilation uses it to control parts of CUDA compilation
92  /// in clang that depend on specific version of the CUDA SDK.
93  llvm::VersionTuple SDKVersion;
94 };
95 
96 } // end namespace clang
97 
98 #endif
clang::TargetOptions::HostTriple
std::string HostTriple
When compiling for the device side, contains the triple used to compile for the host.
Definition: TargetOptions.h:33
clang::TargetOptions::NVPTXUseShortPointers
bool NVPTXUseShortPointers
If enabled, use 32-bit pointers for accessing const/local/shared address space.
Definition: TargetOptions.h:76
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:22
OpenCLOptions.h
clang::TargetOptions::FPMath
std::string FPMath
If given, the unit to use for floating point math.
Definition: TargetOptions.h:42
clang::TargetOptions::AllowAMDGPUUnsafeFPAtomics
bool AllowAMDGPUUnsafeFPAtomics
If enabled, allow AMDGPU unsafe floating point atomics.
Definition: TargetOptions.h:79
clang::TargetOptions::ABI
std::string ABI
If given, the name of the target ABI to use.
Definition: TargetOptions.h:45
clang::TargetOptions::Features
std::vector< std::string > Features
The list of target specific features to enable or disable – this should be a list of strings starting...
Definition: TargetOptions.h:58
clang::TargetOptions::FeatureMap
llvm::StringMap< bool > FeatureMap
The map of which features have been enabled disabled based on the command line.
Definition: TargetOptions.h:62
clang::TargetOptions::ForceEnableInt128
bool ForceEnableInt128
If given, enables support for __int128_t and __uint128_t types.
Definition: TargetOptions.h:72
clang::TargetOptions::LinkerVersion
std::string LinkerVersion
If given, the version string of the linker in use.
Definition: TargetOptions.h:51
clang::TargetOptions::OpenCLExtensionsAsWritten
std::vector< std::string > OpenCLExtensionsAsWritten
The list of OpenCL extensions to enable or disable, as written on the command line.
Definition: TargetOptions.h:69
clang::TargetOptions::TuneCPU
std::string TuneCPU
If given, the name of the target CPU to tune code for.
Definition: TargetOptions.h:39
clang::TargetOptions::CPU
std::string CPU
If given, the name of the target CPU to generate code for.
Definition: TargetOptions.h:36
clang::TargetOptions::FeaturesAsWritten
std::vector< std::string > FeaturesAsWritten
The list of target specific features to enable or disable, as written on the command line.
Definition: TargetOptions.h:54
clang
Dataflow Directional Tag Classes.
Definition: CalledOnceCheck.h:17
clang::TargetOptions::Triple
std::string Triple
The name of the target triple to compile for.
Definition: TargetOptions.h:29
clang::TargetOptions::EABIVersion
llvm::EABI EABIVersion
The EABI version to use.
Definition: TargetOptions.h:48
clang::TargetOptions::SDKVersion
llvm::VersionTuple SDKVersion
The version of the SDK which was used during the compilation.
Definition: TargetOptions.h:93
clang::TargetOptions
Options for controlling the target.
Definition: TargetOptions.h:26
clang::TargetOptions::OpenCLFeaturesMap
llvm::StringMap< bool > OpenCLFeaturesMap
Supported OpenCL extensions and optional core features.
Definition: TargetOptions.h:65
clang::TargetOptions::CodeModel
std::string CodeModel
Definition: TargetOptions.h:85