[PATCH] D96588: [OpenCL] Remove FIXME in getOpenCLFeatureDefines

Sven van Haastregt via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 12 03:13:28 PST 2021


svenvh created this revision.
svenvh added reviewers: Anastasia, azabaznov.
svenvh added a project: clang.
Herald added a subscriber: yaxunl.
svenvh requested review of this revision.
Herald added a subscriber: cfe-commits.

The suggestion in D92277 <https://reviews.llvm.org/D92277> was to move `OpenCLOptions` into `LanguageOptions`, but
this is not viable.  Sema's `LangOpts` is immutable, and embedding
`OpenCLOptions` into `LangOpts` would make `OpenCLOptions` immutable too.
This is incompatible with handling of pragmas that alter the
`OpenCLOptions` during parsing/sema.

Perhaps there might be another solution, so putting this up for discussion with
@Anastasia and @azabaznov to start with.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96588

Files:
  clang/lib/Basic/Targets.cpp


Index: clang/lib/Basic/Targets.cpp
===================================================================
--- clang/lib/Basic/Targets.cpp
+++ clang/lib/Basic/Targets.cpp
@@ -720,9 +720,6 @@
 /// and language version
 void TargetInfo::getOpenCLFeatureDefines(const LangOptions &Opts,
                                          MacroBuilder &Builder) const {
-  // FIXME: OpenCL options which affect language semantics/syntax
-  // should be moved into LangOptions, thus macro definitions of
-  // such options is better to be done in clang::InitializePreprocessor
   auto defineOpenCLExtMacro = [&](llvm::StringRef Name, unsigned AvailVer,
                                   unsigned CoreVersions,
                                   unsigned OptionalVersions) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96588.323279.patch
Type: text/x-patch
Size: 757 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210212/bc650402/attachment.bin>


More information about the cfe-commits mailing list