[PATCH] D52674: [AST] Add Obj-C discriminator to MS ABI RTTI

Shoaib Meenai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 2 18:30:29 PDT 2018


smeenai requested review of this revision.
smeenai added a comment.

Actually, I take that back ... I just misread the stack trace.

There are a bunch of hops between the `mangleCXXRTTI` call and the ultimate mangling function:

  MicrosoftMangleContextImpl::mangleCXXRTTI(QualType, raw_ostream &)
  MicrosoftCXXNameMangler::mangleType(QualType, SourceRange, QualifierMangleMode)
  MicrosoftCXXNameMangler::mangleType(const ObjCObjectPointerType *, Qualifiers, SourceRange)
  MicrosoftCXXNameMangler::mangleType(QualType, SourceRange, QualifierMangleMode)
  MicrosoftCXXNameMangler::mangleType(const ObjCObjectType *, Qualifiers, SourceRange)

(the last one will be `ObjCInterfaceType` instead of `ObjCObjectType` if catching anything other than `id`)

Threading a `ForRTTI` flag or similar all the way to the final call seems pretty tricky. I can add an optional paramater to `mangleType(QualType, SourceRange, QualifierMangleMode)`, but that function uses a generated switch case <https://reviews.llvm.org/diffusion/L/browse/cfe/trunk/lib/AST/MicrosoftMangle.cpp;343652$1833-1847> to call the specific `mangleType` functions, and I don't know how to special-case certain types in that switch case (to pass the extra parameter along) without doing something super ugly. Adding the extra parameter to every single `mangleType` overload seems highly non-ideal, which is why I was thinking of maintaining some internal state instead.


Repository:
  rC Clang

https://reviews.llvm.org/D52674





More information about the cfe-commits mailing list