diff options
author | Anton Zabaznov <anton.zabaznov@intel.com> | 2021-04-22 19:53:59 +0300 |
---|---|---|
committer | Anton Zabaznov <anton.zabaznov@intel.com> | 2021-04-28 16:00:02 +0300 |
commit | f0efc00751313779671746492ded4014b715df6a (patch) | |
tree | 15d7e89b222d92fb619019f55593a42715092da1 /clang/lib/Frontend/CompilerInstance.cpp | |
parent | 9a66d334522d6b69d7d1ea0dbc1b04ae0d43b959 (diff) | |
download | llvm-f0efc00751313779671746492ded4014b715df6a.zip llvm-f0efc00751313779671746492ded4014b715df6a.tar.gz llvm-f0efc00751313779671746492ded4014b715df6a.tar.bz2 |
[OpenCL] Introduce new method for validating OpenCL target
Language options are not available when a target is being created,
thus, a new method is introduced. Also, some refactoring is done,
such as removing OpenCL feature macros setting from TargetInfo.
Reviewed By: Anastasia
Differential Revision: https://reviews.llvm.org/D101087
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index b76baae..4a765b9 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -133,6 +133,11 @@ bool CompilerInstance::createTarget() { // FIXME: can we disable FEnvAccess? } + // We should do it here because target knows nothing about + // language options when it's being created. + if (getLangOpts().OpenCL) + getTarget().validateOpenCLTarget(getLangOpts(), getDiagnostics()); + // Inform the target of the language options. // FIXME: We shouldn't need to do this, the target should be immutable once // created. This complexity should be lifted elsewhere. |