diff gen/toobj.c @ 26:99737f94abfb trunk

[svn r30] * Fixed static function-local variables. * Fixed CondExp - bool ? true : false
author lindquist
date Thu, 04 Oct 2007 10:57:26 +0200
parents 25bb577878e8
children 1c80c18f3c82
line wrap: on
line diff
--- a/gen/toobj.c	Thu Oct 04 10:22:56 2007 +0200
+++ b/gen/toobj.c	Thu Oct 04 10:57:26 2007 +0200
@@ -505,9 +505,13 @@
     if (isDataseg())
     {
         bool _isconst = isConst();
-        if (!_isconst)
-            _isconst = (storage_class & STCconst) ? true : false; // doesn't seem to work ):
-        llvm::GlobalValue::LinkageTypes _linkage = LLVM_DtoLinkage(protection, storage_class);
+
+        llvm::GlobalValue::LinkageTypes _linkage;
+        if (parent->isFuncDeclaration())
+            _linkage = llvm::GlobalValue::InternalLinkage;
+        else
+            _linkage = LLVM_DtoLinkage(protection, storage_class);
+
         const llvm::Type* _type = LLVM_DtoType(type);
         assert(_type);