patch: CloneModule resets GlobalVariable address space

Hi,

I found the following bug in llvm::CloneModule (svn, head revision).
When copying over global variables the address space is reset to
default. The patch changes that behavior by using the other
GlobalVariable constructor that explicitely includes that information.

Regards,
Simon

LLVM29_CloneModule_GVSpace.diff (851 Bytes)

r137654 fixes all the issues I could find looking at the code. Note
that this codepath is relatively lightly tested, though; the only user
of it in the LLVM codebase is bugpoint.

-Eli