[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)
commit3d2a976197ce4060e7576fa3ce67f87fa8cff126
tree00ba2e0325bd58d4c89ebf30dab87b28f5ed71cd
parent5e1441bce437e09a0cf976e18ccc291dc43dec78
[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.

llvm-svn: 236000
llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h
llvm/lib/Target/NVPTX/NVPTXMCExpr.cpp
llvm/lib/Target/NVPTX/NVPTXMCExpr.h
llvm/test/CodeGen/NVPTX/addrspacecast-gvar.ll