[llvm-commits] [llvm] r41173 - /llvm/trunk/lib/VMCore/AsmWriter.cpp
Chris Lattner
sabre at nondot.org
Sun Aug 19 15:15:27 PDT 2007
Author: lattner
Date: Sun Aug 19 17:15:26 2007
New Revision: 41173
URL: http://llvm.org/viewvc/llvm-project?rev=41173&view=rev
Log:
simplify code and print visibility for declarations.
Modified:
llvm/trunk/lib/VMCore/AsmWriter.cpp
Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=41173&r1=41172&r2=41173&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Sun Aug 19 17:15:26 2007
@@ -995,32 +995,28 @@
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.
More information about the llvm-commits
mailing list