diff options
author | Anastasia Stulova <anastasia.stulova@arm.com> | 2019-12-03 12:55:50 +0000 |
---|---|---|
committer | Anastasia Stulova <anastasia.stulova@arm.com> | 2019-12-03 16:07:18 +0000 |
commit | 980133a2098cf6159785b8ac0cbe4d8fbf99bfea (patch) | |
tree | ada2bd59d4cf1f008b1e5553a41204b55f747395 /clang/lib/Sema/Sema.cpp | |
parent | 62827737acd878af6cd8930758b0d6f297173f40 (diff) | |
download | bcm5719-llvm-980133a2098cf6159785b8ac0cbe4d8fbf99bfea.tar.gz bcm5719-llvm-980133a2098cf6159785b8ac0cbe4d8fbf99bfea.zip |
[OpenCL] Use generic addr space for lambda call operator
Since lambdas are represented by callable objects, we add
generic addr space for implicit object parameter in call
operator.
Any lambda variable declared in __constant addr space
(which is not convertible to generic) fails to compile with
a diagnostic. To support constant addr space we need to
add a way to qualify the lambda call operators.
Tags: #clang
Differential Revision: https://reviews.llvm.org/D69938
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r-- | clang/lib/Sema/Sema.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index 035cb2e15ca..5ade6bbea07 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -1290,6 +1290,12 @@ NamedDecl *Sema::getCurFunctionOrMethodDecl() { return nullptr; } +LangAS Sema::getDefaultCXXMethodAddrSpace() const { + if (getLangOpts().OpenCL) + return LangAS::opencl_generic; + return LangAS::Default; +} + void Sema::EmitCurrentDiagnostic(unsigned DiagID) { // FIXME: It doesn't make sense to me that DiagID is an incoming argument here // and yet we also use the current diag ID on the DiagnosticsEngine. This has |