[NVPTX] Handle addrspacecast constant expressions in aggregate initializers
authorJustin Holewinski <jholewinski@nvidia.com>
Tue, 28 Apr 2015 17:18:30 +0000 (17:18 +0000)
committerJustin Holewinski <jholewinski@nvidia.com>
Tue, 28 Apr 2015 17:18:30 +0000 (17:18 +0000)
commit0292a66bb17c1b8be898653d49f1c75372183745
tree7b71580f4e41f184aa32a5862d6727182282ed8f
parente48ac32ea2e0e403fcfaabca11ff67ab96dd86fd
[NVPTX] Handle addrspacecast constant expressions in aggregate initializers

We need to track if an AddrSpaceCast expression was seen when
generating an MCExpr for a ConstantExpr.  This change introduces a
custom lowerConstant method to the NVPTX asm printer that will create
NVPTXGenericMCSymbolRefExpr nodes at the appropriate places to encode
the information that a given symbol needs to be casted to a generic
address.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236000 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/NVPTX/NVPTXAsmPrinter.cpp
lib/Target/NVPTX/NVPTXAsmPrinter.h
lib/Target/NVPTX/NVPTXMCExpr.cpp
lib/Target/NVPTX/NVPTXMCExpr.h
test/CodeGen/NVPTX/addrspacecast-gvar.ll