[PATCH] D111566: [SYCL] Fix function pointer address space

Elizabeth Andrews via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 10 16:38:58 PST 2022


eandrews added inline comments.


================
Comment at: clang/lib/AST/ASTContext.cpp:11494
+  const Type *TypePtr = T.getTypePtr();
+  return TypePtr->isFunctionType()
+             ? llvm::DataLayout(getTargetInfo().getDataLayoutString())
----------------
rjmccall wrote:
> You can just do `T->isFunctionType()`.
Thanks! I'll make the change


================
Comment at: clang/lib/AST/ASTContext.cpp:11497
+                   .getProgramAddressSpace()
+             : getTargetAddressSpace(T.getQualifiers());
+}
----------------
rjmccall wrote:
> If a function type has an address space qualifier, we should prefer that, right?  Or is that impossible by construction?
I thought you could only use address space qualifiers for variables. I am not sure though. 

This patch retains existing behavior for pointers.  The existing code (deleted in CodeGenTypes.cpp in his patch) doesn't take qualifiers into consideration. 


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

https://reviews.llvm.org/D111566



More information about the cfe-commits mailing list