rogfer01 added inline comments.

================
Comment at: lib/AST/ItaniumMangle.cpp:2329-2333
+  // __unaligned is not currently mangled in any way. This implies that it is
+  // not a relevant qualifier for substitutions (while CVR and maybe others
+  // are). This triggers an assertion when this is the only qualifier and the
+  // unqualified type is a class. So let's remove it preventively here.
+  quals.removeUnaligned();
----------------
rsmith wrote:
> I don't think this is the right place/way to handle this: given
> 
> ```
> void f(struct X __unaligned *p, struct X *q) {}
> ```
> 
> it looks like we'll mangle as `_Z1fP1XP1X` with this patch, which seems 
> wrong: this should presumably instead be `_Z1fP1XS0_`.
> 
> But regardless, I think the right thing to do is to invent a mangling for 
> `__unaligned`, since we support overloading on it; the most appropriate 
> mangling would be `U11__unaligned`, per 
> http://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling-type. (You'll need 
> to extend `mangleQualifiers` to emit this and 
> `hasMangledSubstitutionQualifiers` to ignore it.)
Oh. I see. Thanks for the review.

I'll update this patch and then I'll post another one for the mangling of 
unaligned.


https://reviews.llvm.org/D33398



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to