leonardchan added inline comments.

================
Comment at: lib/AST/TypePrinter.cpp:1370
+
+    // Remove the underlying address space so it won't be printed.
+    SplitQualType SplitTy = T->getModifiedType().split();
----------------
rsmith wrote:
> leonardchan wrote:
> > rsmith wrote:
> > > This is unnecessary; just print the modified type here. (The modified 
> > > type by definition does not have the attribute applied to it.)
> > When you say the modified type, do you mean just the type without it's 
> > qualifiers? I wasn't sure if removing all the qualifiers would suffice 
> > since there were also other  non-address_space qualifiers that could be 
> > printed.
> I mean `T->getModifiedType()`, which tracks what the type was before the 
> attribute was applied.
Oh, I understand that you meant `T->getModifiedType()`. This is a special case 
when printing the `address_space` since even though the attribute is applied 
and printed here, when we reach the qualifiers of the modified type, the 
address space will still be printed unless we remove it here.

I'm not sure if there's a better way to do this though.


Repository:
  rC Clang

https://reviews.llvm.org/D51329



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

Reply via email to