[PATCH] D32248: CodeGen: Cast alloca to expected address space

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 16 07:48:09 PDT 2017


yaxunl marked 13 inline comments as done.
yaxunl added inline comments.


================
Comment at: lib/CodeGen/TargetInfo.cpp:7296
+  unsigned getASTAllocaAddressSpace() const override {
+    return LangAS::Count + getABIInfo().getDataLayout().getAllocaAddrSpace();
+  }
----------------
rjmccall wrote:
> Can we rename LangAS::Count to something more meaningful like LangAS::FirstTargetAddressSpace?  I think this would clarify a lot of code.
> 
> Is the OpenCL special case in ASTContext::getTargetAddressSpace still correct with this patch?  A pointer in LangAS::Default should be lowered as a generic pointer instead of a pointer into the alloca address space, right?
Will do.

The OpenCL special case in ASTContext::getTargetAddressSpace is still correct with this patch. In OpenCL private address space is still represented in AST by LangAS::Default, so a pointer in LangAS::Default should be lowered as a pointer to alloca address space.


https://reviews.llvm.org/D32248





More information about the cfe-commits mailing list