Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Basic/OpenCLOptions.cpp
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
bool OpenCLOptions::diagnoseUnsupportedFeatureDependencies( | bool OpenCLOptions::diagnoseUnsupportedFeatureDependencies( | ||||
const TargetInfo &TI, DiagnosticsEngine &Diags) { | const TargetInfo &TI, DiagnosticsEngine &Diags) { | ||||
// Feature pairs. First feature in a pair requires the second one to be | // Feature pairs. First feature in a pair requires the second one to be | ||||
// supported. | // supported. | ||||
static const llvm::StringMap<llvm::StringRef> DependentFeaturesMap = { | static const llvm::StringMap<llvm::StringRef> DependentFeaturesMap = { | ||||
{"__opencl_c_read_write_images", "__opencl_c_images"}, | {"__opencl_c_read_write_images", "__opencl_c_images"}, | ||||
{"__opencl_c_3d_image_writes", "__opencl_c_images"}}; | {"__opencl_c_3d_image_writes", "__opencl_c_images"}, | ||||
{"__opencl_c_pipes", "__opencl_c_generic_address_space"}}; | |||||
auto OpenCLFeaturesMap = TI.getSupportedOpenCLOpts(); | auto OpenCLFeaturesMap = TI.getSupportedOpenCLOpts(); | ||||
bool IsValid = true; | bool IsValid = true; | ||||
for (auto &FeaturePair : DependentFeaturesMap) | for (auto &FeaturePair : DependentFeaturesMap) | ||||
if (TI.hasFeatureEnabled(OpenCLFeaturesMap, FeaturePair.getKey()) && | if (TI.hasFeatureEnabled(OpenCLFeaturesMap, FeaturePair.getKey()) && | ||||
!TI.hasFeatureEnabled(OpenCLFeaturesMap, FeaturePair.getValue())) { | !TI.hasFeatureEnabled(OpenCLFeaturesMap, FeaturePair.getValue())) { | ||||
IsValid = false; | IsValid = false; | ||||
Show All 27 Lines |