From 19513232c63a45b1efdde0e4253d2fd815dafc8c Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 28 Aug 2013 23:13:26 +0000 Subject: [PATCH] Mode is now handled as a non-inheritable attribute, and CUDADevice & CUDAHost are now handled as inheritable attributes. In all three cases, this makes the processing behavior more consistent with the declared behavior in Attr.td. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189532 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaDeclAttr.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index c8237b5e95..f7c271cfb1 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -4678,9 +4678,8 @@ static void handleSelectAnyAttr(Sema &S, Decl *D, const AttributeList &Attr) { static void ProcessNonInheritableDeclAttr(Sema &S, Scope *scope, Decl *D, const AttributeList &Attr) { switch (Attr.getKind()) { - case AttributeList::AT_CUDADevice: handleDeviceAttr (S, D, Attr); break; - case AttributeList::AT_CUDAHost: handleHostAttr (S, D, Attr); break; case AttributeList::AT_Overloadable:handleOverloadableAttr(S, D, Attr); break; + case AttributeList::AT_Mode: handleModeAttr (S, D, Attr); break; default: break; } @@ -4705,8 +4704,7 @@ static void ProcessInheritableDeclAttr(Sema &S, Scope *scope, Decl *D, // Ignore these, these are type attributes, handled by // ProcessTypeAttributes. break; - case AttributeList::AT_CUDADevice: - case AttributeList::AT_CUDAHost: + case AttributeList::AT_Mode: case AttributeList::AT_Overloadable: // Ignore, this is a non-inheritable attribute, handled // by ProcessNonInheritableDeclAttr. @@ -4743,11 +4741,12 @@ static void ProcessInheritableDeclAttr(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_CUDAHost: handleHostAttr (S, D, Attr); break; case AttributeList::AT_GNUInline: handleGNUInlineAttr (S, D, Attr); break; case AttributeList::AT_CUDALaunchBounds: handleLaunchBoundsAttr(S, D, Attr); break; - case AttributeList::AT_Mode: handleModeAttr (S, D, Attr); break; case AttributeList::AT_Malloc: handleMallocAttr (S, D, Attr); break; case AttributeList::AT_MayAlias: handleMayAliasAttr (S, D, Attr); break; case AttributeList::AT_NoCommon: handleNoCommonAttr (S, D, Attr); break; -- 2.50.1