13 #ifndef LLVM_CLANG_LIB_BASIC_TARGETS_NVPTX_H 14 #define LLVM_CLANG_LIB_BASIC_TARGETS_NVPTX_H 19 #include "llvm/ADT/Triple.h" 20 #include "llvm/Support/Compiler.h" 53 std::unique_ptr<TargetInfo> HostTarget;
57 unsigned TargetPointerWidth);
67 const std::vector<std::string> &FeaturesVec)
const override {
69 Features[
"ptx" + std::to_string(PTXVersion)] =
true;
73 bool hasFeature(StringRef Feature)
const override;
118 bool setCPU(
const std::string &Name)
override {
124 auto &Opts = getSupportedOpenCLOpts();
125 Opts.support(
"cl_clang_storage_class_specifiers");
126 Opts.support(
"cl_khr_gl_sharing");
127 Opts.support(
"cl_khr_icd");
129 Opts.support(
"cl_khr_fp64");
130 Opts.support(
"cl_khr_byte_addressable_store");
131 Opts.support(
"cl_khr_global_int32_base_atomics");
132 Opts.support(
"cl_khr_global_int32_extended_atomics");
133 Opts.support(
"cl_khr_local_int32_base_atomics");
134 Opts.support(
"cl_khr_local_int32_extended_atomics");
145 if (AddressSpace >= llvm::array_lengthof(NVPTXDWARFAddrSpaceMap) ||
146 NVPTXDWARFAddrSpaceMap[AddressSpace] < 0)
148 return NVPTXDWARFAddrSpaceMap[AddressSpace];
157 return HostTarget->checkCallingConvention(CC);
163 #endif // LLVM_CLANG_LIB_BASIC_TARGETS_NVPTX_H void fillValidCPUList(SmallVectorImpl< StringRef > &Values) const override
Fill a SmallVectorImpl with the valid values to setCPU.
const char * CudaArchToString(CudaArch A)
static const Builtin::Info BuiltinInfo[]
static bool hasFeature(StringRef Feature, const LangOptions &LangOpts, const TargetInfo &Target)
Determine whether a translation unit built using the current language options has the given feature...
static const int NVPTXDWARFAddrSpaceMap[]
The DWARF address class.
CudaArch StringToCudaArch(llvm::StringRef S)
Options for controlling the target.
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override
Determines whether a given calling convention is valid for the target.
bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &Info) const override
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Concrete class used by the front-end to report problems and issues.
static const char *const GCCRegNames[]
Exposes information about the current target.
bool setCPU(const std::string &Name) override
Target the specified CPU.
virtual bool initFeatureMap(llvm::StringMap< bool > &Features, DiagnosticsEngine &Diags, StringRef CPU, const std::vector< std::string > &FeatureVec) const
Initialize the map with the default set of target features for the CPU this should include all legal ...
Optional< unsigned > getDWARFAddressSpace(unsigned AddressSpace) const override
CallingConv
CallingConv - Specifies the calling convention that a function uses.
void setSupportedOpenCLOpts() override
Set supported OpenCL extensions and optional core features.
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Defines the clang::TargetOptions class.
bool isValidCPUName(StringRef Name) const override
brief Determine whether this TargetInfo supports the given CPU name.
ArrayRef< TargetInfo::GCCRegAlias > getGCCRegAliases() const override
Dataflow Directional Tag Classes.
typedef char* __builtin_va_list;
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
static const unsigned NVPTXAddrSpaceMap[]
Defines the clang::TargetInfo interface.
const char * getClobbers() const override
Returns a string of target-specific clobbers, in LLVM format.
bool initFeatureMap(llvm::StringMap< bool > &Features, DiagnosticsEngine &Diags, StringRef CPU, const std::vector< std::string > &FeaturesVec) const override
Initialize the map with the default set of target features for the CPU this should include all legal ...