diff options
Diffstat (limited to 'lib/VMCore/AsmWriter.cpp')
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 89240fc..3b0f0d6 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -858,8 +858,7 @@ void AssemblyWriter::printGlobal(const GlobalVariable *GV) { case GlobalValue::DLLImportLinkage: Out << "dllimport "; break; case GlobalValue::ExternalWeakLinkage: Out << "extern_weak "; break; default: Out << "external "; break; - } - else + } else { switch (GV->getLinkage()) { case GlobalValue::InternalLinkage: Out << "internal "; break; case GlobalValue::LinkOnceLinkage: Out << "linkonce "; break; @@ -873,7 +872,15 @@ void AssemblyWriter::printGlobal(const GlobalVariable *GV) { cerr << "GhostLinkage not allowed in AsmWriter!\n"; abort(); } - + switch (GV->getVisibility()) { + case GlobalValue::DefaultVisibility: break; + case GlobalValue::HiddenVisibility: Out << "hidden "; break; + default: + cerr << "Invalid visibility style!\n"; + abort(); + } + } + Out << (GV->isConstant() ? "constant " : "global "); printType(GV->getType()->getElementType()); @@ -974,6 +981,13 @@ void AssemblyWriter::printFunction(const Function *F) { cerr << "GhostLinkage not allowed in AsmWriter!\n"; abort(); } + switch (F->getVisibility()) { + case GlobalValue::DefaultVisibility: break; + case GlobalValue::HiddenVisibility: Out << "hidden "; break; + default: + cerr << "Invalid visibility style!\n"; + abort(); + } } // Print the calling convention. |