summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2012-07-26 00:08:28 +0000
committerTanya Lattner <tonic@nondot.org>2012-07-26 00:08:28 +0000
commit4bfc35509405ff7db4de3003f863d4eeea13ea19 (patch)
tree0d3575cafb8247eada842eda983fe402db5fd01f /clang/lib/Sema
parent80b4ac76c5a7b99c143cd89f13ca192d24c51c2f (diff)
downloadbcm5719-llvm-4bfc35509405ff7db4de3003f863d4eeea13ea19.tar.gz
bcm5719-llvm-4bfc35509405ff7db4de3003f863d4eeea13ea19.zip
Disable the warning for missing prototypes for OpenCL kernels. Includes testcase.
llvm-svn: 160766
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 12444e55594..7233fc7c13e 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -7509,6 +7509,10 @@ static bool ShouldWarnAboutMissingPrototype(const FunctionDecl *FD) {
if (FD->isFunctionTemplateSpecialization())
return false;
+ // Don't warn for OpenCL kernels.
+ if (FD->hasAttr<OpenCLKernelAttr>())
+ return false;
+
bool MissingPrototype = true;
for (const FunctionDecl *Prev = FD->getPreviousDecl();
Prev; Prev = Prev->getPreviousDecl()) {
OpenPOWER on IntegriCloud