]> granicus.if.org Git - clang/commit
Fix array sizes where address space is not yet known
authorKonstantin Zhuravlyov <kzhuravl_dev@outlook.com>
Tue, 21 Mar 2017 18:55:39 +0000 (18:55 +0000)
committerKonstantin Zhuravlyov <kzhuravl_dev@outlook.com>
Tue, 21 Mar 2017 18:55:39 +0000 (18:55 +0000)
commit9ec3d497c16619f69825b02319f0565ea5071f07
tree2828c428a4ac7f2e4426d2f784cb034d6f2fe579
parentfaeb1ac77af665b5c4f5b6f06c4f267cb498073c
Fix array sizes where address space is not yet known

For variables in generic address spaces, for example:

```
unsigned char V[6442450944];
...
```

the address space is not yet known when we get into
*getConstantArrayType*, it is 0. AMDGCN target's
address space 0 has 32 bits pointers, so when we
call *getPointerWidth* with 0, the array size is
trimmed to 32 bits, which is not right.

Differential Revision: https://reviews.llvm.org/D30845

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298420 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/ASTContext.cpp
test/CodeGenOpenCL/amdgcn-large-globals.cl [new file with mode: 0644]