[PATCH] D52581: [AST] Revert mangling changes from r339428

Shoaib Meenai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 26 17:29:04 PDT 2018


smeenai created this revision.
smeenai added reviewers: compnerd, rjmccall, theraven, DHowett-MSFT.

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:

  #ifdef __OBJC__
  @class I;
  #else
  struct I;
  #endif
  
  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 https://reviews.llvm.org/D47233. I would
have done the same for the GNUstep RTTI here, except I don't actually
see the code for that anywhere, and no tests seem to break either, so I
believe it's not upstreamed yet.


Repository:
  rC Clang

https://reviews.llvm.org/D52581

Files:
  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52581.167219.patch
Type: text/x-patch
Size: 14233 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180927/8b552b02/attachment-0001.bin>


More information about the cfe-commits mailing list