[cfe-commits] r51674 - in /cfe/trunk: lib/CodeGen/CodeGenModule.cpp test/CodeGen/weak-global.c

Eli Friedman eli.friedman at gmail.com
Thu May 29 04:03:22 PDT 2008


Author: efriedma
Date: Thu May 29 06:03:17 2008
New Revision: 51674

URL: http://llvm.org/viewvc/llvm-project?rev=51674&view=rev
Log:
Tentative declarations are supposed to have common linkage, not weak.  
This change makes clang generate the same thing as llvm-gcc.


Modified:
    cfe/trunk/lib/CodeGen/CodeGenModule.cpp
    cfe/trunk/test/CodeGen/weak-global.c

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=51674&r1=51673&r2=51674&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Thu May 29 06:03:17 2008
@@ -500,7 +500,7 @@
       assert(0 && "Can't have auto or register globals");
     case VarDecl::None:
       if (!D->getInit())
-        GV->setLinkage(llvm::GlobalVariable::WeakLinkage);
+        GV->setLinkage(llvm::GlobalVariable::CommonLinkage);
       break;
     case VarDecl::Extern:
     case VarDecl::PrivateExtern:

Modified: cfe/trunk/test/CodeGen/weak-global.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/weak-global.c?rev=51674&r1=51673&r2=51674&view=diff

==============================================================================
--- cfe/trunk/test/CodeGen/weak-global.c (original)
+++ cfe/trunk/test/CodeGen/weak-global.c Thu May 29 06:03:17 2008
@@ -1,3 +1,3 @@
-// RUN: clang -emit-llvm < %s | grep weak
+// RUN: clang -emit-llvm < %s | grep common
 
 int i;





More information about the cfe-commits mailing list