aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-08-19 22:15:26 +0000
committerChris Lattner <sabre@nondot.org>2007-08-19 22:15:26 +0000
commit09c685ffbc6065c98e2cb5e0988683b6ab0510ba (patch)
tree7422837d55f6fbc981a2244f90161f1b18a3094e /lib
parent95350f85dff7c5e16364bc8db4c86b32b9a1c376 (diff)
downloadexternal_llvm-09c685ffbc6065c98e2cb5e0988683b6ab0510ba.zip
external_llvm-09c685ffbc6065c98e2cb5e0988683b6ab0510ba.tar.gz
external_llvm-09c685ffbc6065c98e2cb5e0988683b6ab0510ba.tar.bz2
simplify code and print visibility for declarations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41173 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/AsmWriter.cpp46
1 files changed, 21 insertions, 25 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index 16b5510..9286e15 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -995,32 +995,28 @@ void AssemblyWriter::printFunction(const Function *F) {
if (AnnotationWriter) AnnotationWriter->emitFunctionAnnot(F, Out);
if (F->isDeclaration())
- switch (F->getLinkage()) {
- case GlobalValue::DLLImportLinkage: Out << "declare dllimport "; break;
- case GlobalValue::ExternalWeakLinkage: Out << "declare extern_weak "; break;
- default: Out << "declare ";
- }
- else {
+ Out << "declare ";
+ else
Out << "define ";
- switch (F->getLinkage()) {
- case GlobalValue::InternalLinkage: Out << "internal "; break;
- case GlobalValue::LinkOnceLinkage: Out << "linkonce "; break;
- case GlobalValue::WeakLinkage: Out << "weak "; break;
- case GlobalValue::AppendingLinkage: Out << "appending "; break;
- case GlobalValue::DLLImportLinkage: Out << "dllimport "; break;
- case GlobalValue::DLLExportLinkage: Out << "dllexport "; break;
- case GlobalValue::ExternalWeakLinkage: Out << "extern_weak "; break;
- case GlobalValue::ExternalLinkage: break;
- case GlobalValue::GhostLinkage:
- cerr << "GhostLinkage not allowed in AsmWriter!\n";
- abort();
- }
- switch (F->getVisibility()) {
- default: assert(0 && "Invalid visibility style!");
- case GlobalValue::DefaultVisibility: break;
- case GlobalValue::HiddenVisibility: Out << "hidden "; break;
- case GlobalValue::ProtectedVisibility: Out << "protected "; break;
- }
+
+ switch (F->getLinkage()) {
+ case GlobalValue::InternalLinkage: Out << "internal "; break;
+ case GlobalValue::LinkOnceLinkage: Out << "linkonce "; break;
+ case GlobalValue::WeakLinkage: Out << "weak "; break;
+ case GlobalValue::AppendingLinkage: Out << "appending "; break;
+ case GlobalValue::DLLImportLinkage: Out << "dllimport "; break;
+ case GlobalValue::DLLExportLinkage: Out << "dllexport "; break;
+ case GlobalValue::ExternalWeakLinkage: Out << "extern_weak "; break;
+ case GlobalValue::ExternalLinkage: break;
+ case GlobalValue::GhostLinkage:
+ cerr << "GhostLinkage not allowed in AsmWriter!\n";
+ abort();
+ }
+ switch (F->getVisibility()) {
+ default: assert(0 && "Invalid visibility style!");
+ case GlobalValue::DefaultVisibility: break;
+ case GlobalValue::HiddenVisibility: Out << "hidden "; break;
+ case GlobalValue::ProtectedVisibility: Out << "protected "; break;
}
// Print the calling convention.