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