[PATCH] D40838: [OpenCL] Fix layering violation by getOpenCLTypeAddrSpace

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 5 08:46:58 PST 2017


yaxunl added inline comments.


================
Comment at: lib/CodeGen/CGOpenCLRuntime.cpp:41
   uint32_t AddrSpc = CGM.getContext().getTargetAddressSpace(
-      CGM.getTarget().getOpenCLTypeAddrSpace(T));
+      CGM.getTarget().getOpenCLTypeAddrSpace(TK));
   switch (cast<BuiltinType>(T)->getKind()) {
----------------
Maybe also introduce ASTContext::getOpenCLTypeAddrSpace(const Type *T) for convenience. It has TargetInfo member.


https://reviews.llvm.org/D40838





More information about the cfe-commits mailing list