[PATCH] D34367: CodeGen: Fix address space of indirect function argument

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 20 10:21:01 PDT 2017


yaxunl added inline comments.


================
Comment at: lib/CodeGen/CGCall.cpp:1605
+              ? CGM.getDataLayout().getAllocaAddrSpace()
+              : getContext().getTargetAddressSpace(LangAS::Default));
       break;
----------------
rjmccall wrote:
> Everything about your reasoning seems to apply to normal indirect arguments, too.
non-byval indirect argument is normally in default address space instead of alloca address space. For example,


```
struct A { int a;};
void f(A &x);
```
`x` is an indirect argument but should not be in alloca addr space, since the caller may pass a reference to a global variable.


https://reviews.llvm.org/D34367





More information about the cfe-commits mailing list