summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-10-02 23:49:15 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2011-10-02 23:49:15 +0000
commit34a20b081e43ce3d7c6752364a2358ae00050494 (patch)
tree6f443d8530e9fa42c3c3b279897359476785b5f1 /clang/lib
parent7aea69d9490dc6a07ed3165982ff38a7a8077cb2 (diff)
downloadbcm5719-llvm-34a20b081e43ce3d7c6752364a2358ae00050494.tar.gz
bcm5719-llvm-34a20b081e43ce3d7c6752364a2358ae00050494.zip
CUDA: diagnose unconfigured calls to global functions
llvm-svn: 140975
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index d0a3f6b5ecc..eb5678e7f00 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -3655,6 +3655,11 @@ Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl,
if (!FuncT->getResultType()->isVoidType())
return ExprError(Diag(LParenLoc, diag::err_kern_type_not_void_return)
<< Fn->getType() << Fn->getSourceRange());
+ } else {
+ // CUDA: Calls to global functions must be configured
+ if (FDecl && FDecl->hasAttr<CUDAGlobalAttr>())
+ return ExprError(Diag(LParenLoc, diag::err_global_call_not_config)
+ << FDecl->getName() << Fn->getSourceRange());
}
}
OpenPOWER on IntegriCloud