14#ifndef LLVM_CLANG_BASIC_OPENCLOPTIONS_H
15#define LLVM_CLANG_BASIC_OPENCLOPTIONS_H
18#include "llvm/ADT/StringMap.h"
22class DiagnosticsEngine;
29enum OpenCLVersionID :
unsigned int {
36 OCL_C_11P = OCL_C_ALL ^ OCL_C_10,
37 OCL_C_12P = OCL_C_ALL ^ (OCL_C_10 | OCL_C_11),
40static inline OpenCLVersionID encodeOpenCLVersion(
unsigned OpenCLVersion) {
41 switch (OpenCLVersion) {
43 llvm_unreachable(
"Unknown OpenCL version code");
59static inline bool isOpenCLVersionContainedInMask(
const LangOptions &LO,
61 auto CLVer = LO.getOpenCLCompatibleVersion();
62 OpenCLVersionID Code = encodeOpenCLVersion(CLVer);
84 isSupported(
"__opencl_c_program_scope_global_variables", Opts));
132 bool isKnown(llvm::StringRef Ext)
const;
168 void enable(llvm::StringRef Ext,
bool V =
true);
173 void support(llvm::StringRef Ext,
bool V =
true);
178 void addSupport(
const llvm::StringMap<bool> &FeaturesMap,
189 template <
typename... Args>
194 template <
typename... Args>
212 bool isEnabled(llvm::StringRef Ext)
const;
static unsigned isEnabled(DiagnosticsEngine &D, unsigned diag)
Defines the clang::LangOptions interface.
Reads an AST files chain containing the contents of a translation unit.
Writes an AST file containing the contents of a translation unit.
Concrete class used by the front-end to report problems and issues.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
unsigned getOpenCLCompatibleVersion() const
Return the OpenCL version that kernel language is compatible with.
OpenCL supported extensions and optional core features.
bool isAvailableOption(llvm::StringRef Ext, const LangOptions &LO) const
static bool diagnoseUnsupportedFeatureDependencies(const TargetInfo &TI, DiagnosticsEngine &Diags)
bool isSupportedExtension(llvm::StringRef Ext, const LangOptions &LO) const
void enable(llvm::StringRef Ext, bool V=true)
bool isWithPragma(llvm::StringRef Ext) const
bool isSupportedCore(llvm::StringRef Ext, const LangOptions &LO) const
static bool diagnoseFeatureExtensionDifferences(const TargetInfo &TI, DiagnosticsEngine &Diags)
bool isSupportedCoreOrOptionalCore(llvm::StringRef Ext, const LangOptions &LO) const
bool isSupportedOptionalCore(llvm::StringRef Ext, const LangOptions &LO) const
void addSupport(const llvm::StringMap< bool > &FeaturesMap, const LangOptions &Opts)
llvm::StringMap< OpenCLOptionInfo > OpenCLOptionInfoMap
bool isSupported(llvm::StringRef Ext, const LangOptions &LO) const
void acceptsPragma(llvm::StringRef Ext, bool V=true)
bool areProgramScopeVariablesSupported(const LangOptions &Opts) const
bool isKnown(llvm::StringRef Ext) const
static bool isOpenCLOptionCoreIn(const LangOptions &LO, Args &&... args)
static bool isOpenCLOptionAvailableIn(const LangOptions &LO, Args &&... args)
Exposes information about the current target.
The JSON file list parser is used to communicate input to InstallAPI.
bool isOptionalCoreIn(const LangOptions &LO) const
bool isCoreIn(const LangOptions &LO) const
bool isOptionalCore() const
OpenCLOptionInfo(bool Pragma, unsigned AvailV, unsigned CoreV, unsigned OptV)
OpenCLOptionInfo()=default
bool isAvailableIn(const LangOptions &LO) const