[PATCH] D49597: [ms] Fix mangling of vector types in QMM_Result contexts.

Nico Weber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 20 06:47:16 PDT 2018


thakis created this revision.
thakis added a reviewer: zturner.

If QMM_Result is set (which it is for return types, RTTI descriptors, and exception type descriptors), tag types (structs, enums, classes, unions) get their qualifiers mangled in.

__m64 and friends is a struct/union thingy in MSVC, but not in clang's headers. To make mangling work, we call `mangleArtificalTagType(TTK_Union/TTK_Struct` for the vector types to mangle them as tag types -- but the isa<TagType> check when mangling in QMM_Result mode isn't true these vector types. Add an isArtificialTagType() function and check for that too. Fixes PR37276 and some other issues.

I tried to audit all references to TagDecl and TagType in MicrosoftMangle.cpp to see if there are other places where we need to call mangleArtificalTagType(), but I couldn't find other places.

I tried to audit all calls to mangleArtificalTagType() to see if isArtificialTagType() needs to handle more than just the vector types, but as far as I can tell all other types we use it for are types that MSVC can't handle at all (Objective-C types etc).


https://reviews.llvm.org/D49597

Files:
  clang/lib/AST/MicrosoftMangle.cpp
  clang/test/CodeGenCXX/mangle-ms-vector-types.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49597.156478.patch
Type: text/x-patch
Size: 6017 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180720/8ae30dcd/attachment-0001.bin>


More information about the cfe-commits mailing list