1 //===--- TargetOptions.h ----------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
10 /// Defines the clang::TargetOptions class.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_BASIC_TARGETOPTIONS_H
15 #define LLVM_CLANG_BASIC_TARGETOPTIONS_H
17 #include "clang/Basic/OpenCLOptions.h"
18 #include "llvm/Support/VersionTuple.h"
19 #include "llvm/Target/TargetOptions.h"
25 /// Options for controlling the target.
28 /// The name of the target triple to compile for.
31 /// When compiling for the device side, contains the triple used to compile
33 std::string HostTriple;
35 /// If given, the name of the target CPU to generate code for.
38 /// If given, the unit to use for floating point math.
41 /// If given, the name of the target ABI to use.
44 /// The EABI version to use
45 llvm::EABI EABIVersion;
47 /// If given, the version string of the linker in use.
48 std::string LinkerVersion;
50 /// The list of target specific features to enable or disable, as written on the command line.
51 std::vector<std::string> FeaturesAsWritten;
53 /// The list of target specific features to enable or disable -- this should
54 /// be a list of strings starting with by '+' or '-'.
55 std::vector<std::string> Features;
57 /// The map of which features have been enabled disabled based on the command
59 llvm::StringMap<bool> FeatureMap;
61 /// Supported OpenCL extensions and optional core features.
62 OpenCLOptions SupportedOpenCLOptions;
64 /// The list of OpenCL extensions to enable or disable, as written on
66 std::vector<std::string> OpenCLExtensionsAsWritten;
68 /// If given, enables support for __int128_t and __uint128_t types.
69 bool ForceEnableInt128 = false;
71 /// \brief If enabled, use 32-bit pointers for accessing const/local/shared
73 bool NVPTXUseShortPointers = false;
75 // The code model to be used as specified by the user. Corresponds to
76 // CodeModel::Model enum defined in include/llvm/Support/CodeGen.h, plus
77 // "default" for the case when the user has not explicitly specified a
79 std::string CodeModel;
81 /// The version of the SDK which was used during the compilation.
82 /// The option is used for two different purposes:
83 /// * on darwin the version is propagated to LLVM where it's used
84 /// to support SDK Version metadata (See D55673).
85 /// * CUDA compilation uses it to control parts of CUDA compilation
86 /// in clang that depend on specific version of the CUDA SDK.
87 llvm::VersionTuple SDKVersion;
90 } // end namespace clang