diff --git a/clang/include/clang/Basic/OpenCLOptions.h b/clang/include/clang/Basic/OpenCLOptions.h index 512bcb1e6ef1..d6cb1a210519 100644 --- a/clang/include/clang/Basic/OpenCLOptions.h +++ b/clang/include/clang/Basic/OpenCLOptions.h @@ -212,15 +212,6 @@ private: bool isEnabled(llvm::StringRef Ext) const; OpenCLOptionInfoMap OptMap; - - // First feature in a pair requires the second one to be supported. - using FeatureDepEntry = std::pair; - using FeatureDepList = llvm::SmallVector; - - static const FeatureDepList DependentFeaturesList; - - // Extensions and equivalent feature pairs. - static const llvm::StringMap FeatureExtensionMap; }; } // end namespace clang diff --git a/clang/lib/Basic/OpenCLOptions.cpp b/clang/lib/Basic/OpenCLOptions.cpp index 7e89b3f1b804..44edf5402540 100644 --- a/clang/lib/Basic/OpenCLOptions.cpp +++ b/clang/lib/Basic/OpenCLOptions.cpp @@ -12,14 +12,16 @@ namespace clang { -const OpenCLOptions::FeatureDepList OpenCLOptions::DependentFeaturesList = { +// First feature in a pair requires the second one to be supported. +static const std::pair DependentFeaturesList[] = { {"__opencl_c_read_write_images", "__opencl_c_images"}, {"__opencl_c_3d_image_writes", "__opencl_c_images"}, {"__opencl_c_pipes", "__opencl_c_generic_address_space"}, {"__opencl_c_device_enqueue", "__opencl_c_generic_address_space"}, {"__opencl_c_device_enqueue", "__opencl_c_program_scope_global_variables"}}; -const llvm::StringMap OpenCLOptions::FeatureExtensionMap = { +// Extensions and equivalent feature pairs. +static const std::pair FeatureExtensionMap[] = { {"cl_khr_fp64", "__opencl_c_fp64"}, {"cl_khr_3d_image_writes", "__opencl_c_3d_image_writes"}}; @@ -140,11 +142,11 @@ bool OpenCLOptions::diagnoseFeatureExtensionDifferences( bool IsValid = true; for (auto &ExtAndFeat : FeatureExtensionMap) - if (TI.hasFeatureEnabled(OpenCLFeaturesMap, ExtAndFeat.getKey()) != - TI.hasFeatureEnabled(OpenCLFeaturesMap, ExtAndFeat.getValue())) { + if (TI.hasFeatureEnabled(OpenCLFeaturesMap, ExtAndFeat.first) != + TI.hasFeatureEnabled(OpenCLFeaturesMap, ExtAndFeat.second)) { IsValid = false; Diags.Report(diag::err_opencl_extension_and_feature_differs) - << ExtAndFeat.getKey() << ExtAndFeat.getValue(); + << ExtAndFeat.first << ExtAndFeat.second; } return IsValid; }