From 96cead513761d287c88a4f05c712aee3b26b9d6f Mon Sep 17 00:00:00 2001 From: Joey Gouly Date: Thu, 14 Mar 2013 09:54:43 +0000 Subject: Add support for the 'endian' attribute for OpenCL. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177035 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/Attr.td | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/clang/Basic/Attr.td') diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index 53f83e1acf..88cf0f9644 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -632,6 +632,11 @@ def ReqdWorkGroupSize : InheritableAttr { UnsignedArgument<"ZDim">]; } +def Endian : InheritableAttr { + let Spellings = [GNU<"endian">]; + let Args = [IdentifierArgument<"platform">]; +} + def WorkGroupSizeHint : InheritableAttr { let Spellings = [GNU<"work_group_size_hint">]; let Args = [UnsignedArgument<"XDim">, -- cgit v1.2.3-18-g5258 From 1db7040604154f71c54cf1329ae384fbef196668 Mon Sep 17 00:00:00 2001 From: Guy Benyei Date: Sun, 24 Mar 2013 13:58:12 +0000 Subject: Generate metadata to implement the -cl-kernel-arg-info option. OpenCL 1.2 spec. 5.7.3. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177839 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/Attr.td | 1 - 1 file changed, 1 deletion(-) (limited to 'include/clang/Basic/Attr.td') diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index 88cf0f9644..47905bf8b1 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -333,7 +333,6 @@ def OpenCLKernel : Attr { def OpenCLImageAccess : Attr { let Spellings = [GNU<"opencl_image_access">]; let Args = [IntArgument<"Access">]; - let ASTNode = 0; } def Deprecated : InheritableAttr { -- cgit v1.2.3-18-g5258 From 852e3d7143cda1cdf6771c17559d38822cc296b3 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 26 Mar 2013 18:30:28 +0000 Subject: [ms-cxxabi] Give the MS inheritance attributes a base class Required making a handful of changes to the table generator. Also adds an unspecified inheritance attribute. This opens the path for us to apply these attributes to C++ records implicitly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178054 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/Attr.td | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'include/clang/Basic/Attr.td') diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index 47905bf8b1..37aa332b81 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -956,18 +956,26 @@ def Ptr64 : InheritableAttr { let Spellings = [Keyword<"__ptr64">]; } -def SingleInheritance : InheritableAttr { +class MSInheritanceAttr : InheritableAttr; + +def SingleInheritance : MSInheritanceAttr { let Spellings = [Keyword<"__single_inheritance">]; } -def MultipleInheritance : InheritableAttr { +def MultipleInheritance : MSInheritanceAttr { let Spellings = [Keyword<"__multiple_inheritance">]; } -def VirtualInheritance : InheritableAttr { +def VirtualInheritance : MSInheritanceAttr { let Spellings = [Keyword<"__virtual_inheritance">]; } +// This attribute doesn't have any spellings, but we can apply it implicitly to +// incomplete types that lack any of the other attributes. +def UnspecifiedInheritance : MSInheritanceAttr { + let Spellings = []; +} + def Unaligned : IgnoredAttr { let Spellings = [Keyword<"__unaligned">]; } -- cgit v1.2.3-18-g5258 From 76da55d3a49e1805f51b1ced7c5da5bcd7f759d8 Mon Sep 17 00:00:00 2001 From: John McCall Date: Tue, 16 Apr 2013 07:28:30 +0000 Subject: Basic support for Microsoft property declarations and references thereto. Patch by Tong Shen! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179585 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/Attr.td | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/clang/Basic/Attr.td') diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index 37aa332b81..441a79a23b 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -928,6 +928,10 @@ def TypeTagForDatatype : InheritableAttr { // Microsoft-related attributes +def MsProperty : Attr { + let Spellings = [Declspec<"property">]; +} + def MsStruct : InheritableAttr { let Spellings = [Declspec<"ms_struct">]; } -- cgit v1.2.3-18-g5258 From 3796d1539a39b999fd50bed7aea726ef6f845e17 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 2 May 2013 23:08:12 +0000 Subject: Use attribute argument information to determine when to parse attribute arguments as expressions. This change partly addresses a heinous problem we have with the parsing of attribute arguments that are a lone identifier. Previously, we would end up parsing the 'align' attribute of this as an expression "(Align)": template class my_aligned_storage { __attribute__((align((Align)))) char storage[Size]; }; while this would parse as a "parameter name" 'Align': template class my_aligned_storage { __attribute__((align(Align))) char storage[Size]; }; The code that handles the alignment attribute would completely ignore the parameter name, so the while the first of these would do what's expected, the second would silently be equivalent to template class my_aligned_storage { __attribute__((align)) char storage[Size]; }; i.e., use the maximal alignment rather than the specified alignment. Address this by sniffing the "Args" provided in the TableGen description of attributes. If the first argument is "obviously" something that should be treated as an expression (rather than an identifier to be matched later), parse it as an expression. Fixes . git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180970 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/Attr.td | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/clang/Basic/Attr.td') diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index 441a79a23b..8d825ad8f2 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -152,7 +152,7 @@ def AddressSpace : Attr { def Alias : InheritableAttr { let Spellings = [GNU<"alias">, CXX11<"gnu", "alias">]; - let Args = [StringArgument<"Aliasee">]; + let Args = [IdentifierArgument<"Aliasee">]; } def Aligned : InheritableAttr { @@ -184,7 +184,7 @@ def AlwaysInline : InheritableAttr { def TLSModel : InheritableAttr { let Spellings = [GNU<"tls_model">, CXX11<"gnu", "tls_model">]; let Subjects = [Var]; - let Args = [StringArgument<"Model">]; + let Args = [IdentifierArgument<"Model">]; } def AnalyzerNoReturn : InheritableAttr { @@ -373,7 +373,7 @@ def MinSize : InheritableAttr { def Format : InheritableAttr { let Spellings = [GNU<"format">, CXX11<"gnu", "format">]; - let Args = [StringArgument<"Type">, IntArgument<"FormatIdx">, + let Args = [IdentifierArgument<"Type">, IntArgument<"FormatIdx">, IntArgument<"FirstArg">]; } -- cgit v1.2.3-18-g5258 From fa5f03052bc39d9c8f2fa8b4002597a8219760a4 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 2 May 2013 23:15:45 +0000 Subject: Revert r180970; it's causing breakage. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180972 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/Attr.td | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/clang/Basic/Attr.td') diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index 8d825ad8f2..441a79a23b 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -152,7 +152,7 @@ def AddressSpace : Attr { def Alias : InheritableAttr { let Spellings = [GNU<"alias">, CXX11<"gnu", "alias">]; - let Args = [IdentifierArgument<"Aliasee">]; + let Args = [StringArgument<"Aliasee">]; } def Aligned : InheritableAttr { @@ -184,7 +184,7 @@ def AlwaysInline : InheritableAttr { def TLSModel : InheritableAttr { let Spellings = [GNU<"tls_model">, CXX11<"gnu", "tls_model">]; let Subjects = [Var]; - let Args = [IdentifierArgument<"Model">]; + let Args = [StringArgument<"Model">]; } def AnalyzerNoReturn : InheritableAttr { @@ -373,7 +373,7 @@ def MinSize : InheritableAttr { def Format : InheritableAttr { let Spellings = [GNU<"format">, CXX11<"gnu", "format">]; - let Args = [IdentifierArgument<"Type">, IntArgument<"FormatIdx">, + let Args = [StringArgument<"Type">, IntArgument<"FormatIdx">, IntArgument<"FirstArg">]; } -- cgit v1.2.3-18-g5258 From 1cac0481166dd383a5d685fd53154661fbac5896 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Tue, 21 May 2013 00:06:11 +0000 Subject: Merging r182266: ------------------------------------------------------------------------ r182266 | rnk | 2013-05-20 07:02:37 -0700 (Mon, 20 May 2013) | 13 lines Implement __declspec(selectany) under -fms-extensions selectany only applies to externally visible global variables. It has the effect of making the data weak_odr. The MSDN docs suggest that unused definitions can only be dropped at linktime, so Clang uses weak instead of linkonce. MSVC optimizes away references to constant selectany data, so it must assume that there is only one definition, hence weak_odr. Reviewers: espindola Differential Revision: http://llvm-reviews.chandlerc.com/D814 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_33@182337 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/Attr.td | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/clang/Basic/Attr.td') diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index 441a79a23b..25c9fcb5af 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -948,6 +948,10 @@ def ForceInline : InheritableAttr { let Spellings = [Keyword<"__forceinline">]; } +def SelectAny : InheritableAttr { + let Spellings = [Declspec<"selectany">]; +} + def Win64 : InheritableAttr { let Spellings = [Keyword<"__w64">]; } -- cgit v1.2.3-18-g5258 From 52195b74d01520b6bce0f8c08234bf6eb8cfd496 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 21 May 2013 13:48:39 +0000 Subject: Reverting r182337, which merged r182266, __declspec(selectany) Was "Implement __declspec(selectany) under -fms-extensions ..." git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_33@182381 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/Attr.td | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include/clang/Basic/Attr.td') diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index 25c9fcb5af..441a79a23b 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -948,10 +948,6 @@ def ForceInline : InheritableAttr { let Spellings = [Keyword<"__forceinline">]; } -def SelectAny : InheritableAttr { - let Spellings = [Declspec<"selectany">]; -} - def Win64 : InheritableAttr { let Spellings = [Keyword<"__w64">]; } -- cgit v1.2.3-18-g5258