[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)
commit05e1dadac675c1a28739c6f49e771b3a230ec264
treea35b01fd85efb3052a5399688b137bf4bb11c349
parent05e78450be654c8197d610b14b20f5bb5014f19f
[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

llvm-svn: 280578
clang/include/clang/Basic/Attr.td
clang/include/clang/Parse/Parser.h
clang/lib/Parse/ParseDeclCXX.cpp
clang/test/CodeGenCXX/microsoft-uuidof.cpp
clang/test/Parser/MicrosoftExtensions.cpp
clang/test/Parser/ms-square-bracket-attributes.mm [new file with mode: 0644]
clang/test/Sema/MicrosoftExtensions.c