summaryrefslogtreecommitdiffstats
path: root/lib/VMCore/AsmWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore/AsmWriter.cpp')
-rw-r--r--lib/VMCore/AsmWriter.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index 41929fa..cd4c692 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -1188,6 +1188,8 @@ void AssemblyWriter::printGlobal(const GlobalVariable *GV) {
PrintVisibility(GV->getVisibility(), Out);
if (GV->isThreadLocal()) Out << "thread_local ";
+ if (unsigned AddressSpace = GV->getType()->getAddressSpace())
+ Out << "addrspace(" << AddressSpace << ") ";
Out << (GV->isConstant() ? "constant " : "global ");
printType(GV->getType()->getElementType());
@@ -1195,9 +1197,6 @@ void AssemblyWriter::printGlobal(const GlobalVariable *GV) {
Out << ' ';
writeOperand(GV->getInitializer(), false);
}
-
- if (unsigned AddressSpace = GV->getType()->getAddressSpace())
- Out << " addrspace(" << AddressSpace << ") ";
if (GV->hasSection())
Out << ", section \"" << GV->getSection() << '"';