From f1b711035c2de23bd06c7af1df2074459724f0e6 Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Fri, 10 Jun 2011 00:53:15 +0000 Subject: [PATCH] Ensure that EmitGlobalVariable is correctly differentiating between declarations and definitions when emitting global variables. This was causing global declarations to be emitted as if they were definitions. Fixes . llvm-svn: 132825 --- lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 81782ea4367..161afbafb57 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -269,7 +269,7 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) { } MCSymbol *GVSym = Mang->getSymbol(GV); - EmitVisibility(GVSym, GV->getVisibility()); + EmitVisibility(GVSym, GV->getVisibility(), !GV->isDeclaration()); if (!GV->hasInitializer()) // External globals require no extra code. return;