Added small corrections in various parts.
- Added empty line and ; as requested on the review.
Fri, Aug 16
- Addressed comments from Sven.
Thu, Aug 15
Wed, Aug 14
Addressed various comments from Kevin.
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?
Tue, Aug 13
Isn't the general rule for template argument deduction (which this devolves to) just to ignore top-level qualifiers? And then you can substitute in the substituted type and end up with a properly qualified type for the parameter / variable, and you can add extra qualifiers as necessary. Why are special rules for pointers and references required?
Mon, Aug 12
Thu, Aug 8
Mon, Aug 5
Please be aware about build bot failure (http://lab.llvm.org:8011/builders/clang-cmake-thumbv7-full-sh/builds/2185) most likely caused by this change.
Fri, Aug 2
Thu, Aug 1
Tue, Jul 30
In vector_literals_nested.cl, we have tests for (global) constants. Do you think it would be worth testing those as well in C++ mode? Maybe the two files (vector_literals_nested.cl and vector_literals_valid.cl) should also be merged as most of their content seems duplicated.
- Removed another duplicate file and added testing of constant program scope initializers into vector_literals_nested.cl
- Merged test/CodeGenOpenCL/vector_literals_nested.cl into test/CodeGenOpenCL/vector_literals_valid.cl
- Added negative test case for C++
Fri, Jul 26
Wait, plain C++? Do we currently allow this syntax outside of OpenCL?
This should probably go to release 9.0?
Thu, Jul 25
Created a follow up review in https://reviews.llvm.org/D65286
Wed, Jul 24
Tue, Jul 23
Hmm, maybe we need to make sure that one of the tests is using a C++ feature and building with CLC++. This would have caught the mistake.
Use -cl-std=CLC++ spelling for test/CodeGenOpenCLCXX/addrspace-with-class.cl
- Fixed LANGSTANDARD_ALIAS_DEPR
Mon, Jul 22
Jul 18 2019
The commit has been reverted due to issues with libc++:
Jul 17 2019
- Updated comments
- Added motivation
Reopening to continue reviews.
Fixed typo in the comment
Jul 16 2019
I expect the example from the bug is going to compile now: https://bugs.llvm.org/show_bug.cgi?id=41009
Addressed some review comments. Refs are still to be fixed!
I think ignoring them in templates rather than diagnosing is the right thing to do, since it means that reasonable things, e.g. template functions returning T, won't be erroneous if you instantiate T = __global int just like they wouldn't be with T = const int.
Jul 15 2019
@rsmith, do you have any comments here? It would be quite useful to have this patch in Clang9.
Okay, so it sounds like *from the language perspective* all block pointers are actually pointers into __generic, and the thing with literals is just an implementation detail that's been inappropriately expressed in the AST. The better implementation strategy is to make sure that (1) the AST uses the size/alignment of a __generic pointer for a block pointer and (2) IRGen implicitly converts block literals to __generic pointers when it emits them, and then there's no such thing as a block pointer to a qualified type.
This is actually important to get right in C++ because of auto and templates; you really don't want non-generic block pointer types to become an expressible thing in the language.
Oh, yes, it definitely can't be done to class types. I suppose we should just forget about it.
Jul 12 2019
There are some code paths that I think are common between the parser and template instantiation, like BuildPointerType and BuildReferenceType, but if you want to do context-sensitive inference that might not be good enough.
Generate NULL for pointer param of __cxa_atexit on mismatching addr spaces
Jul 11 2019
- Moved addr space inference of pointee type into template instantiation.
Jul 10 2019
Changed API for target hook.
- Added handling of similar test case with InjectedClassNameType
Jul 9 2019
Jul 3 2019
If you like you can also change reserve_id_t. :)
Jul 2 2019
LGTM! Thanks! I would suggest to wait a day or two before committing just in case John has any feedback.
Added a target hook to query address spaces with the largest pointer width.
I would say in the interest of saving testing time running one of those test in C++ mode should be enough.
- Removed diagnostic for address space in return type in tree transforms
Jul 1 2019
btw, there seems to be the same issue with reserve_id_t?
This patch adds handling for OpenCL builtin functions.