]> granicus.if.org Git - clang/commit
[AST] Revert mangling changes from r339428
authorShoaib Meenai <smeenai@fb.com>
Thu, 4 Oct 2018 19:50:14 +0000 (19:50 +0000)
committerShoaib Meenai <smeenai@fb.com>
Thu, 4 Oct 2018 19:50:14 +0000 (19:50 +0000)
commit39e532fd1422eb655dfb642dfb6264ced4f7ffeb
treeef55439f7aae45a1abdb698e70ab43af63c043fa
parent78d4305bef3e0b18b6a207c6ca39b5a9492796cf
[AST] Revert mangling changes from r339428

As discussed in https://reviews.llvm.org/D50144, we want Obj-C classes
to have the same mangling as C++ structs, to support headers like the
following:

```
@class I;
struct I;

void f(I *);
```

since the header can be used from both C++ and Obj-C++ TUs, and we want
a consistent mangling across the two to prevent link errors. Itanium
mangles both the same way, and so should the MS ABI.

The main concern with having the same mangling for C++ structs and Obj-C
classes was that we want to treat them differently for the purposes of
exception handling, e.g. we don't want a C++ catch statement for a
struct to be able to catch an Obj-C class with the same name as the
struct. We can accomplish this by mangling Obj-C class names differently
in their RTTI, which I'll do in a follow-up patch.

Differential Revision: https://reviews.llvm.org/D52581

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343808 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/MicrosoftMangle.cpp
test/CodeGenObjCXX/arc-marker-funclet.mm
test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm
test/CodeGenObjCXX/msabi-objc-extensions.mm
test/CodeGenObjCXX/msabi-objc-types.mm