[PATCH] D54858: [OpenCL] Improve diagnostics for address spaces in template instantiation

2018-11-29 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL347865: [OpenCL] Improve diags for addr spaces in templates (authored by stulova, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D54858: [OpenCL] Improve diagnostics for address spaces in template instantiation

2018-11-28 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. This revision is now accepted and ready to land. LGTM. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54858/new/ https://reviews.llvm.org/D54858 ___ cfe-commits mailing list

[PATCH] D54858: [OpenCL] Improve diagnostics for address spaces in template instantiation

2018-11-28 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia marked 2 inline comments as done. Anastasia added inline comments. Comment at: lib/Sema/TreeTransform.h:5276 +// Return type cann't be qualified with an address space. +if (ResultType.getAddressSpace() != LangAS::Default) { bader wrote: >

[PATCH] D54858: [OpenCL] Improve diagnostics for address spaces in template instantiation

2018-11-28 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 175699. Anastasia marked an inline comment as done. Anastasia added a comment. Removed commented code in the test. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54858/new/ https://reviews.llvm.org/D54858 Files: lib/Sema/SemaDecl.cpp

[PATCH] D54858: [OpenCL] Improve diagnostics for address spaces in template instantiation

2018-11-28 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 175698. Anastasia added a comment. Corrected a typo in comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54858/new/ https://reviews.llvm.org/D54858 Files: lib/Sema/SemaDecl.cpp lib/Sema/SemaType.cpp lib/Sema/TreeTransform.h

[PATCH] D54858: [OpenCL] Improve diagnostics for address spaces in template instantiation

2018-11-28 Thread Alexey Bader via Phabricator via cfe-commits
bader added inline comments. Comment at: lib/Sema/TreeTransform.h:5276 +// Return type cann't be qualified with an address space. +if (ResultType.getAddressSpace() != LangAS::Default) { "cann't" - typo? cann't - > can't or cannot.

[PATCH] D54858: [OpenCL] Improve diagnostics for address spaces in template instantiation

2018-11-28 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia marked an inline comment as done. Anastasia added inline comments. Comment at: lib/Sema/TreeTransform.h:4241 + if (SemaRef.getLangOpts().OpenCL && T.getType()->isTemplateTypeParmType()) +Quals.removeAddressSpace(); + Anastasia wrote: > rjmccall

[PATCH] D54858: [OpenCL] Improve diagnostics for address spaces in template instantiation

2018-11-28 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 175665. Anastasia added a comment. - Changing qualifiers while rebuilding types in TreeTransform is incorrect -> prevent deducing address space instead. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54858/new/ https://reviews.llvm.org/D54858

[PATCH] D54858: [OpenCL] Improve diagnostics for address spaces in template instantiation

2018-11-27 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia marked an inline comment as done. Anastasia added inline comments. Comment at: lib/Sema/TreeTransform.h:4241 + if (SemaRef.getLangOpts().OpenCL && T.getType()->isTemplateTypeParmType()) +Quals.removeAddressSpace(); + rjmccall wrote: > When do you

[PATCH] D54858: [OpenCL] Improve diagnostics for address spaces in template instantiation

2018-11-26 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: lib/Sema/TreeTransform.h:4241 + if (SemaRef.getLangOpts().OpenCL && T.getType()->isTemplateTypeParmType()) +Quals.removeAddressSpace(); + When do you actually add the qualifier back? Also, I don't think this is

[PATCH] D54858: [OpenCL] Improve diagnostics for address spaces in template instantiation

2018-11-23 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 175120. Anastasia added a comment. Removed FIXME from the test case that is being fixed. https://reviews.llvm.org/D54858 Files: lib/Sema/SemaDecl.cpp lib/Sema/TreeTransform.h test/CodeGenOpenCLCXX/template-address-spaces.cl

[PATCH] D54858: [OpenCL] Improve diagnostics for address spaces in template instantiation

2018-11-23 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia created this revision. Anastasia added reviewers: rjmccall, yaxunl. When template instantiation leads to creation of invalid code patterns with address spaces compiler crashes with ICE. This patch fixes the template instantiation to provide correct diagnostics instead.