summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-02-09 21:04:32 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2011-02-09 21:04:32 +0000
commit9e2c81f00a0a2d62c7d9ef012da4fe2079224276 (patch)
treec3ea406cf60ef8002d025d1ceb5754e9f46243ed /clang/lib/Sema
parentfd3e83953f0ea2d5563a631c29fba307e76e4aac (diff)
downloadbcm5719-llvm-9e2c81f00a0a2d62c7d9ef012da4fe2079224276.tar.gz
bcm5719-llvm-9e2c81f00a0a2d62c7d9ef012da4fe2079224276.zip
AST, Sema, Serialization: keep track of cudaConfigureCall
llvm-svn: 125216
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index ac8e0425458..d756de5e2db 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud