list<string> Enums = enums;
}
+// This handles one spelling of an attribute.
+class Spelling<string name, string variety> {
+ string Name = name;
+ string Variety = variety;
+}
+
+class GNU<string name> : Spelling<name, "GNU">;
+class Declspec<string name> : Spelling<name, "Declspec">;
+class CXX11<string namespace, string name> : Spelling<name, "CXX11"> {
+ string Namespace = namespace;
+}
+
class Attr {
// The various ways in which an attribute can be spelled in source
- list<string> Spellings;
+ list<Spelling> Spellings;
// The things to which an attribute can appertain
list<AttrSubject> Subjects;
// The arguments allowed on an attribute
list<Argument> Args = [];
- // The namespaces in which the attribute appears in C++0x attributes.
- // The attribute will not be permitted in C++0x attribute-specifiers if
- // this is empty; the empty string can be used as a namespace.
- list<string> Namespaces = [];
// Set to true for attributes with arguments which require delayed parsing.
bit LateParsed = 0;
// Set to false to prevent an attribute from being propagated from a template
//
def AddressSpace : Attr {
- let Spellings = ["address_space"];
+ let Spellings = [GNU<"address_space">];
let Args = [IntArgument<"AddressSpace">];
let ASTNode = 0;
}
def Alias : InheritableAttr {
- let Spellings = ["alias"];
+ let Spellings = [GNU<"alias">];
let Args = [StringArgument<"Aliasee">];
}
def Aligned : InheritableAttr {
- let Spellings = ["aligned", "align"];
+ let Spellings = [GNU<"aligned">, GNU<"align">];
let Subjects = [NonBitField, NormalVar, Tag];
let Args = [AlignedArgument<"Alignment">];
- let Namespaces = ["", "std"];
}
def AlignMac68k : InheritableAttr {
}
def AllocSize : Attr {
- let Spellings = ["alloc_size"];
+ let Spellings = [GNU<"alloc_size">];
let Args = [VariadicUnsignedArgument<"Args">];
}
def AlwaysInline : InheritableAttr {
- let Spellings = ["always_inline"];
+ let Spellings = [GNU<"always_inline">];
}
def AnalyzerNoReturn : InheritableAttr {
- let Spellings = ["analyzer_noreturn"];
+ let Spellings = [GNU<"analyzer_noreturn">];
}
def Annotate : InheritableParamAttr {
- let Spellings = ["annotate"];
+ let Spellings = [GNU<"annotate">];
let Args = [StringArgument<"Annotation">];
}
}
def Availability : InheritableAttr {
- let Spellings = ["availability"];
+ let Spellings = [GNU<"availability">];
let Args = [IdentifierArgument<"platform">, VersionArgument<"introduced">,
VersionArgument<"deprecated">, VersionArgument<"obsoleted">,
BoolArgument<"unavailable">, StringArgument<"message">];
} }];
}
-def BaseCheck : Attr {
- let Spellings = ["base_check"];
- let ASTNode = 0;
-}
-
def Blocks : InheritableAttr {
- let Spellings = ["blocks"];
+ let Spellings = [GNU<"blocks">];
let Args = [EnumArgument<"Type", "BlockType", ["byref"], ["ByRef"]>];
}
def Bounded : Attr {
- let Spellings = ["bounded"];
+ let Spellings = [GNU<"bounded">];
let ASTNode = 0;
let SemaHandler = 0;
let Ignored = 1;
}
def CarriesDependency : InheritableParamAttr {
- let Spellings = ["carries_dependency"];
+ let Spellings = [GNU<"carries_dependency">, CXX11<"","carries_dependency">,
+ CXX11<"std","carries_dependency">];
let Subjects = [ParmVar, Function];
- let Namespaces = ["", "std"];
}
def CDecl : InheritableAttr {
- let Spellings = ["cdecl", "__cdecl"];
+ let Spellings = [GNU<"cdecl">, GNU<"__cdecl">];
}
// cf_audited_transfer indicates that the given function has been
// cf_returns_retained attributes. It is generally applied by
// '#pragma clang arc_cf_code_audited' rather than explicitly.
def CFAuditedTransfer : InheritableAttr {
- let Spellings = ["cf_audited_transfer"];
+ let Spellings = [GNU<"cf_audited_transfer">];
let Subjects = [Function];
}
// It indicates that the function has unknown or unautomatable
// transfer semantics.
def CFUnknownTransfer : InheritableAttr {
- let Spellings = ["cf_unknown_transfer"];
+ let Spellings = [GNU<"cf_unknown_transfer">];
let Subjects = [Function];
}
def CFReturnsAutoreleased : Attr {
- let Spellings = ["cf_returns_autoreleased"];
+ let Spellings = [GNU<"cf_returns_autoreleased">];
let ASTNode = 0;
}
def CFReturnsRetained : InheritableAttr {
- let Spellings = ["cf_returns_retained"];
+ let Spellings = [GNU<"cf_returns_retained">];
let Subjects = [ObjCMethod, Function];
}
def CFReturnsNotRetained : InheritableAttr {
- let Spellings = ["cf_returns_not_retained"];
+ let Spellings = [GNU<"cf_returns_not_retained">];
let Subjects = [ObjCMethod, Function];
}
def CFConsumed : InheritableParamAttr {
- let Spellings = ["cf_consumed"];
+ let Spellings = [GNU<"cf_consumed">];
let Subjects = [ParmVar];
}
def Cleanup : InheritableAttr {
- let Spellings = ["cleanup"];
+ let Spellings = [GNU<"cleanup">];
let Args = [FunctionArgument<"FunctionDecl">];
}
def Cold : InheritableAttr {
- let Spellings = ["cold"];
+ let Spellings = [GNU<"cold">];
}
def Common : InheritableAttr {
- let Spellings = ["common"];
+ let Spellings = [GNU<"common">];
}
def Const : InheritableAttr {
- let Spellings = ["const", "__const"];
+ let Spellings = [GNU<"const">, GNU<"__const">];
}
def Constructor : InheritableAttr {
- let Spellings = ["constructor"];
+ let Spellings = [GNU<"constructor">];
let Args = [IntArgument<"Priority">];
}
def CUDAConstant : InheritableAttr {
- let Spellings = ["constant"];
+ let Spellings = [GNU<"constant">];
}
def CUDADevice : InheritableAttr {
- let Spellings = ["device"];
+ let Spellings = [GNU<"device">];
}
def CUDAGlobal : InheritableAttr {
- let Spellings = ["global"];
+ let Spellings = [GNU<"global">];
}
def CUDAHost : InheritableAttr {
- let Spellings = ["host"];
+ let Spellings = [GNU<"host">];
}
def CUDALaunchBounds : InheritableAttr {
- let Spellings = ["launch_bounds"];
+ let Spellings = [GNU<"launch_bounds">];
let Args = [IntArgument<"MaxThreads">, DefaultIntArgument<"MinBlocks", 0>];
}
def CUDAShared : InheritableAttr {
- let Spellings = ["shared"];
+ let Spellings = [GNU<"shared">];
}
def OpenCLKernel : Attr {
- let Spellings = ["opencl_kernel_function"];
+ let Spellings = [GNU<"opencl_kernel_function">];
}
def OpenCLImageAccess : Attr {
- let Spellings = ["opencl_image_access"];
+ let Spellings = [GNU<"opencl_image_access">];
let Args = [IntArgument<"Access">];
let ASTNode = 0;
}
def Deprecated : InheritableAttr {
- let Spellings = ["deprecated"];
+ let Spellings = [GNU<"deprecated">];
let Args = [StringArgument<"Message">];
}
def Destructor : InheritableAttr {
- let Spellings = ["destructor"];
+ let Spellings = [GNU<"destructor">];
let Args = [IntArgument<"Priority">];
}
def ExtVectorType : Attr {
- let Spellings = ["ext_vector_type"];
+ let Spellings = [GNU<"ext_vector_type">];
let Args = [ExprArgument<"NumElements">];
let ASTNode = 0;
}
def FallThrough : Attr {
- let Namespaces = ["clang"];
- let Spellings = ["fallthrough"];
+ let Spellings = [GNU<"fallthrough">, CXX11<"clang","fallthrough">];
let Subjects = [NullStmt];
}
def FastCall : InheritableAttr {
- let Spellings = ["fastcall", "__fastcall"];
+ let Spellings = [GNU<"fastcall">, GNU<"__fastcall">];
}
-def Final : InheritableAttr {
+def Final : InheritableAttr {
let Spellings = [];
let SemaHandler = 0;
}
def Format : InheritableAttr {
- let Spellings = ["format"];
+ let Spellings = [GNU<"format">];
let Args = [StringArgument<"Type">, IntArgument<"FormatIdx">,
IntArgument<"FirstArg">];
}
def FormatArg : InheritableAttr {
- let Spellings = ["format_arg"];
+ let Spellings = [GNU<"format_arg">];
let Args = [IntArgument<"FormatIdx">];
}
def GNUInline : InheritableAttr {
- let Spellings = ["gnu_inline"];
+ let Spellings = [GNU<"gnu_inline">];
}
def Hot : InheritableAttr {
- let Spellings = ["hot"];
+ let Spellings = [GNU<"hot">];
}
def IBAction : InheritableAttr {
- let Spellings = ["ibaction"];
+ let Spellings = [GNU<"ibaction">];
}
def IBOutlet : InheritableAttr {
- let Spellings = ["iboutlet"];
+ let Spellings = [GNU<"iboutlet">];
}
def IBOutletCollection : InheritableAttr {
- let Spellings = ["iboutletcollection"];
+ let Spellings = [GNU<"iboutletcollection">];
let Args = [TypeArgument<"Interface">, SourceLocArgument<"InterfaceLoc">];
}
def Malloc : InheritableAttr {
- let Spellings = ["malloc"];
+ let Spellings = [GNU<"malloc">];
}
def MaxFieldAlignment : InheritableAttr {
}
def MayAlias : InheritableAttr {
- let Spellings = ["may_alias"];
+ let Spellings = [GNU<"may_alias">];
}
def MSP430Interrupt : InheritableAttr {
}
def Mode : Attr {
- let Spellings = ["mode"];
+ let Spellings = [GNU<"mode">];
let Args = [IdentifierArgument<"Mode">];
let ASTNode = 0;
}
def Naked : InheritableAttr {
- let Spellings = ["naked"];
+ let Spellings = [GNU<"naked">];
}
def NeonPolyVectorType : Attr {
- let Spellings = ["neon_polyvector_type"];
+ let Spellings = [GNU<"neon_polyvector_type">];
let Args = [IntArgument<"NumElements">];
let ASTNode = 0;
}
def NeonVectorType : Attr {
- let Spellings = ["neon_vector_type"];
+ let Spellings = [GNU<"neon_vector_type">];
let Args = [IntArgument<"NumElements">];
let ASTNode = 0;
}
def ReturnsTwice : InheritableAttr {
- let Spellings = ["returns_twice"];
+ let Spellings = [GNU<"returns_twice">];
}
def NoCommon : InheritableAttr {
- let Spellings = ["nocommon"];
+ let Spellings = [GNU<"nocommon">];
}
def NoDebug : InheritableAttr {
- let Spellings = ["nodebug"];
+ let Spellings = [GNU<"nodebug">];
}
def NoInline : InheritableAttr {
- let Spellings = ["noinline"];
+ let Spellings = [GNU<"noinline">];
}
def NonNull : InheritableAttr {
- let Spellings = ["nonnull"];
+ let Spellings = [GNU<"nonnull">];
let Args = [VariadicUnsignedArgument<"Args">];
let AdditionalMembers =
[{bool isNonNull(unsigned idx) const {
}
def NoReturn : InheritableAttr {
- let Spellings = ["noreturn"];
+ let Spellings = [GNU<"noreturn">, CXX11<"","noreturn">,
+ CXX11<"std","noreturn">];
// FIXME: Does GCC allow this on the function instead?
let Subjects = [Function];
- let Namespaces = ["", "std"];
}
def NoInstrumentFunction : InheritableAttr {
- let Spellings = ["no_instrument_function"];
+ let Spellings = [GNU<"no_instrument_function">];
let Subjects = [Function];
}
def NoThrow : InheritableAttr {
- let Spellings = ["nothrow"];
+ let Spellings = [GNU<"nothrow">];
}
def NSBridged : InheritableAttr {
- let Spellings = ["ns_bridged"];
+ let Spellings = [GNU<"ns_bridged">];
let Subjects = [Record];
let Args = [IdentifierArgument<"BridgedType">];
}
def NSReturnsRetained : InheritableAttr {
- let Spellings = ["ns_returns_retained"];
+ let Spellings = [GNU<"ns_returns_retained">];
let Subjects = [ObjCMethod, Function];
}
def NSReturnsNotRetained : InheritableAttr {
- let Spellings = ["ns_returns_not_retained"];
+ let Spellings = [GNU<"ns_returns_not_retained">];
let Subjects = [ObjCMethod, Function];
}
def NSReturnsAutoreleased : InheritableAttr {
- let Spellings = ["ns_returns_autoreleased"];
+ let Spellings = [GNU<"ns_returns_autoreleased">];
let Subjects = [ObjCMethod, Function];
}
def NSConsumesSelf : InheritableAttr {
- let Spellings = ["ns_consumes_self"];
+ let Spellings = [GNU<"ns_consumes_self">];
let Subjects = [ObjCMethod];
}
def NSConsumed : InheritableParamAttr {
- let Spellings = ["ns_consumed"];
+ let Spellings = [GNU<"ns_consumed">];
let Subjects = [ParmVar];
}
def ObjCException : InheritableAttr {
- let Spellings = ["objc_exception"];
+ let Spellings = [GNU<"objc_exception">];
}
def ObjCMethodFamily : InheritableAttr {
- let Spellings = ["objc_method_family"];
+ let Spellings = [GNU<"objc_method_family">];
let Subjects = [ObjCMethod];
let Args = [EnumArgument<"Family", "FamilyKind",
["none", "alloc", "copy", "init", "mutableCopy", "new"],
}
def ObjCNSObject : InheritableAttr {
- let Spellings = ["NSObject"];
+ let Spellings = [GNU<"NSObject">];
}
def ObjCPreciseLifetime : Attr {
- let Spellings = ["objc_precise_lifetime"];
+ let Spellings = [GNU<"objc_precise_lifetime">];
let Subjects = [Var];
}
def ObjCReturnsInnerPointer : Attr {
- let Spellings = ["objc_returns_inner_pointer"];
+ let Spellings = [GNU<"objc_returns_inner_pointer">];
let Subjects = [ObjCMethod];
}
def ObjCRootClass : Attr {
- let Spellings = ["objc_root_class"];
+ let Spellings = [GNU<"objc_root_class">];
let Subjects = [ObjCInterface];
}
def Overloadable : Attr {
- let Spellings = ["overloadable"];
+ let Spellings = [GNU<"overloadable">];
}
def Override : InheritableAttr {
}
def Ownership : InheritableAttr {
- let Spellings = ["ownership_holds", "ownership_returns", "ownership_takes"];
+ let Spellings = [GNU<"ownership_holds">, GNU<"ownership_returns">,
+ GNU<"ownership_takes">];
let DistinctSpellings = 1;
let Args = [EnumArgument<"OwnKind", "OwnershipKind",
["ownership_holds", "ownership_returns", "ownership_takes"],
}
def Packed : InheritableAttr {
- let Spellings = ["packed"];
+ let Spellings = [GNU<"packed">];
}
def Pcs : InheritableAttr {
- let Spellings = ["pcs"];
+ let Spellings = [GNU<"pcs">];
let Args = [EnumArgument<"PCS", "PCSType",
["aapcs", "aapcs-vfp"],
["AAPCS", "AAPCS_VFP"]>];
}
def Pure : InheritableAttr {
- let Spellings = ["pure"];
+ let Spellings = [GNU<"pure">];
}
def Regparm : InheritableAttr {
- let Spellings = ["regparm"];
+ let Spellings = [GNU<"regparm">];
let Args = [UnsignedArgument<"NumParams">];
}
def ReqdWorkGroupSize : InheritableAttr {
- let Spellings = ["reqd_work_group_size"];
+ let Spellings = [GNU<"reqd_work_group_size">];
let Args = [UnsignedArgument<"XDim">, UnsignedArgument<"YDim">,
UnsignedArgument<"ZDim">];
}
def InitPriority : InheritableAttr {
- let Spellings = ["init_priority"];
+ let Spellings = [GNU<"init_priority">];
let Args = [UnsignedArgument<"Priority">];
}
def Section : InheritableAttr {
- let Spellings = ["section"];
+ let Spellings = [GNU<"section">];
let Args = [StringArgument<"Name">];
}
def Sentinel : InheritableAttr {
- let Spellings = ["sentinel"];
+ let Spellings = [GNU<"sentinel">];
let Args = [DefaultIntArgument<"Sentinel", 0>,
DefaultIntArgument<"NullPos", 0>];
}
def StdCall : InheritableAttr {
- let Spellings = ["stdcall", "__stdcall"];
+ let Spellings = [GNU<"stdcall">, GNU<"__stdcall">];
}
def ThisCall : InheritableAttr {
- let Spellings = ["thiscall", "__thiscall"];
+ let Spellings = [GNU<"thiscall">, GNU<"__thiscall">];
}
def Pascal : InheritableAttr {
- let Spellings = ["pascal", "__pascal"];
+ let Spellings = [GNU<"pascal">];
}
def TransparentUnion : InheritableAttr {
- let Spellings = ["transparent_union"];
+ let Spellings = [GNU<"transparent_union">];
}
def Unavailable : InheritableAttr {
- let Spellings = ["unavailable"];
+ let Spellings = [GNU<"unavailable">];
let Args = [StringArgument<"Message">];
}
def ArcWeakrefUnavailable : InheritableAttr {
- let Spellings = ["objc_arc_weak_reference_unavailable"];
+ let Spellings = [GNU<"objc_arc_weak_reference_unavailable">];
let Subjects = [ObjCInterface];
}
def ObjCGC : Attr {
- let Spellings = ["objc_gc"];
+ let Spellings = [GNU<"objc_gc">];
let Args = [IdentifierArgument<"Kind">];
let ASTNode = 0;
}
def ObjCOwnership : Attr {
- let Spellings = ["objc_ownership"];
+ let Spellings = [GNU<"objc_ownership">];
let Args = [IdentifierArgument<"Kind">];
let ASTNode = 0;
}
def ObjCRequiresPropertyDefs : InheritableAttr {
- let Spellings = ["objc_requires_property_definitions"];
+ let Spellings = [GNU<"objc_requires_property_definitions">];
let Subjects = [ObjCInterface];
}
def Unused : InheritableAttr {
- let Spellings = ["unused"];
+ let Spellings = [GNU<"unused">];
}
def Used : InheritableAttr {
- let Spellings = ["used"];
+ let Spellings = [GNU<"used">];
}
def Uuid : InheritableAttr {
- let Spellings = ["uuid"];
+ let Spellings = [GNU<"uuid">];
let Args = [StringArgument<"Guid">];
let Subjects = [CXXRecord];
}
def VectorSize : Attr {
- let Spellings = ["vector_size"];
+ let Spellings = [GNU<"vector_size">];
let Args = [ExprArgument<"NumBytes">];
let ASTNode = 0;
}
def VecTypeHint : Attr {
- let Spellings = ["vec_type_hint"];
+ let Spellings = [GNU<"vec_type_hint">];
let ASTNode = 0;
let SemaHandler = 0;
let Ignored = 1;
def Visibility : InheritableAttr {
let Clone = 0;
- let Spellings = ["visibility"];
+ let Spellings = [GNU<"visibility">];
let Args = [EnumArgument<"Visibility", "VisibilityType",
["default", "hidden", "internal", "protected"],
["Default", "Hidden", "Hidden", "Protected"]>];
}
def VecReturn : InheritableAttr {
- let Spellings = ["vecreturn"];
+ let Spellings = [GNU<"vecreturn">];
let Subjects = [CXXRecord];
}
def WarnUnusedResult : InheritableAttr {
- let Spellings = ["warn_unused_result"];
+ let Spellings = [GNU<"warn_unused_result">];
}
def Weak : InheritableAttr {
- let Spellings = ["weak"];
+ let Spellings = [GNU<"weak">];
}
def WeakImport : InheritableAttr {
- let Spellings = ["weak_import"];
+ let Spellings = [GNU<"weak_import">];
}
def WeakRef : InheritableAttr {
- let Spellings = ["weakref"];
+ let Spellings = [GNU<"weakref">];
}
def X86ForceAlignArgPointer : InheritableAttr {
// AddressSafety attribute (e.g. for AddressSanitizer)
def NoAddressSafetyAnalysis : InheritableAttr {
- let Spellings = ["no_address_safety_analysis"];
+ let Spellings = [GNU<"no_address_safety_analysis">];
}
// C/C++ Thread safety attributes (e.g. for deadlock, data race checking)
def GuardedVar : InheritableAttr {
- let Spellings = ["guarded_var"];
+ let Spellings = [GNU<"guarded_var">];
}
def PtGuardedVar : InheritableAttr {
- let Spellings = ["pt_guarded_var"];
+ let Spellings = [GNU<"pt_guarded_var">];
}
def Lockable : InheritableAttr {
- let Spellings = ["lockable"];
+ let Spellings = [GNU<"lockable">];
}
def ScopedLockable : InheritableAttr {
- let Spellings = ["scoped_lockable"];
+ let Spellings = [GNU<"scoped_lockable">];
}
def NoThreadSafetyAnalysis : InheritableAttr {
- let Spellings = ["no_thread_safety_analysis"];
+ let Spellings = [GNU<"no_thread_safety_analysis">];
}
def GuardedBy : InheritableAttr {
- let Spellings = ["guarded_by"];
+ let Spellings = [GNU<"guarded_by">];
let Args = [ExprArgument<"Arg">];
let LateParsed = 1;
let TemplateDependent = 1;
}
def PtGuardedBy : InheritableAttr {
- let Spellings = ["pt_guarded_by"];
+ let Spellings = [GNU<"pt_guarded_by">];
let Args = [ExprArgument<"Arg">];
let LateParsed = 1;
let TemplateDependent = 1;
}
def AcquiredAfter : InheritableAttr {
- let Spellings = ["acquired_after"];
+ let Spellings = [GNU<"acquired_after">];
let Args = [VariadicExprArgument<"Args">];
let LateParsed = 1;
let TemplateDependent = 1;
}
def AcquiredBefore : InheritableAttr {
- let Spellings = ["acquired_before"];
+ let Spellings = [GNU<"acquired_before">];
let Args = [VariadicExprArgument<"Args">];
let LateParsed = 1;
let TemplateDependent = 1;
}
def ExclusiveLockFunction : InheritableAttr {
- let Spellings = ["exclusive_lock_function"];
+ let Spellings = [GNU<"exclusive_lock_function">];
let Args = [VariadicExprArgument<"Args">];
let LateParsed = 1;
let TemplateDependent = 1;
}
def SharedLockFunction : InheritableAttr {
- let Spellings = ["shared_lock_function"];
+ let Spellings = [GNU<"shared_lock_function">];
let Args = [VariadicExprArgument<"Args">];
let LateParsed = 1;
let TemplateDependent = 1;
// The first argument is an integer or boolean value specifying the return value
// of a successful lock acquisition.
def ExclusiveTrylockFunction : InheritableAttr {
- let Spellings = ["exclusive_trylock_function"];
+ let Spellings = [GNU<"exclusive_trylock_function">];
let Args = [ExprArgument<"SuccessValue">, VariadicExprArgument<"Args">];
let LateParsed = 1;
let TemplateDependent = 1;
// The first argument is an integer or boolean value specifying the return value
// of a successful lock acquisition.
def SharedTrylockFunction : InheritableAttr {
- let Spellings = ["shared_trylock_function"];
+ let Spellings = [GNU<"shared_trylock_function">];
let Args = [ExprArgument<"SuccessValue">, VariadicExprArgument<"Args">];
let LateParsed = 1;
let TemplateDependent = 1;
}
def UnlockFunction : InheritableAttr {
- let Spellings = ["unlock_function"];
+ let Spellings = [GNU<"unlock_function">];
let Args = [VariadicExprArgument<"Args">];
let LateParsed = 1;
let TemplateDependent = 1;
}
def LockReturned : InheritableAttr {
- let Spellings = ["lock_returned"];
+ let Spellings = [GNU<"lock_returned">];
let Args = [ExprArgument<"Arg">];
let LateParsed = 1;
let TemplateDependent = 1;
}
def LocksExcluded : InheritableAttr {
- let Spellings = ["locks_excluded"];
+ let Spellings = [GNU<"locks_excluded">];
let Args = [VariadicExprArgument<"Args">];
let LateParsed = 1;
let TemplateDependent = 1;
}
def ExclusiveLocksRequired : InheritableAttr {
- let Spellings = ["exclusive_locks_required"];
+ let Spellings = [GNU<"exclusive_locks_required">];
let Args = [VariadicExprArgument<"Args">];
let LateParsed = 1;
let TemplateDependent = 1;
}
def SharedLocksRequired : InheritableAttr {
- let Spellings = ["shared_locks_required"];
+ let Spellings = [GNU<"shared_locks_required">];
let Args = [VariadicExprArgument<"Args">];
let LateParsed = 1;
let TemplateDependent = 1;
// Microsoft-related attributes
def MsStruct : InheritableAttr {
- let Spellings = ["__ms_struct__"];
+ let Spellings = [Declspec<"ms_struct">];
}
def DLLExport : InheritableAttr {
- let Spellings = ["dllexport"];
+ let Spellings = [Declspec<"dllexport">];
}
def DLLImport : InheritableAttr {
- let Spellings = ["dllimport"];
+ let Spellings = [Declspec<"dllimport">];
}
def ForceInline : InheritableAttr {
- let Spellings = ["__forceinline"];
+ let Spellings = [Declspec<"__forceinline">];
}
def Win64 : InheritableAttr {
- let Spellings = ["__w64"];
+ let Spellings = [Declspec<"w64">];
}
def Ptr32 : InheritableAttr {
- let Spellings = ["__ptr32"];
+ let Spellings = [Declspec<"__ptr32">];
}
def Ptr64 : InheritableAttr {
- let Spellings = ["__ptr64"];
+ let Spellings = [Declspec<"__ptr64">];
}
def SingleInheritance : InheritableAttr {
- let Spellings = ["__single_inheritance"];
+ let Spellings = [Declspec<"__single_inheritance">];
}
def MultipleInheritance : InheritableAttr {
- let Spellings = ["__multiple_inheritance"];
+ let Spellings = [Declspec<"__multiple_inheritance">];
}
def VirtualInheritance : InheritableAttr {
- let Spellings = ["__virtual_inheritance"];
+ let Spellings = [Declspec<"__virtual_inheritance">];
}
}
const AvailabilityChange &getAvailabilityIntroduced() const {
- assert(getKind() == AT_availability && "Not an availability attribute");
+ assert(getKind() == AT_Availability && "Not an availability attribute");
return getAvailabilitySlot(IntroducedSlot);
}
const AvailabilityChange &getAvailabilityDeprecated() const {
- assert(getKind() == AT_availability && "Not an availability attribute");
+ assert(getKind() == AT_Availability && "Not an availability attribute");
return getAvailabilitySlot(DeprecatedSlot);
}
const AvailabilityChange &getAvailabilityObsoleted() const {
- assert(getKind() == AT_availability && "Not an availability attribute");
+ assert(getKind() == AT_Availability && "Not an availability attribute");
return getAvailabilitySlot(ObsoletedSlot);
}
SourceLocation getUnavailableLoc() const {
- assert(getKind() == AT_availability && "Not an availability attribute");
+ assert(getKind() == AT_Availability && "Not an availability attribute");
return UnavailableLoc;
}
const Expr * getMessageExpr() const {
- assert(getKind() == AT_availability && "Not an availability attribute");
+ assert(getKind() == AT_Availability && "Not an availability attribute");
return MessageExpr;
}
};
const CXXRecordDecl *SrcRD =
cast<CXXRecordDecl>(SrcType->castAs<RecordType>()->getDecl());
- if (!SrcRD->hasAttr<FinalAttr>())
- return false;
-
const CXXRecordDecl *DestRD =
cast<CXXRecordDecl>(DestType->castAs<RecordType>()->getDecl());
if (Name.startswith("__") && Name.endswith("__") && Name.size() >= 4)
Name = Name.substr(2, Name.size() - 4);
+ // FIXME: Do we need to handle namespaces here?
return llvm::StringSwitch<bool>(Name)
#include "clang/Lex/AttrSpellings.inc"
.Default(false);
Attrs.addNew(AttrName, SourceRange(AttrNameLoc, RParen), 0, AttrNameLoc,
ParmName, ParmLoc, ArgExprs.take(), ArgExprs.size(),
AttributeList::AS_GNU);
- if (BuiltinType && attr->getKind() == AttributeList::AT_iboutletcollection)
+ if (BuiltinType && attr->getKind() == AttributeList::AT_IBOutletCollection)
Diag(Tok, diag::err_iboutletcollection_builtintype);
}
}
ExprVector ArgExprs(Actions);
ArgExprs.push_back(ArgExpr.release());
+ // FIXME: This should not be GNU, but we since the attribute used is
+ // based on the spelling, and there is no true spelling for
+ // C++11 attributes, this isn't accepted.
Attrs.addNew(PP.getIdentifierInfo("aligned"), KWLoc, 0, KWLoc,
0, T.getOpenLocation(), ArgExprs.take(), 1,
- AttributeList::AS_CXX11);
+ AttributeList::AS_GNU);
}
/// ParseDeclarationSpecifiers
switch (AttributeList::getKind(AttrName, ScopeName,
AttributeList::AS_CXX11)) {
// No arguments
- case AttributeList::AT_carries_dependency:
+ case AttributeList::AT_CarriesDependency:
// FIXME: implement generic support of attributes with C++11 syntax
// see Parse/ParseDecl.cpp: ParseGNUAttributes
- case AttributeList::AT_fallthrough:
- case AttributeList::AT_noreturn: {
+ case AttributeList::AT_FallThrough:
+ case AttributeList::AT_NoReturn: {
if (Tok.is(tok::l_paren)) {
Diag(Tok.getLocation(), diag::err_cxx11_attribute_forbids_arguments)
<< AttrName->getName();
writtenBS.ModeAttr = false;
AttributeList* attrs = getAttributes().getList();
while (attrs) {
- if (attrs->getKind() == AttributeList::AT_mode) {
+ if (attrs->getKind() == AttributeList::AT_Mode) {
writtenBS.ModeAttr = true;
break;
}
}
switch (Attr.getKind()) {
- case AttributeList::AT_fastcall:
+ case AttributeList::AT_FastCall:
D->addAttr(::new (S.Context) FastCallAttr(Attr.getRange(), S.Context));
return;
- case AttributeList::AT_stdcall:
+ case AttributeList::AT_StdCall:
D->addAttr(::new (S.Context) StdCallAttr(Attr.getRange(), S.Context));
return;
- case AttributeList::AT_thiscall:
+ case AttributeList::AT_ThisCall:
D->addAttr(::new (S.Context) ThisCallAttr(Attr.getRange(), S.Context));
return;
- case AttributeList::AT_cdecl:
+ case AttributeList::AT_CDecl:
D->addAttr(::new (S.Context) CDeclAttr(Attr.getRange(), S.Context));
return;
- case AttributeList::AT_pascal:
+ case AttributeList::AT_Pascal:
D->addAttr(::new (S.Context) PascalAttr(Attr.getRange(), S.Context));
return;
- case AttributeList::AT_pcs: {
+ case AttributeList::AT_Pcs: {
Expr *Arg = Attr.getArg(0);
StringLiteral *Str = dyn_cast<StringLiteral>(Arg);
if (!Str || !Str->isAscii()) {
return true;
if ((attr.getNumArgs() != 0 &&
- !(attr.getKind() == AttributeList::AT_pcs && attr.getNumArgs() == 1)) ||
+ !(attr.getKind() == AttributeList::AT_Pcs && attr.getNumArgs() == 1)) ||
attr.getParameterName()) {
Diag(attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0;
attr.setInvalid();
// TODO: diagnose uses of these conventions on the wrong target. Or, better
// move to TargetAttributesSema one day.
switch (attr.getKind()) {
- case AttributeList::AT_cdecl: CC = CC_C; break;
- case AttributeList::AT_fastcall: CC = CC_X86FastCall; break;
- case AttributeList::AT_stdcall: CC = CC_X86StdCall; break;
- case AttributeList::AT_thiscall: CC = CC_X86ThisCall; break;
- case AttributeList::AT_pascal: CC = CC_X86Pascal; break;
- case AttributeList::AT_pcs: {
+ case AttributeList::AT_CDecl: CC = CC_C; break;
+ case AttributeList::AT_FastCall: CC = CC_X86FastCall; break;
+ case AttributeList::AT_StdCall: CC = CC_X86StdCall; break;
+ case AttributeList::AT_ThisCall: CC = CC_X86ThisCall; break;
+ case AttributeList::AT_Pascal: CC = CC_X86Pascal; break;
+ case AttributeList::AT_Pcs: {
Expr *Arg = attr.getArg(0);
StringLiteral *Str = dyn_cast<StringLiteral>(Arg);
if (!Str || !Str->isAscii()) {
}
bool typeOK, cf;
- if (Attr.getKind() == AttributeList::AT_ns_consumed) {
+ if (Attr.getKind() == AttributeList::AT_NSConsumed) {
typeOK = isValidSubjectOfNSAttribute(S, param->getType());
cf = false;
} else {
else if (ObjCPropertyDecl *PD = dyn_cast<ObjCPropertyDecl>(D))
returnType = PD->getType();
else if (S.getLangOpts().ObjCAutoRefCount && hasDeclarator(D) &&
- (Attr.getKind() == AttributeList::AT_ns_returns_retained))
+ (Attr.getKind() == AttributeList::AT_NSReturnsRetained))
return; // ignore: was handled as a type attribute
else if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D))
returnType = FD->getResultType();
bool cf;
switch (Attr.getKind()) {
default: llvm_unreachable("invalid ownership attribute");
- case AttributeList::AT_ns_returns_autoreleased:
- case AttributeList::AT_ns_returns_retained:
- case AttributeList::AT_ns_returns_not_retained:
+ case AttributeList::AT_NSReturnsAutoreleased:
+ case AttributeList::AT_NSReturnsRetained:
+ case AttributeList::AT_NSReturnsNotRetained:
typeOK = isValidSubjectOfNSAttribute(S, returnType);
cf = false;
break;
- case AttributeList::AT_cf_returns_retained:
- case AttributeList::AT_cf_returns_not_retained:
+ case AttributeList::AT_CFReturnsRetained:
+ case AttributeList::AT_CFReturnsNotRetained:
typeOK = isValidSubjectOfCFAttribute(S, returnType);
cf = true;
break;
switch (Attr.getKind()) {
default:
llvm_unreachable("invalid ownership attribute");
- case AttributeList::AT_ns_returns_autoreleased:
+ case AttributeList::AT_NSReturnsAutoreleased:
D->addAttr(::new (S.Context) NSReturnsAutoreleasedAttr(Attr.getRange(),
S.Context));
return;
- case AttributeList::AT_cf_returns_not_retained:
+ case AttributeList::AT_CFReturnsNotRetained:
D->addAttr(::new (S.Context) CFReturnsNotRetainedAttr(Attr.getRange(),
S.Context));
return;
- case AttributeList::AT_ns_returns_not_retained:
+ case AttributeList::AT_NSReturnsNotRetained:
D->addAttr(::new (S.Context) NSReturnsNotRetainedAttr(Attr.getRange(),
S.Context));
return;
- case AttributeList::AT_cf_returns_retained:
+ case AttributeList::AT_CFReturnsRetained:
D->addAttr(::new (S.Context) CFReturnsRetainedAttr(Attr.getRange(),
S.Context));
return;
- case AttributeList::AT_ns_returns_retained:
+ case AttributeList::AT_NSReturnsRetained:
D->addAttr(::new (S.Context) NSReturnsRetainedAttr(Attr.getRange(),
S.Context));
return;
return;
}
- bool IsAudited = (A.getKind() == AttributeList::AT_cf_audited_transfer);
+ bool IsAudited = (A.getKind() == AttributeList::AT_CFAuditedTransfer);
// Check whether there's a conflicting attribute already present.
Attr *Existing;
switch (Attr.getKind()) {
default:
return false;
- case AttributeList::AT_dllimport:
- case AttributeList::AT_dllexport:
- case AttributeList::AT_uuid:
- case AttributeList::AT_deprecated:
- case AttributeList::AT_noreturn:
- case AttributeList::AT_nothrow:
- case AttributeList::AT_naked:
- case AttributeList::AT_noinline:
+ case AttributeList::AT_DLLImport:
+ case AttributeList::AT_DLLExport:
+ case AttributeList::AT_Uuid:
+ case AttributeList::AT_Deprecated:
+ case AttributeList::AT_NoReturn:
+ case AttributeList::AT_NoThrow:
+ case AttributeList::AT_Naked:
+ case AttributeList::AT_NoInline:
return true;
}
}
static void handleInheritanceAttr(Sema &S, Decl *D, const AttributeList &Attr) {
if (S.LangOpts.MicrosoftExt) {
AttributeList::Kind Kind = Attr.getKind();
- if (Kind == AttributeList::AT_single_inheritance)
+ if (Kind == AttributeList::AT_SingleInheritance)
D->addAttr(
::new (S.Context) SingleInheritanceAttr(Attr.getRange(), S.Context));
- else if (Kind == AttributeList::AT_multiple_inheritance)
+ else if (Kind == AttributeList::AT_MultipleInheritance)
D->addAttr(
::new (S.Context) MultipleInheritanceAttr(Attr.getRange(), S.Context));
- else if (Kind == AttributeList::AT_virtual_inheritance)
+ else if (Kind == AttributeList::AT_VirtualInheritance)
D->addAttr(
::new (S.Context) VirtualInheritanceAttr(Attr.getRange(), S.Context));
} else
static void handlePortabilityAttr(Sema &S, Decl *D, const AttributeList &Attr) {
if (S.LangOpts.MicrosoftExt) {
AttributeList::Kind Kind = Attr.getKind();
- if (Kind == AttributeList::AT_ptr32)
+ if (Kind == AttributeList::AT_Ptr32)
D->addAttr(
::new (S.Context) Ptr32Attr(Attr.getRange(), S.Context));
- else if (Kind == AttributeList::AT_ptr64)
+ else if (Kind == AttributeList::AT_Ptr64)
D->addAttr(
::new (S.Context) Ptr64Attr(Attr.getRange(), S.Context));
- else if (Kind == AttributeList::AT_w64)
+ else if (Kind == AttributeList::AT_Win64)
D->addAttr(
::new (S.Context) Win64Attr(Attr.getRange(), S.Context));
} else
static void ProcessNonInheritableDeclAttr(Sema &S, Scope *scope, Decl *D,
const AttributeList &Attr) {
switch (Attr.getKind()) {
- case AttributeList::AT_device: handleDeviceAttr (S, D, Attr); break;
- case AttributeList::AT_host: handleHostAttr (S, D, Attr); break;
- case AttributeList::AT_overloadable:handleOverloadableAttr(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_Overloadable:handleOverloadableAttr(S, D, Attr); break;
default:
break;
}
static void ProcessInheritableDeclAttr(Sema &S, Scope *scope, Decl *D,
const AttributeList &Attr) {
switch (Attr.getKind()) {
- case AttributeList::AT_ibaction: handleIBAction(S, D, Attr); break;
- case AttributeList::AT_iboutlet: handleIBOutlet(S, D, Attr); break;
- case AttributeList::AT_iboutletcollection:
+ case AttributeList::AT_IBAction: handleIBAction(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_address_space:
- case AttributeList::AT_opencl_image_access:
- case AttributeList::AT_objc_gc:
- case AttributeList::AT_vector_size:
- case AttributeList::AT_neon_vector_type:
- case AttributeList::AT_neon_polyvector_type:
+ case AttributeList::AT_AddressSpace:
+ case AttributeList::AT_OpenCLImageAccess:
+ case AttributeList::AT_ObjCGC:
+ case AttributeList::AT_VectorSize:
+ case AttributeList::AT_NeonVectorType:
+ case AttributeList::AT_NeonPolyVectorType:
// Ignore these, these are type attributes, handled by
// ProcessTypeAttributes.
break;
- case AttributeList::AT_device:
- case AttributeList::AT_host:
- case AttributeList::AT_overloadable:
+ case AttributeList::AT_CUDADevice:
+ case AttributeList::AT_CUDAHost:
+ case AttributeList::AT_Overloadable:
// Ignore, this is a non-inheritable attribute, handled
// by ProcessNonInheritableDeclAttr.
break;
- case AttributeList::AT_alias: handleAliasAttr (S, D, Attr); break;
- case AttributeList::AT_aligned: handleAlignedAttr (S, D, Attr); break;
- case AttributeList::AT_alloc_size: handleAllocSizeAttr (S, D, Attr); break;
- case AttributeList::AT_always_inline:
+ case AttributeList::AT_Alias: handleAliasAttr (S, D, Attr); break;
+ case AttributeList::AT_Aligned: handleAlignedAttr (S, D, Attr); break;
+ case AttributeList::AT_AllocSize: handleAllocSizeAttr (S, D, Attr); break;
+ case AttributeList::AT_AlwaysInline:
handleAlwaysInlineAttr (S, D, Attr); break;
- case AttributeList::AT_analyzer_noreturn:
+ case AttributeList::AT_AnalyzerNoReturn:
handleAnalyzerNoReturnAttr (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_carries_dependency:
+ case AttributeList::AT_Annotate: handleAnnotateAttr (S, D, Attr); break;
+ case AttributeList::AT_Availability:handleAvailabilityAttr(S, D, Attr); break;
+ case AttributeList::AT_CarriesDependency:
handleDependencyAttr (S, D, Attr); break;
- case AttributeList::AT_common: handleCommonAttr (S, D, Attr); break;
- case AttributeList::AT_constant: handleConstantAttr (S, D, Attr); break;
- case AttributeList::AT_constructor: handleConstructorAttr (S, D, Attr); break;
- case AttributeList::AT_deprecated:
+ case AttributeList::AT_Common: handleCommonAttr (S, D, Attr); break;
+ case AttributeList::AT_CUDAConstant:handleConstantAttr (S, D, Attr); break;
+ case AttributeList::AT_Constructor: handleConstructorAttr (S, D, Attr); break;
+ case AttributeList::AT_Deprecated:
handleAttrWithMessage<DeprecatedAttr>(S, D, Attr, "deprecated");
break;
- case AttributeList::AT_destructor: handleDestructorAttr (S, D, Attr); break;
- case AttributeList::AT_ext_vector_type:
+ case AttributeList::AT_Destructor: handleDestructorAttr (S, D, Attr); break;
+ case AttributeList::AT_ExtVectorType:
handleExtVectorTypeAttr(S, scope, D, Attr);
break;
- case AttributeList::AT_format: handleFormatAttr (S, D, Attr); break;
- case AttributeList::AT_format_arg: handleFormatArgAttr (S, D, Attr); break;
- case AttributeList::AT_global: handleGlobalAttr (S, D, Attr); break;
- case AttributeList::AT_gnu_inline: handleGNUInlineAttr (S, D, Attr); break;
- case AttributeList::AT_launch_bounds:
+ 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_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_may_alias: handleMayAliasAttr (S, D, Attr); break;
- case AttributeList::AT_nocommon: handleNoCommonAttr (S, D, Attr); break;
- case AttributeList::AT_nonnull: handleNonNullAttr (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;
+ case AttributeList::AT_NonNull: handleNonNullAttr (S, D, Attr); break;
case AttributeList::AT_ownership_returns:
case AttributeList::AT_ownership_takes:
case AttributeList::AT_ownership_holds:
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: handleNakedAttr (S, D, Attr); break;
- case AttributeList::AT_noreturn: handleNoReturnAttr (S, D, Attr); break;
- case AttributeList::AT_nothrow: handleNothrowAttr (S, D, Attr); break;
- case AttributeList::AT_shared: handleSharedAttr (S, D, Attr); break;
- case AttributeList::AT_vecreturn: handleVecReturnAttr (S, D, Attr); break;
-
- case AttributeList::AT_objc_ownership:
+ case AttributeList::AT_Cold: handleColdAttr (S, D, Attr); break;
+ case AttributeList::AT_Hot: handleHotAttr (S, D, Attr); break;
+ case AttributeList::AT_Naked: handleNakedAttr (S, D, Attr); break;
+ case AttributeList::AT_NoReturn: handleNoReturnAttr (S, D, Attr); break;
+ case AttributeList::AT_NoThrow: handleNothrowAttr (S, D, Attr); break;
+ case AttributeList::AT_CUDAShared: handleSharedAttr (S, D, Attr); break;
+ case AttributeList::AT_VecReturn: handleVecReturnAttr (S, D, Attr); break;
+
+ case AttributeList::AT_ObjCOwnership:
handleObjCOwnershipAttr(S, D, Attr); break;
- case AttributeList::AT_objc_precise_lifetime:
+ case AttributeList::AT_ObjCPreciseLifetime:
handleObjCPreciseLifetimeAttr(S, D, Attr); break;
- case AttributeList::AT_objc_returns_inner_pointer:
+ case AttributeList::AT_ObjCReturnsInnerPointer:
handleObjCReturnsInnerPointerAttr(S, D, Attr); break;
- case AttributeList::AT_ns_bridged:
+ case AttributeList::AT_NSBridged:
handleNSBridgedAttr(S, scope, D, Attr); break;
- case AttributeList::AT_cf_audited_transfer:
- case AttributeList::AT_cf_unknown_transfer:
+ case AttributeList::AT_CFAuditedTransfer:
+ case AttributeList::AT_CFUnknownTransfer:
handleCFTransferAttr(S, D, Attr); break;
// Checker-specific.
- case AttributeList::AT_cf_consumed:
- case AttributeList::AT_ns_consumed: handleNSConsumedAttr (S, D, Attr); break;
- case AttributeList::AT_ns_consumes_self:
+ case AttributeList::AT_CFConsumed:
+ case AttributeList::AT_NSConsumed: handleNSConsumedAttr (S, D, Attr); break;
+ case AttributeList::AT_NSConsumesSelf:
handleNSConsumesSelfAttr(S, D, Attr); break;
- case AttributeList::AT_ns_returns_autoreleased:
- case AttributeList::AT_ns_returns_not_retained:
- case AttributeList::AT_cf_returns_not_retained:
- case AttributeList::AT_ns_returns_retained:
- case AttributeList::AT_cf_returns_retained:
+ 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;
- case AttributeList::AT_reqd_work_group_size:
+ case AttributeList::AT_ReqdWorkGroupSize:
handleReqdWorkGroupSize(S, D, Attr); break;
- case AttributeList::AT_init_priority:
+ 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:
+ case AttributeList::AT_Packed: handlePackedAttr (S, D, Attr); break;
+ case AttributeList::AT_Section: handleSectionAttr (S, D, Attr); break;
+ case AttributeList::AT_Unavailable:
handleAttrWithMessage<UnavailableAttr>(S, D, Attr, "unavailable");
break;
- case AttributeList::AT_objc_arc_weak_reference_unavailable:
+ case AttributeList::AT_ArcWeakrefUnavailable:
handleArcWeakrefUnavailableAttr (S, D, Attr);
break;
- case AttributeList::AT_objc_root_class:
+ case AttributeList::AT_ObjCRootClass:
handleObjCRootClassAttr(S, D, Attr);
break;
- case AttributeList::AT_objc_requires_property_definitions:
+ case AttributeList::AT_ObjCRequiresPropertyDefs:
handleObjCRequiresPropertyDefsAttr (S, D, Attr);
break;
- case AttributeList::AT_unused: handleUnusedAttr (S, D, Attr); break;
- case AttributeList::AT_returns_twice:
+ case AttributeList::AT_Unused: handleUnusedAttr (S, D, Attr); break;
+ case AttributeList::AT_ReturnsTwice:
handleReturnsTwiceAttr(S, D, Attr);
break;
- case AttributeList::AT_used: handleUsedAttr (S, D, Attr); break;
- case AttributeList::AT_visibility: handleVisibilityAttr (S, D, Attr); break;
- case AttributeList::AT_warn_unused_result: handleWarnUnusedResult(S, D, Attr);
+ case AttributeList::AT_Used: handleUsedAttr (S, D, Attr); break;
+ case AttributeList::AT_Visibility: handleVisibilityAttr (S, D, Attr); break;
+ case AttributeList::AT_WarnUnusedResult: handleWarnUnusedResult(S, D, Attr);
break;
- case AttributeList::AT_weak: handleWeakAttr (S, D, Attr); break;
- case AttributeList::AT_weakref: handleWeakRefAttr (S, D, Attr); break;
- case AttributeList::AT_weak_import: handleWeakImportAttr (S, D, Attr); break;
- case AttributeList::AT_transparent_union:
+ case AttributeList::AT_Weak: handleWeakAttr (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_objc_exception:
+ case AttributeList::AT_ObjCException:
handleObjCExceptionAttr(S, D, Attr);
break;
- case AttributeList::AT_objc_method_family:
+ case AttributeList::AT_ObjCMethodFamily:
handleObjCMethodFamilyAttr(S, D, Attr);
break;
- case AttributeList::AT_NSObject: 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: handleConstAttr (S, D, Attr); break;
- case AttributeList::AT_pure: handlePureAttr (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_noinline: handleNoInlineAttr (S, D, Attr); break;
- case AttributeList::AT_regparm: handleRegparmAttr (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: handleConstAttr (S, D, Attr); break;
+ case AttributeList::AT_Pure: handlePureAttr (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_NoInline: handleNoInlineAttr (S, D, Attr); break;
+ case AttributeList::AT_Regparm: handleRegparmAttr (S, D, Attr); break;
case AttributeList::IgnoredAttribute:
// Just ignore
break;
- case AttributeList::AT_no_instrument_function: // Interacts with -pg.
+ case AttributeList::AT_NoInstrumentFunction: // Interacts with -pg.
handleNoInstrumentFunctionAttr(S, D, Attr);
break;
- case AttributeList::AT_stdcall:
- case AttributeList::AT_cdecl:
- case AttributeList::AT_fastcall:
- case AttributeList::AT_thiscall:
- case AttributeList::AT_pascal:
- case AttributeList::AT_pcs:
+ case AttributeList::AT_StdCall:
+ case AttributeList::AT_CDecl:
+ case AttributeList::AT_FastCall:
+ case AttributeList::AT_ThisCall:
+ case AttributeList::AT_Pascal:
+ case AttributeList::AT_Pcs:
handleCallConvAttr(S, D, Attr);
break;
- case AttributeList::AT_opencl_kernel_function:
+ case AttributeList::AT_OpenCLKernel:
handleOpenCLKernelAttr(S, D, Attr);
break;
// Microsoft attributes:
- case AttributeList::AT_ms_struct:
+ case AttributeList::AT_MsStruct:
handleMsStructAttr(S, D, Attr);
break;
- case AttributeList::AT_uuid:
+ case AttributeList::AT_Uuid:
handleUuidAttr(S, D, Attr);
break;
- case AttributeList::AT_single_inheritance:
- case AttributeList::AT_multiple_inheritance:
- case AttributeList::AT_virtual_inheritance:
+ case AttributeList::AT_SingleInheritance:
+ case AttributeList::AT_MultipleInheritance:
+ case AttributeList::AT_VirtualInheritance:
handleInheritanceAttr(S, D, Attr);
break;
- case AttributeList::AT_w64:
- case AttributeList::AT_ptr32:
- case AttributeList::AT_ptr64:
+ case AttributeList::AT_Win64:
+ case AttributeList::AT_Ptr32:
+ case AttributeList::AT_Ptr64:
handlePortabilityAttr(S, D, Attr);
break;
- case AttributeList::AT_forceinline:
+ case AttributeList::AT_ForceInline:
handleForceInlineAttr(S, D, Attr);
break;
// Thread safety attributes:
- case AttributeList::AT_guarded_var:
+ case AttributeList::AT_GuardedVar:
handleGuardedVarAttr(S, D, Attr);
break;
- case AttributeList::AT_pt_guarded_var:
+ case AttributeList::AT_PtGuardedVar:
handleGuardedVarAttr(S, D, Attr, /*pointer = */true);
break;
- case AttributeList::AT_scoped_lockable:
+ case AttributeList::AT_ScopedLockable:
handleLockableAttr(S, D, Attr, /*scoped = */true);
break;
- case AttributeList::AT_no_address_safety_analysis:
+ case AttributeList::AT_NoAddressSafetyAnalysis:
handleNoAddressSafetyAttr(S, D, Attr);
break;
- case AttributeList::AT_no_thread_safety_analysis:
+ case AttributeList::AT_NoThreadSafetyAnalysis:
handleNoThreadSafetyAttr(S, D, Attr);
break;
- case AttributeList::AT_lockable:
+ case AttributeList::AT_Lockable:
handleLockableAttr(S, D, Attr);
break;
- case AttributeList::AT_guarded_by:
+ case AttributeList::AT_GuardedBy:
handleGuardedByAttr(S, D, Attr);
break;
- case AttributeList::AT_pt_guarded_by:
+ case AttributeList::AT_PtGuardedBy:
handleGuardedByAttr(S, D, Attr, /*pointer = */true);
break;
- case AttributeList::AT_exclusive_lock_function:
+ case AttributeList::AT_ExclusiveLockFunction:
handleLockFunAttr(S, D, Attr, /*exclusive = */true);
break;
- case AttributeList::AT_exclusive_locks_required:
+ case AttributeList::AT_ExclusiveLocksRequired:
handleLocksRequiredAttr(S, D, Attr, /*exclusive = */true);
break;
- case AttributeList::AT_exclusive_trylock_function:
+ case AttributeList::AT_ExclusiveTrylockFunction:
handleTrylockFunAttr(S, D, Attr, /*exclusive = */true);
break;
- case AttributeList::AT_lock_returned:
+ case AttributeList::AT_LockReturned:
handleLockReturnedAttr(S, D, Attr);
break;
- case AttributeList::AT_locks_excluded:
+ case AttributeList::AT_LocksExcluded:
handleLocksExcludedAttr(S, D, Attr);
break;
- case AttributeList::AT_shared_lock_function:
+ case AttributeList::AT_SharedLockFunction:
handleLockFunAttr(S, D, Attr);
break;
- case AttributeList::AT_shared_locks_required:
+ case AttributeList::AT_SharedLocksRequired:
handleLocksRequiredAttr(S, D, Attr);
break;
- case AttributeList::AT_shared_trylock_function:
+ case AttributeList::AT_SharedTrylockFunction:
handleTrylockFunAttr(S, D, Attr);
break;
- case AttributeList::AT_unlock_function:
+ case AttributeList::AT_UnlockFunction:
handleUnlockFunAttr(S, D, Attr);
break;
- case AttributeList::AT_acquired_before:
+ case AttributeList::AT_AcquiredBefore:
handleAcquireOrderAttr(S, D, Attr, /*before = */true);
break;
- case AttributeList::AT_acquired_after:
+ case AttributeList::AT_AcquiredAfter:
handleAcquireOrderAttr(S, D, Attr, /*before = */false);
break;
bool Sema::ProcessAccessDeclAttributeList(AccessSpecDecl *ASDecl,
const AttributeList *AttrList) {
for (const AttributeList* l = AttrList; l; l = l->getNext()) {
- if (l->getKind() == AttributeList::AT_annotate) {
+ if (l->getKind() == AttributeList::AT_Annotate) {
handleAnnotateAttr(*this, ASDecl, *l);
} else {
Diag(l->getLoc(), diag::err_only_annotate_after_access_spec);
static Attr *ProcessStmtAttribute(Sema &S, Stmt *St, const AttributeList &A,
SourceRange Range) {
switch (A.getKind()) {
- case AttributeList::AT_fallthrough:
+ case AttributeList::AT_FallThrough:
return handleFallThroughAttr(S, St, A, Range);
default:
// if we're here, then we parsed an attribute, but didn't recognize it as a
unsigned diagID = 0;
switch (attr.getKind()) {
- case AttributeList::AT_objc_gc:
+ case AttributeList::AT_ObjCGC:
diagID = diag::warn_pointer_attribute_wrong_type;
useExpansionLoc = true;
break;
- case AttributeList::AT_objc_ownership:
+ case AttributeList::AT_ObjCOwnership:
diagID = diag::warn_objc_object_attribute_wrong_type;
useExpansionLoc = true;
break;
// objc_gc applies to Objective-C pointers or, otherwise, to the
// smallest available pointer type (i.e. 'void*' in 'void**').
#define OBJC_POINTER_TYPE_ATTRS_CASELIST \
- case AttributeList::AT_objc_gc: \
- case AttributeList::AT_objc_ownership
+ case AttributeList::AT_ObjCGC: \
+ case AttributeList::AT_ObjCOwnership
// Function type attributes.
#define FUNCTION_TYPE_ATTRS_CASELIST \
- case AttributeList::AT_noreturn: \
- case AttributeList::AT_cdecl: \
- case AttributeList::AT_fastcall: \
- case AttributeList::AT_stdcall: \
- case AttributeList::AT_thiscall: \
- case AttributeList::AT_pascal: \
- case AttributeList::AT_regparm: \
- case AttributeList::AT_pcs \
+ case AttributeList::AT_NoReturn: \
+ case AttributeList::AT_CDecl: \
+ case AttributeList::AT_FastCall: \
+ case AttributeList::AT_StdCall: \
+ case AttributeList::AT_ThisCall: \
+ case AttributeList::AT_Pascal: \
+ case AttributeList::AT_Regparm: \
+ case AttributeList::AT_Pcs \
namespace {
/// An object which stores processing state for the entire
static bool handleObjCPointerTypeAttr(TypeProcessingState &state,
AttributeList &attr, QualType &type) {
- if (attr.getKind() == AttributeList::AT_objc_gc)
+ if (attr.getKind() == AttributeList::AT_ObjCGC)
return handleObjCGCTypeAttr(state, attr, type);
- assert(attr.getKind() == AttributeList::AT_objc_ownership);
+ assert(attr.getKind() == AttributeList::AT_ObjCOwnership);
return handleObjCOwnershipTypeAttr(state, attr, type);
}
distributeObjCPointerTypeAttrFromDeclarator(state, *attr, declSpecType);
break;
- case AttributeList::AT_ns_returns_retained:
+ case AttributeList::AT_NSReturnsRetained:
if (!state.getSema().getLangOpts().ObjCAutoRefCount)
break;
// fallthrough
return;
for (const AttributeList *attr = chunk.getAttrs(); attr;
attr = attr->getNext())
- if (attr->getKind() == AttributeList::AT_objc_ownership)
+ if (attr->getKind() == AttributeList::AT_ObjCOwnership)
return;
transferARCOwnershipToDeclaratorChunk(state, Qualifiers::OCL_Autoreleasing,
bool Overloadable = false;
for (const AttributeList *Attrs = D.getAttributes();
Attrs; Attrs = Attrs->getNext()) {
- if (Attrs->getKind() == AttributeList::AT_overloadable) {
+ if (Attrs->getKind() == AttributeList::AT_Overloadable) {
Overloadable = true;
break;
}
DeclaratorChunk &chunk = D.getTypeObject(chunkIndex);
for (const AttributeList *attr = chunk.getAttrs(); attr;
attr = attr->getNext())
- if (attr->getKind() == AttributeList::AT_objc_ownership)
+ if (attr->getKind() == AttributeList::AT_ObjCOwnership)
return;
const char *attrStr = 0;
static AttributeList::Kind getAttrListKind(AttributedType::Kind kind) {
switch (kind) {
case AttributedType::attr_address_space:
- return AttributeList::AT_address_space;
+ return AttributeList::AT_AddressSpace;
case AttributedType::attr_regparm:
- return AttributeList::AT_regparm;
+ return AttributeList::AT_Regparm;
case AttributedType::attr_vector_size:
- return AttributeList::AT_vector_size;
+ return AttributeList::AT_VectorSize;
case AttributedType::attr_neon_vector_type:
- return AttributeList::AT_neon_vector_type;
+ return AttributeList::AT_NeonVectorType;
case AttributedType::attr_neon_polyvector_type:
- return AttributeList::AT_neon_polyvector_type;
+ return AttributeList::AT_NeonPolyVectorType;
case AttributedType::attr_objc_gc:
- return AttributeList::AT_objc_gc;
+ return AttributeList::AT_ObjCGC;
case AttributedType::attr_objc_ownership:
- return AttributeList::AT_objc_ownership;
+ return AttributeList::AT_ObjCOwnership;
case AttributedType::attr_noreturn:
- return AttributeList::AT_noreturn;
+ return AttributeList::AT_NoReturn;
case AttributedType::attr_cdecl:
- return AttributeList::AT_cdecl;
+ return AttributeList::AT_CDecl;
case AttributedType::attr_fastcall:
- return AttributeList::AT_fastcall;
+ return AttributeList::AT_FastCall;
case AttributedType::attr_stdcall:
- return AttributeList::AT_stdcall;
+ return AttributeList::AT_StdCall;
case AttributedType::attr_thiscall:
- return AttributeList::AT_thiscall;
+ return AttributeList::AT_ThisCall;
case AttributedType::attr_pascal:
- return AttributeList::AT_pascal;
+ return AttributeList::AT_Pascal;
case AttributedType::attr_pcs:
- return AttributeList::AT_pcs;
+ return AttributeList::AT_Pcs;
}
llvm_unreachable("unexpected attribute kind!");
}
FunctionTypeUnwrapper unwrapped(S, type);
- if (attr.getKind() == AttributeList::AT_noreturn) {
+ if (attr.getKind() == AttributeList::AT_NoReturn) {
if (S.CheckNoReturnAttr(attr))
return true;
// ns_returns_retained is not always a type attribute, but if we got
// here, we're treating it as one right now.
- if (attr.getKind() == AttributeList::AT_ns_returns_retained) {
+ if (attr.getKind() == AttributeList::AT_NSReturnsRetained) {
assert(S.getLangOpts().ObjCAutoRefCount &&
"ns_returns_retained treated as type attribute in non-ARC");
if (attr.getNumArgs()) return true;
return true;
}
- if (attr.getKind() == AttributeList::AT_regparm) {
+ if (attr.getKind() == AttributeList::AT_Regparm) {
unsigned value;
if (S.CheckRegparmAttr(attr, value))
return true;
switch (attr.getKind()) {
default: break;
- case AttributeList::AT_may_alias:
+ case AttributeList::AT_MayAlias:
// FIXME: This attribute needs to actually be handled, but if we ignore
// it it breaks large amounts of Linux software.
attr.setUsedAsTypeAttr();
break;
- case AttributeList::AT_address_space:
+ case AttributeList::AT_AddressSpace:
HandleAddressSpaceTypeAttribute(type, attr, state.getSema());
attr.setUsedAsTypeAttr();
break;
distributeObjCPointerTypeAttr(state, attr, type);
attr.setUsedAsTypeAttr();
break;
- case AttributeList::AT_vector_size:
+ case AttributeList::AT_VectorSize:
HandleVectorSizeAttr(type, attr, state.getSema());
attr.setUsedAsTypeAttr();
break;
- case AttributeList::AT_ext_vector_type:
+ case AttributeList::AT_ExtVectorType:
if (state.getDeclarator().getDeclSpec().getStorageClassSpec()
!= DeclSpec::SCS_typedef)
HandleExtVectorTypeAttr(type, attr, state.getSema());
attr.setUsedAsTypeAttr();
break;
- case AttributeList::AT_neon_vector_type:
+ case AttributeList::AT_NeonVectorType:
HandleNeonVectorTypeAttr(type, attr, state.getSema(),
VectorType::NeonVector, "neon_vector_type");
attr.setUsedAsTypeAttr();
break;
- case AttributeList::AT_neon_polyvector_type:
+ case AttributeList::AT_NeonPolyVectorType:
HandleNeonVectorTypeAttr(type, attr, state.getSema(),
VectorType::NeonPolyVector,
"neon_polyvector_type");
attr.setUsedAsTypeAttr();
break;
- case AttributeList::AT_opencl_image_access:
+ case AttributeList::AT_OpenCLImageAccess:
HandleOpenCLImageAccessAttribute(type, attr, state.getSema());
attr.setUsedAsTypeAttr();
break;
- case AttributeList::AT_w64:
- case AttributeList::AT_ptr32:
- case AttributeList::AT_ptr64:
+ case AttributeList::AT_Win64:
+ case AttributeList::AT_Ptr32:
+ case AttributeList::AT_Ptr64:
// FIXME: don't ignore these
attr.setUsedAsTypeAttr();
break;
- case AttributeList::AT_ns_returns_retained:
+ case AttributeList::AT_NSReturnsRetained:
if (!state.getSema().getLangOpts().ObjCAutoRefCount)
break;
// fallthrough into the function attrs
if (Triple.getOS() == llvm::Triple::Win32 ||
Triple.getOS() == llvm::Triple::MinGW32) {
switch (Attr.getKind()) {
- case AttributeList::AT_dllimport: HandleDLLImportAttr(D, Attr, S);
+ case AttributeList::AT_DLLImport: HandleDLLImportAttr(D, Attr, S);
return true;
- case AttributeList::AT_dllexport: HandleDLLExportAttr(D, Attr, S);
+ case AttributeList::AT_DLLExport: HandleDLLExportAttr(D, Attr, S);
return true;
default: break;
}
continue;
std::vector<Record*> ArgRecords = R.getValueAsListOfDefs("Args");
- std::vector<StringRef> Spellings = getValueAsListOfStrings(R, "Spellings");
+ std::vector<Record*> Spellings = R.getValueAsListOfDefs("Spellings");
std::vector<Argument*> Args;
for (ri = ArgRecords.begin(), re = ArgRecords.end(); ri != re; ++ri)
Args.push_back(createArgument(**ri, R.getName()));
OS << "void " << R.getName() << "Attr::printPretty("
<< "llvm::raw_ostream &OS, ASTContext &Ctx) const {\n";
if (Spellings.begin() != Spellings.end()) {
- OS << " OS << \" __attribute__((" << *Spellings.begin();
+ StringRef Spelling = (*Spellings.begin())->getValueAsString("Name");
+ OS << " OS << \" __attribute__((" << Spelling;
if (Args.size()) OS << "(";
- if (*Spellings.begin()=="availability") {
+ if (Spelling == "availability") {
writeAvailabilityValue(OS);
} else {
for (ai = Args.begin(); ai != ae; ++ai) {
for (std::vector<Record*>::iterator I = Attrs.begin(), E = Attrs.end(); I != E; ++I) {
Record &Attr = **I;
- std::vector<StringRef> Spellings = getValueAsListOfStrings(Attr, "Spellings");
+ std::vector<Record*> Spellings = Attr.getValueAsListOfDefs("Spellings");
- for (std::vector<StringRef>::const_iterator I = Spellings.begin(), E = Spellings.end(); I != E; ++I) {
- StringRef Spelling = *I;
+ for (std::vector<Record*>::const_iterator I = Spellings.begin(), E = Spellings.end(); I != E; ++I) {
+ StringRef Spelling = (*I)->getValueAsString("Name");
OS << ".Case(\"" << Spelling << "\", true)\n";
}
}
bool LateParsed = Attr.getValueAsBit("LateParsed");
if (LateParsed) {
- std::vector<StringRef> Spellings =
- getValueAsListOfStrings(Attr, "Spellings");
+ std::vector<Record*> Spellings =
+ Attr.getValueAsListOfDefs("Spellings");
- for (std::vector<StringRef>::const_iterator I = Spellings.begin(),
+ // FIXME: Handle non-GNU attributes
+ for (std::vector<Record*>::const_iterator I = Spellings.begin(),
E = Spellings.end(); I != E; ++I) {
- OS << ".Case(\"" << (*I) << "\", " << LateParsed << ")\n";
+ if ((*I)->getValueAsString("Variety") != "GNU")
+ continue;
+ OS << ".Case(\"" << (*I)->getValueAsString("Name") << "\", "
+ << LateParsed << ")\n";
}
}
}
bool DistinctSpellings = Attr.getValueAsBit("DistinctSpellings");
if (SemaHandler) {
- std::vector<StringRef> Spellings =
- getValueAsListOfStrings(Attr, "Spellings");
-
- for (std::vector<StringRef>::const_iterator I = Spellings.begin(),
- E = Spellings.end(); I != E; ++I) {
- StringRef AttrName = *I;
+ if (DistinctSpellings) {
+ std::vector<Record*> Spellings = Attr.getValueAsListOfDefs("Spellings");
+
+ for (std::vector<Record*>::const_iterator I = Spellings.begin(),
+ E = Spellings.end(); I != E; ++I) {
+ StringRef AttrName = (*I)->getValueAsString("Name");
+
+ AttrName = NormalizeAttrName(AttrName);
+ // skip if a normalized version has been processed.
+ if (ProcessedAttrs.find(AttrName) != ProcessedAttrs.end())
+ continue;
+ else
+ ProcessedAttrs.insert(AttrName);
+ OS << "PARSED_ATTR(" << AttrName << ")\n";
+ }
+ } else {
+ StringRef AttrName = Attr.getName();
AttrName = NormalizeAttrName(AttrName);
- // skip if a normalized version has been processed.
- if (ProcessedAttrs.find(AttrName) != ProcessedAttrs.end())
- continue;
- else
- ProcessedAttrs.insert(AttrName);
-
OS << "PARSED_ATTR(" << AttrName << ")\n";
-
- if (!DistinctSpellings)
- break;
}
}
}
bool Ignored = Attr.getValueAsBit("Ignored");
bool DistinctSpellings = Attr.getValueAsBit("DistinctSpellings");
if (SemaHandler || Ignored) {
- std::vector<StringRef> Spellings =
- getValueAsListOfStrings(Attr, "Spellings");
- std::vector<StringRef> Namespaces =
- getValueAsListOfStrings(Attr, "Namespaces");
+ std::vector<Record*> Spellings = Attr.getValueAsListOfDefs("Spellings");
- for (std::vector<StringRef>::const_iterator I = Spellings.begin(),
+ for (std::vector<Record*>::const_iterator I = Spellings.begin(),
E = Spellings.end(); I != E; ++I) {
+ StringRef RawSpelling = (*I)->getValueAsString("Name");
StringRef AttrName = NormalizeAttrName(DistinctSpellings
- ? *I
- : Spellings.front());
- StringRef Spelling = NormalizeAttrSpelling(*I);
-
- for (std::vector<StringRef>::const_iterator NI = Namespaces.begin(),
- NE = Namespaces.end(); NI != NE; ++NI) {
- SmallString<64> Buf;
- Buf += *NI;
- Buf += "::";
- Buf += Spelling;
-
- if (SemaHandler)
- Matches.push_back(
- StringMatcher::StringPair(
- Buf.str(),
- "return AttributeList::AT_" + AttrName.str() + ";"));
- else
- Matches.push_back(
- StringMatcher::StringPair(
- Buf.str(),
- "return AttributeList::IgnoredAttribute;"));
+ ? RawSpelling
+ : StringRef(Attr.getName()));
+
+ SmallString<64> Spelling;
+ if ((*I)->getValueAsString("Variety") == "CXX11") {
+ Spelling += (*I)->getValueAsString("Namespace");
+ Spelling += "::";
}
+ Spelling += NormalizeAttrSpelling(RawSpelling);
if (SemaHandler)
Matches.push_back(
StringMatcher::StringPair(
- Spelling,
+ StringRef(Spelling),
"return AttributeList::AT_" + AttrName.str() + ";"));
else
Matches.push_back(
StringMatcher::StringPair(
- Spelling,
+ StringRef(Spelling),
"return AttributeList::IgnoredAttribute;"));
}
}