diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2011-02-09 21:04:32 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2011-02-09 21:04:32 +0000 |
commit | 14b6ba77710d6431794d65c7d58c6f29c3dc956e (patch) | |
tree | 3b7c789d69dd7808da2d135caae3200ebecb639a /lib/Sema/SemaDecl.cpp | |
parent | eb4c45b383b4a8f69d23e4b9cfb6dd3e6f8ff641 (diff) |
AST, Sema, Serialization: keep track of cudaConfigureCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125216 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index ac8e042545..d756de5e2d 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -4110,6 +4110,19 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC, } MarkUnusedFileScopedDecl(NewFD); + + if (getLangOptions().CUDA) + if (IdentifierInfo *II = NewFD->getIdentifier()) + if (!NewFD->isInvalidDecl() && + NewFD->getDeclContext()->getRedeclContext()->isTranslationUnit()) { + if (II->isStr("cudaConfigureCall")) { + if (!R->getAs<FunctionType>()->getResultType()->isScalarType()) + Diag(NewFD->getLocation(), diag::err_config_scalar_return); + + Context.setcudaConfigureCallDecl(NewFD); + } + } + return NewFD; } |