diff options
author | Anastasia Stulova <anastasia.stulova@arm.com> | 2019-05-07 14:22:34 +0000 |
---|---|---|
committer | Anastasia Stulova <anastasia.stulova@arm.com> | 2019-05-07 14:22:34 +0000 |
commit | d6865b7d71bc4bd0d7251a1ab1979e54c57856cd (patch) | |
tree | 534add247a8d8575a26e18b980b9eb0189eb9150 /clang/lib/AST/Decl.cpp | |
parent | 5b0872fcfdfb1965aafe96ab512f56bb6455a29e (diff) | |
download | bcm5719-llvm-d6865b7d71bc4bd0d7251a1ab1979e54c57856cd.tar.gz bcm5719-llvm-d6865b7d71bc4bd0d7251a1ab1979e54c57856cd.zip |
[OpenCL] Prevent mangling kernel functions.
Kernel function names have to be preserved as in the original
source to be able to access them from the host API side.
This commit also adds restriction to kernels that prevents them
from being used in overloading, templates, etc.
Differential Revision: https://reviews.llvm.org/D60454
llvm-svn: 360152
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r-- | clang/lib/AST/Decl.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 19fd3882bd4..79db14af49c 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -2961,6 +2961,8 @@ bool FunctionDecl::isExternC() const { } bool FunctionDecl::isInExternCContext() const { + if (hasAttr<OpenCLKernelAttr>()) + return true; return getLexicalDeclContext()->isExternCContext(); } |