Preserve address space of forward-referenced global variables in the LL parser
authorJustin Holewinski <jholewinski@nvidia.com>
Fri, 16 Nov 2012 21:03:47 +0000 (21:03 +0000)
committerJustin Holewinski <jholewinski@nvidia.com>
Fri, 16 Nov 2012 21:03:47 +0000 (21:03 +0000)
commit898a0a02bb67ee1a4eb328fa14e72daed271a969
tree60d32d723255880ebd42a8cd54f0e0c74478dea9
parentd7d8c09b93db9818856844f926c3e1cec56ae857
Preserve address space of forward-referenced global variables in the LL parser

Before, the parser would assert on the following code:

@a2 = global i8 addrspace(1)* @a
@a = addrspace(1) global i8 0

because the type of @a was "i8*" instead of "i8 addrspace(1)*" when parsing
the initializer for @a2.

llvm-svn: 168197
llvm/lib/AsmParser/LLParser.cpp
llvm/test/Assembler/global-addrspace-forwardref.ll [new file with mode: 0644]