[PATCH] D65744: [PR42707][OpenCL] Fix addr space deduction for auto

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 14 04:42:57 PDT 2019

Anastasia added a comment.

In D65744#1627589 <https://reviews.llvm.org/D65744#1627589>, @rjmccall wrote:

> I see.  Is the deduction rule recursive or something, where a pointer to pointer is inferred to point to the same address space as the pointee?

It is recursive indeed and we currently deduce all pointees to generic AS.

> I still don't understand why pointers and references are handled differently here, instead of having the rule be "don't infer if the type is opaquely dependent or an `auto` placeholder".

Because we currently only infer pointers and references in TreeTransforms. Everything else is inferred earlier. That is mainly because we need some context info to infer in most of other cases and therefore it's not easy to do in TreeTransforms. There is some more information on this review: https://reviews.llvm.org/D64400 where the inference for pointers and references was added originally to TreeTransforms.



More information about the cfe-commits mailing list