clang 24.0.0git
DirectX.h
Go to the documentation of this file.
1//===--- DirectX.h - Declare DirectX target feature support -----*- 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// This file declares DXIL TargetInfo objects.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_DIRECTX_H
14#define LLVM_CLANG_LIB_BASIC_TARGETS_DIRECTX_H
17#include "llvm/Support/Compiler.h"
18#include "llvm/TargetParser/Triple.h"
19
20namespace clang {
21namespace targets {
22
29
30class LLVM_LIBRARY_VISIBILITY DirectXTargetInfo : public TargetInfo {
31public:
32 DirectXTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
33 : TargetInfo(Triple) {
34 TLSSupported = false;
35 VLASupported = false;
38 HasFastHalfType = true;
39 HasFloat16 = true;
40 NoAsmVariants = true;
42 PlatformMinVersion = Triple.getOSVersion();
43 PlatformName = llvm::Triple::getOSTypeName(Triple.getOS());
45 TheCXXABI.set(TargetCXXABI::GenericItanium);
46 }
47 void getTargetDefines(const LangOptions &Opts,
48 MacroBuilder &Builder) const override;
49
50 bool hasFeature(StringRef Feature) const override {
51 return Feature == "directx";
52 }
53
54 llvm::SmallVector<Builtin::InfosShard> getTargetBuiltins() const override;
55
56 std::string_view getClobbers() const override { return ""; }
57
58 ArrayRef<const char *> getGCCRegNames() const override { return {}; }
59
60 bool validateAsmConstraint(const char *&Name,
61 TargetInfo::ConstraintInfo &info) const override {
62 return true;
63 }
64
66 return {};
67 }
68
72
74 const TargetInfo *Aux) override {
75 TargetInfo::adjust(Diags, Opts, Aux);
76 // The static values this addresses do not apply outside of the same thread
77 // This protection is neither available nor needed
78 Opts.ThreadsafeStatics = false;
79 }
80};
81
82} // namespace targets
83} // namespace clang
84
85#endif // LLVM_CLANG_LIB_BASIC_TARGETS_DIRECTX_H
Defines the clang::TargetOptions class.
Concrete class used by the front-end to report problems and issues.
Definition Diagnostic.h:234
The type of a lookup table which maps from language-specific address spaces to target-specific ones.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
TargetInfo(const llvm::Triple &T)
const LangASMap * AddrSpaceMap
Definition TargetInfo.h:260
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
Definition TargetInfo.h:337
@ VoidPtrBuiltinVaList
typedef void* __builtin_va_list;
Definition TargetInfo.h:342
VersionTuple PlatformMinVersion
Definition TargetInfo.h:263
virtual void adjust(DiagnosticsEngine &Diags, LangOptions &Opts, const TargetInfo *Aux)
Set forced language options.
void resetDataLayout(StringRef DL)
Set the data layout to the given string.
StringRef PlatformName
Definition TargetInfo.h:262
bool UseAddrSpaceMapMangling
Specify if mangling based on address space map should be used or not for language specific address sp...
Definition TargetInfo.h:389
TargetCXXABI TheCXXABI
Definition TargetInfo.h:258
Options for controlling the target.
std::string_view getClobbers() const override
Returns a string of target-specific clobbers, in LLVM format.
Definition DirectX.h:56
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Definition DirectX.h:69
ArrayRef< TargetInfo::GCCRegAlias > getGCCRegAliases() const override
Definition DirectX.h:65
ArrayRef< const char * > getGCCRegNames() const override
Definition DirectX.h:58
bool hasFeature(StringRef Feature) const override
Determine whether the given target has the given feature.
Definition DirectX.h:50
bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &info) const override
Definition DirectX.h:60
DirectXTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
Definition DirectX.h:32
void adjust(DiagnosticsEngine &Diags, LangOptions &Opts, const TargetInfo *Aux) override
Set forced language options.
Definition DirectX.h:73
Defines the clang::TargetInfo interface.
static constexpr LangASMap DirectXAddrSpaceMap
Definition DirectX.h:23
The JSON file list parser is used to communicate input to InstallAPI.