summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic/Attr.td
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2016-09-03 03:25:22 +0000
committerNico Weber <nicolasweber@gmx.de>2016-09-03 03:25:22 +0000
commit989beae06d0bbad94d847e01429579cddb3a2faa (patch)
treec704523e2bfb660d1cf82a1fc9aa77b0e094ed2c /include/clang/Basic/Attr.td
parent7a21961ffdf97605911c8f26017bfcc98e6e36d5 (diff)
[ms] Add support for parsing uuid as a Microsoft attribute.
Some Windows SDK classes, for example Windows::Storage::Streams::IBufferByteAccess, use the ATL way of spelling attributes: [uuid("....")] class IBufferByteAccess {}; To be able to use __uuidof() to grab the uuid off these types, clang needs to support uuid as a Microsoft attribute. There was already code to skip Microsoft attributes, extend that to look for uuid and parse it. Use the new "Microsoft" attribute type added in r280575 (and r280574, r280576) for this. Final part of https://reviews.llvm.org/D23895 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280578 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/Attr.td')
-rw-r--r--include/clang/Basic/Attr.td3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td
index 912d151538..b72222fc5c 100644
--- a/include/clang/Basic/Attr.td
+++ b/include/clang/Basic/Attr.td
@@ -198,6 +198,7 @@ class Spelling<string name, string variety> {
class GNU<string name> : Spelling<name, "GNU">;
class Declspec<string name> : Spelling<name, "Declspec">;
+class Microsoft<string name> : Spelling<name, "Microsoft">;
class CXX11<string namespace, string name, int version = 1>
: Spelling<name, "CXX11"> {
string Namespace = namespace;
@@ -1584,7 +1585,7 @@ def Used : InheritableAttr {
}
def Uuid : InheritableAttr {
- let Spellings = [Declspec<"uuid">];
+ let Spellings = [Declspec<"uuid">, Microsoft<"uuid">];
let Args = [StringArgument<"Guid">];
// let Subjects = SubjectList<[CXXRecord]>;
let LangOpts = [MicrosoftExt, Borland];