summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2013-12-02 21:09:08 +0000
committerAaron Ballman <aaron@aaronballman.com>2013-12-02 21:09:08 +0000
commitf79ee2756d8969af60737b5efacd713282e42d3e (patch)
treeaee909f110ef5271992ae153d8374606dc6bf613
parent25052adf21661f70e00c3081b03a199cb841d611 (diff)
downloadbcm5719-llvm-f79ee2756d8969af60737b5efacd713282e42d3e.tar.gz
bcm5719-llvm-f79ee2756d8969af60737b5efacd713282e42d3e.zip
The CUDA device attribute doesn't need custom logic to check the number of attribute arguments (the common attribute handler already does this). Switching to use the simple attribute handler. No functional change intended.
llvm-svn: 196155
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 687f8a014e4..21f3526da8c 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -3143,19 +3143,6 @@ static void handleNoDebugAttr(Sema &S, Decl *D, const AttributeList &Attr) {
Attr.getAttributeSpellingListIndex()));
}
-static void handleDeviceAttr(Sema &S, Decl *D, const AttributeList &Attr) {
- // check the attribute arguments.
- if (Attr.getNumArgs() != 0) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
- << Attr.getName() << 0;
- return;
- }
-
- D->addAttr(::new (S.Context)
- CUDADeviceAttr(Attr.getRange(), S.Context,
- Attr.getAttributeSpellingListIndex()));
-}
-
static void handleGlobalAttr(Sema &S, Decl *D, const AttributeList &Attr) {
FunctionDecl *FD = cast<FunctionDecl>(D);
if (!FD->getResultType()->isVoidType()) {
@@ -3954,7 +3941,8 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D,
case AttributeList::AT_Format: handleFormatAttr (S, D, Attr); break;
case AttributeList::AT_FormatArg: handleFormatArgAttr (S, D, Attr); break;
case AttributeList::AT_CUDAGlobal: handleGlobalAttr (S, D, Attr); break;
- case AttributeList::AT_CUDADevice: handleDeviceAttr (S, D, Attr); break;
+ case AttributeList::AT_CUDADevice:
+ handleSimpleAttribute<CUDADeviceAttr>(S, D, Attr); break;
case AttributeList::AT_CUDAHost:
handleSimpleAttribute<CUDAHostAttr>(S, D, Attr); break;
case AttributeList::AT_GNUInline: handleGNUInlineAttr (S, D, Attr); break;
OpenPOWER on IntegriCloud