]> granicus.if.org Git - clang/commit
[ms] Add support for parsing uuid as a Microsoft attribute.
authorNico Weber <nicolasweber@gmx.de>
Sat, 3 Sep 2016 03:25:22 +0000 (03:25 +0000)
committerNico Weber <nicolasweber@gmx.de>
Sat, 3 Sep 2016 03:25:22 +0000 (03:25 +0000)
commit989beae06d0bbad94d847e01429579cddb3a2faa
treec704523e2bfb660d1cf82a1fc9aa77b0e094ed2c
parent7a21961ffdf97605911c8f26017bfcc98e6e36d5
[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
include/clang/Basic/Attr.td
include/clang/Parse/Parser.h
lib/Parse/ParseDeclCXX.cpp
test/CodeGenCXX/microsoft-uuidof.cpp
test/Parser/MicrosoftExtensions.cpp
test/Parser/ms-square-bracket-attributes.mm [new file with mode: 0644]
test/Sema/MicrosoftExtensions.c