[PATCH] D64074: [OpenCL][Sema] Fix builtin rewriting

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 2 07:54:22 PDT 2019


Anastasia added a comment.

I would say in the interest of saving testing time running one of those test in C++ mode should be enough.



================
Comment at: clang/lib/Sema/SemaExpr.cpp:5411
                                                 OverloadParams, EPI);
-  DeclContext *Parent = Context.getTranslationUnitDecl();
+  DeclContext *Parent = FDecl->getParent();
   FunctionDecl *OverloadDecl = FunctionDecl::Create(Context, Parent,
----------------
I think these builtins were added before we could specify address spaces in tablegen file. So I think we should actually change these builtins to add the address spaces on pointers such that this code wouldn't be called at all. But your fix is still needed for general cases.

If you either write FIXME next to the OpenCL builtins in Builtins.td to add the address spaces or create a bugzilla bug describing this problem I am happy to go ahead with this patch. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64074/new/

https://reviews.llvm.org/D64074





More information about the cfe-commits mailing list