AST: add missing ObjC extensions to MS style name decoration
authorSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 28 Sep 2018 16:47:53 +0000 (16:47 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 28 Sep 2018 16:47:53 +0000 (16:47 +0000)
commitf3a981e801f096fcdddd15d544f77856ce50b98a
tree6a25cc081fd11c1db667b30ea6f0730b63ee9b28
parent29b29801593322ab5276dd699a5676bbda21027c
AST: add missing ObjC extensions to MS style name decoration

Add support for encoding type arguments for lightweight generics in
Objective-C++ mode.  Additionally, add support for the `__kindof` modifier.
This should complete the coverage of the ObjC extensions that clang currently
supports under the MS style name decoration scheme.

This is implemented similar to the Objective-C lifetime qualifiers decoration:
a template specialization in the `__ObjC` namespace so that we can interoperate
with Microsoft's tools as well as ensure that we do not accidentally collide
with new features in the Microsoft implementation.

Since the `__kindof` appertains to the type and not the pointer, we apply the
template specialization to the underlying type instead of the pointer type.

Unfortunately, until D52581 is resolved, the generated name is not really
compatible with the MS tools as well as breaks interoperability with
Objective-C++ and C++.

This resolves PR37754!

llvm-svn: 343338
clang/lib/AST/MicrosoftMangle.cpp
clang/test/CodeGenObjCXX/msabi-objc-extensions.mm