mizvekov added inline comments.

================
Comment at: clang/lib/AST/Type.cpp:3504-3507
+  // We strip all qualifier-like attributes as well.
+  if (const auto *AT = dyn_cast<AttributedType>(Ret.getTypePtr());
+      AT && AT->isQualifier())
+    Ret = AT->getModifiedType();
----------------
I think this block of code is not actually needed.

So the AttributedType node is just sugar right, the address space are real 
qualifiers applied to the type, just like const and such.

So the `getAtomicUnqualifiedType()` alone should do that, as it uses 
`getUnqualifiedType()` on the final result.

When unqualifying a type, this will already strip all top level sugar nodes 
necessary to get rid of the qualifiers.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134286/new/

https://reviews.llvm.org/D134286

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

Reply via email to