From 19420325558ce7acabc1508c2664ae98ff9baefd Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 6 Mar 2014 14:02:27 +0000 Subject: [PATCH] Reformatting the style used within the massive attribute semantic handling switch statement, so now there is only one style used in this block of code, instead of three or more styles. No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203120 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaDeclAttr.cpp | 360 ++++++++++++++++++++++++++------------ 1 file changed, 245 insertions(+), 115 deletions(-) diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 5351d0fa2e..237c99e48a 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -4038,173 +4038,266 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, // though they were unknown attributes. if (Attr.getKind() == AttributeList::UnknownAttribute || !Attr.existsInTarget(S.Context.getTargetInfo().getTriple())) { - S.Diag(Attr.getLoc(), Attr.isDeclspecAttribute() ? - diag::warn_unhandled_ms_attribute_ignored : - diag::warn_unknown_attribute_ignored) << Attr.getName(); + S.Diag(Attr.getLoc(), Attr.isDeclspecAttribute() + ? diag::warn_unhandled_ms_attribute_ignored + : diag::warn_unknown_attribute_ignored) + << Attr.getName(); return; } - + if (handleCommonAttributeFeatures(S, scope, D, Attr)) return; switch (Attr.getKind()) { default: - // Type attributes are handled elsewhere; silently move on. + // Type attributes are handled elsewhere; silently move on. assert(Attr.isTypeAttr() && "Non-type attribute not handled"); - break; + break; case AttributeList::AT_Interrupt: - handleInterruptAttr(S, D, Attr); break; + handleInterruptAttr(S, D, Attr); + break; case AttributeList::AT_X86ForceAlignArgPointer: - handleX86ForceAlignArgPointerAttr(S, D, Attr); break; + handleX86ForceAlignArgPointerAttr(S, D, Attr); + break; case AttributeList::AT_DLLExport: - handleDLLExportAttr(S, D, Attr); break; + handleDLLExportAttr(S, D, Attr); + break; case AttributeList::AT_DLLImport: - handleDLLImportAttr(S, D, Attr); break; + handleDLLImportAttr(S, D, Attr); + break; case AttributeList::AT_Mips16: - handleSimpleAttribute(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; case AttributeList::AT_NoMips16: - handleSimpleAttribute(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; case AttributeList::AT_IBAction: - handleSimpleAttribute(S, D, Attr); break; - case AttributeList::AT_IBOutlet: handleIBOutlet(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; + case AttributeList::AT_IBOutlet: + handleIBOutlet(S, D, Attr); + break; case AttributeList::AT_IBOutletCollection: - handleIBOutletCollection(S, D, Attr); break; - case AttributeList::AT_Alias: handleAliasAttr (S, D, Attr); break; - case AttributeList::AT_Aligned: handleAlignedAttr (S, D, Attr); break; + handleIBOutletCollection(S, D, Attr); + break; + case AttributeList::AT_Alias: + handleAliasAttr(S, D, Attr); + break; + case AttributeList::AT_Aligned: + handleAlignedAttr(S, D, Attr); + break; case AttributeList::AT_AlwaysInline: - handleSimpleAttribute(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; case AttributeList::AT_AnalyzerNoReturn: - handleAnalyzerNoReturnAttr (S, D, Attr); break; - case AttributeList::AT_TLSModel: handleTLSModelAttr (S, D, Attr); break; - case AttributeList::AT_Annotate: handleAnnotateAttr (S, D, Attr); break; - case AttributeList::AT_Availability:handleAvailabilityAttr(S, D, Attr); break; + handleAnalyzerNoReturnAttr(S, D, Attr); + break; + case AttributeList::AT_TLSModel: + handleTLSModelAttr(S, D, Attr); + break; + case AttributeList::AT_Annotate: + handleAnnotateAttr(S, D, Attr); + break; + case AttributeList::AT_Availability: + handleAvailabilityAttr(S, D, Attr); + break; case AttributeList::AT_CarriesDependency: handleDependencyAttr(S, scope, D, Attr); break; - case AttributeList::AT_Common: handleCommonAttr (S, D, Attr); break; + case AttributeList::AT_Common: + handleCommonAttr(S, D, Attr); + break; case AttributeList::AT_CUDAConstant: - handleSimpleAttribute(S, D, Attr); break; - case AttributeList::AT_Constructor: handleConstructorAttr (S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; + case AttributeList::AT_Constructor: + handleConstructorAttr(S, D, Attr); + break; case AttributeList::AT_CXX11NoReturn: - handleSimpleAttribute(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; case AttributeList::AT_Deprecated: handleAttrWithMessage(S, D, Attr); break; - case AttributeList::AT_Destructor: handleDestructorAttr (S, D, Attr); break; - case AttributeList::AT_EnableIf: handleEnableIfAttr (S, D, Attr); break; + case AttributeList::AT_Destructor: + handleDestructorAttr(S, D, Attr); + break; + case AttributeList::AT_EnableIf: + handleEnableIfAttr(S, D, Attr); + break; case AttributeList::AT_ExtVectorType: handleExtVectorTypeAttr(S, scope, D, Attr); break; case AttributeList::AT_MinSize: handleSimpleAttribute(S, D, Attr); break; - 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_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: - handleSimpleAttribute(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; case AttributeList::AT_CUDAHost: - handleSimpleAttribute(S, D, Attr); break; - case AttributeList::AT_GNUInline: handleGNUInlineAttr (S, D, Attr); break; + handleSimpleAttribute(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_Malloc: handleMallocAttr (S, D, Attr); break; + case AttributeList::AT_Malloc: + handleMallocAttr(S, D, Attr); + break; case AttributeList::AT_MayAlias: - handleSimpleAttribute(S, D, Attr); break; - case AttributeList::AT_Mode: handleModeAttr (S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; + case AttributeList::AT_Mode: + handleModeAttr(S, D, Attr); + break; case AttributeList::AT_NoCommon: - handleSimpleAttribute(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; case AttributeList::AT_NonNull: - if (ParmVarDecl *PVD = dyn_cast(D)) - handleNonNullAttrParameter(S, PVD, Attr); - else - handleNonNullAttr(S, D, Attr); - break; + if (ParmVarDecl *PVD = dyn_cast(D)) + handleNonNullAttrParameter(S, PVD, Attr); + else + handleNonNullAttr(S, D, Attr); + break; case AttributeList::AT_ReturnsNonNull: - handleReturnsNonNullAttr(S, D, Attr); break; + handleReturnsNonNullAttr(S, D, Attr); + break; case AttributeList::AT_Overloadable: - handleSimpleAttribute(S, D, Attr); break; - case AttributeList::AT_Ownership: handleOwnershipAttr (S, D, Attr); break; - case AttributeList::AT_Cold: handleColdAttr (S, D, Attr); break; - case AttributeList::AT_Hot: handleHotAttr (S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; + case AttributeList::AT_Ownership: + handleOwnershipAttr(S, D, Attr); + break; + case AttributeList::AT_Cold: + handleColdAttr(S, D, Attr); + break; + case AttributeList::AT_Hot: + handleHotAttr(S, D, Attr); + break; case AttributeList::AT_Naked: - handleSimpleAttribute(S, D, Attr); break; - case AttributeList::AT_NoReturn: handleNoReturnAttr (S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; + case AttributeList::AT_NoReturn: + handleNoReturnAttr(S, D, Attr); + break; case AttributeList::AT_NoThrow: - handleSimpleAttribute(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; case AttributeList::AT_CUDAShared: - handleSimpleAttribute(S, D, Attr); break; - case AttributeList::AT_VecReturn: handleVecReturnAttr (S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; + case AttributeList::AT_VecReturn: + handleVecReturnAttr(S, D, Attr); + break; case AttributeList::AT_ObjCOwnership: - handleObjCOwnershipAttr(S, D, Attr); break; + handleObjCOwnershipAttr(S, D, Attr); + break; case AttributeList::AT_ObjCPreciseLifetime: - handleObjCPreciseLifetimeAttr(S, D, Attr); break; + handleObjCPreciseLifetimeAttr(S, D, Attr); + break; case AttributeList::AT_ObjCReturnsInnerPointer: - handleObjCReturnsInnerPointerAttr(S, D, Attr); break; + handleObjCReturnsInnerPointerAttr(S, D, Attr); + break; case AttributeList::AT_ObjCRequiresSuper: - handleObjCRequiresSuperAttr(S, D, Attr); break; - + handleObjCRequiresSuperAttr(S, D, Attr); + break; + case AttributeList::AT_ObjCBridge: - handleObjCBridgeAttr(S, scope, D, Attr); break; - + handleObjCBridgeAttr(S, scope, D, Attr); + break; + case AttributeList::AT_ObjCBridgeMutable: - handleObjCBridgeMutableAttr(S, scope, D, Attr); break; - + handleObjCBridgeMutableAttr(S, scope, D, Attr); + break; + case AttributeList::AT_ObjCBridgeRelated: - handleObjCBridgeRelatedAttr(S, scope, D, Attr); break; + handleObjCBridgeRelatedAttr(S, scope, D, Attr); + break; case AttributeList::AT_ObjCDesignatedInitializer: - handleObjCDesignatedInitializer(S, D, Attr); break; + handleObjCDesignatedInitializer(S, D, Attr); + break; case AttributeList::AT_CFAuditedTransfer: - handleCFAuditedTransferAttr(S, D, Attr); break; + handleCFAuditedTransferAttr(S, D, Attr); + break; case AttributeList::AT_CFUnknownTransfer: - handleCFUnknownTransferAttr(S, D, Attr); break; + handleCFUnknownTransferAttr(S, D, Attr); + break; case AttributeList::AT_CFConsumed: - case AttributeList::AT_NSConsumed: handleNSConsumedAttr (S, D, Attr); break; + case AttributeList::AT_NSConsumed: + handleNSConsumedAttr(S, D, Attr); + break; case AttributeList::AT_NSConsumesSelf: - handleSimpleAttribute(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; case AttributeList::AT_NSReturnsAutoreleased: case AttributeList::AT_NSReturnsNotRetained: case AttributeList::AT_CFReturnsNotRetained: case AttributeList::AT_NSReturnsRetained: case AttributeList::AT_CFReturnsRetained: - handleNSReturnsRetainedAttr(S, D, Attr); break; + handleNSReturnsRetainedAttr(S, D, Attr); + break; case AttributeList::AT_WorkGroupSizeHint: - handleWorkGroupSize(S, D, Attr); break; + handleWorkGroupSize(S, D, Attr); + break; case AttributeList::AT_ReqdWorkGroupSize: - handleWorkGroupSize(S, D, Attr); break; + handleWorkGroupSize(S, D, Attr); + break; case AttributeList::AT_VecTypeHint: - handleVecTypeHint(S, D, Attr); break; + handleVecTypeHint(S, D, Attr); + break; - case AttributeList::AT_InitPriority: - handleInitPriorityAttr(S, D, Attr); break; - - case AttributeList::AT_Packed: handlePackedAttr (S, D, Attr); break; - case AttributeList::AT_Section: handleSectionAttr (S, D, Attr); break; + case AttributeList::AT_InitPriority: + handleInitPriorityAttr(S, D, Attr); + break; + + case AttributeList::AT_Packed: + handlePackedAttr(S, D, Attr); + break; + case AttributeList::AT_Section: + handleSectionAttr(S, D, Attr); + break; case AttributeList::AT_Unavailable: handleAttrWithMessage(S, D, Attr); break; - case AttributeList::AT_ArcWeakrefUnavailable: - handleSimpleAttribute(S, D, Attr); break; + case AttributeList::AT_ArcWeakrefUnavailable: + handleSimpleAttribute(S, D, Attr); + break; case AttributeList::AT_ObjCRootClass: - handleSimpleAttribute(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; case AttributeList::AT_ObjCExplicitProtocolImpl: handleObjCSuppresProtocolAttr(S, D, Attr); break; case AttributeList::AT_ObjCRequiresPropertyDefs: - handleSimpleAttribute(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; case AttributeList::AT_Unused: - handleSimpleAttribute(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; case AttributeList::AT_ReturnsTwice: - handleSimpleAttribute(S, D, Attr); break; - case AttributeList::AT_Used: handleUsedAttr (S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; + case AttributeList::AT_Used: + handleUsedAttr(S, D, Attr); + break; case AttributeList::AT_Visibility: handleVisibilityAttr(S, D, Attr, false); break; @@ -4212,36 +4305,59 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, handleVisibilityAttr(S, D, Attr, true); break; case AttributeList::AT_WarnUnused: - handleSimpleAttribute(S, D, Attr); break; - case AttributeList::AT_WarnUnusedResult: handleWarnUnusedResult(S, D, Attr); + handleSimpleAttribute(S, D, Attr); + break; + case AttributeList::AT_WarnUnusedResult: + handleWarnUnusedResult(S, D, Attr); break; case AttributeList::AT_Weak: - handleSimpleAttribute(S, D, Attr); break; - case AttributeList::AT_WeakRef: handleWeakRefAttr (S, D, Attr); break; - case AttributeList::AT_WeakImport: handleWeakImportAttr (S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; + case AttributeList::AT_WeakRef: + handleWeakRefAttr(S, D, Attr); + break; + case AttributeList::AT_WeakImport: + handleWeakImportAttr(S, D, Attr); + break; case AttributeList::AT_TransparentUnion: handleTransparentUnionAttr(S, D, Attr); break; case AttributeList::AT_ObjCException: - handleSimpleAttribute(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; case AttributeList::AT_ObjCMethodFamily: handleObjCMethodFamilyAttr(S, D, Attr); break; - case AttributeList::AT_ObjCNSObject:handleObjCNSObject (S, D, Attr); break; - case AttributeList::AT_Blocks: handleBlocksAttr (S, D, Attr); break; - case AttributeList::AT_Sentinel: handleSentinelAttr (S, D, Attr); break; + case AttributeList::AT_ObjCNSObject: + handleObjCNSObject(S, D, Attr); + break; + case AttributeList::AT_Blocks: + handleBlocksAttr(S, D, Attr); + break; + case AttributeList::AT_Sentinel: + handleSentinelAttr(S, D, Attr); + break; case AttributeList::AT_Const: - handleSimpleAttribute(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; case AttributeList::AT_Pure: - handleSimpleAttribute(S, D, Attr); break; - case AttributeList::AT_Cleanup: handleCleanupAttr (S, D, Attr); break; - case AttributeList::AT_NoDebug: handleNoDebugAttr (S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; + case AttributeList::AT_Cleanup: + handleCleanupAttr(S, D, Attr); + break; + case AttributeList::AT_NoDebug: + handleNoDebugAttr(S, D, Attr); + break; case AttributeList::AT_NoDuplicate: - handleSimpleAttribute(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; case AttributeList::AT_NoInline: - handleSimpleAttribute(S, D, Attr); break; - case AttributeList::AT_NoInstrumentFunction: // Interacts with -pg. - handleSimpleAttribute(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; + case AttributeList::AT_NoInstrumentFunction: // Interacts with -pg. + handleSimpleAttribute(S, D, Attr); + break; case AttributeList::AT_StdCall: case AttributeList::AT_CDecl: case AttributeList::AT_FastCall: @@ -4255,9 +4371,11 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, handleCallConvAttr(S, D, Attr); break; case AttributeList::AT_OpenCLKernel: - handleSimpleAttribute(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; case AttributeList::AT_OpenCLImageAccess: - handleSimpleAttribute(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; // Microsoft attributes: case AttributeList::AT_MsStruct: @@ -4267,9 +4385,11 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, handleUuidAttr(S, D, Attr); break; case AttributeList::AT_MSInheritance: - handleMSInheritanceAttr(S, D, Attr); break; + handleMSInheritanceAttr(S, D, Attr); + break; case AttributeList::AT_SelectAny: - handleSimpleAttribute(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; // Thread safety attributes: case AttributeList::AT_AssertExclusiveLock: @@ -4279,12 +4399,14 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, handleAssertSharedLockAttr(S, D, Attr); break; case AttributeList::AT_GuardedVar: - handleSimpleAttribute(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; case AttributeList::AT_PtGuardedVar: handlePtGuardedVarAttr(S, D, Attr); break; case AttributeList::AT_ScopedLockable: - handleSimpleAttribute(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; case AttributeList::AT_NoSanitizeAddress: handleSimpleAttribute(S, D, Attr); break; @@ -4334,27 +4456,35 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, // Capability analysis attributes. case AttributeList::AT_Capability: case AttributeList::AT_Lockable: - handleCapabilityAttr(S, D, Attr); break; + handleCapabilityAttr(S, D, Attr); + break; case AttributeList::AT_RequiresCapability: - handleRequiresCapabilityAttr(S, D, Attr); break; + handleRequiresCapabilityAttr(S, D, Attr); + break; case AttributeList::AT_AssertCapability: - handleAssertCapabilityAttr(S, D, Attr); break; + handleAssertCapabilityAttr(S, D, Attr); + break; case AttributeList::AT_AcquireCapability: - handleAcquireCapabilityAttr(S, D, Attr); break; + handleAcquireCapabilityAttr(S, D, Attr); + break; case AttributeList::AT_ReleaseCapability: - handleReleaseCapabilityAttr(S, D, Attr); break; + handleReleaseCapabilityAttr(S, D, Attr); + break; case AttributeList::AT_TryAcquireCapability: - handleTryAcquireCapabilityAttr(S, D, Attr); break; + handleTryAcquireCapabilityAttr(S, D, Attr); + break; // Consumed analysis attributes. case AttributeList::AT_Consumable: handleConsumableAttr(S, D, Attr); break; case AttributeList::AT_ConsumableAutoCast: - handleSimpleAttribute(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; case AttributeList::AT_ConsumableSetOnRead: - handleSimpleAttribute(S, D, Attr); break; + handleSimpleAttribute(S, D, Attr); + break; case AttributeList::AT_CallableWhen: handleCallableWhenAttr(S, D, Attr); break; -- 2.50.1