[PATCH] D52292: [Sema][OpenCL] Improve diagnostics for not viable overloadable function candidates

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 21 00:50:33 PDT 2018


Anastasia added inline comments.


================
Comment at: lib/Sema/Sema.cpp:1856
 
+std::string Sema::getOpenCLExtensionsFromDeclExtMap(FunctionDecl *FD) {
+  if (!OpenCLDeclExtMap.empty())
----------------
sidorovd wrote:
> Anastasia wrote:
> > Is this function to be used for both `OpenCLDeclExtMap` and `OpenCLTypeExtMap`? If yes, may be we could give it more generic name like 'getOpenCLExtensionsFromExtMap'...
> No, this exact function is only for 'OpenCLDeclExtMap', for the type map one should implement a new function 'getOpenCLExtensionsFromTypeExtMap'. Actually I have done this for https://reviews.llvm.org/D51341 to make the patch more generic, but since I'm not sure if it ever came to light I can add it here unused.
I think it's ok to provide generic helper function even if it's not used currently. But if you don't want to do this is there any value in splitting this into two function and using template?


https://reviews.llvm.org/D52292





More information about the cfe-commits mailing list