[llvm-branch-commits] [llvm-gcc-branch] r102949 - in /llvm-gcc-4.2/branches/Apple/Morbo/gcc: llvm-backend.cpp llvm-convert.cpp
Bill Wendling
isanbard at gmail.com
Mon May 3 13:40:57 PDT 2010
Author: void
Date: Mon May 3 15:40:57 2010
New Revision: 102949
URL: http://llvm.org/viewvc/llvm-project?rev=102949&view=rev
Log:
$ svn merge -c 102947 https://llvm.org/svn/llvm-project/llvm-gcc-4.2/trunk
--- Merging r102947 into '.':
U gcc/llvm-backend.cpp
U gcc/llvm-convert.cpp
Modified:
llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-backend.cpp
llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-backend.cpp?rev=102949&r1=102948&r2=102949&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-backend.cpp Mon May 3 15:40:57 2010
@@ -1375,8 +1375,12 @@
} else if (!TREE_PUBLIC(decl)) {
Linkage = GlobalValue::InternalLinkage;
} else if (DECL_WEAK(decl)) {
- // The user may have explicitly asked for weak linkage - ignore flag_odr.
- Linkage = GlobalValue::WeakAnyLinkage;
+ if (DECL_ONE_ONLY(decl) &&
+ !lookup_attribute("weak", DECL_ATTRIBUTES(decl)))
+ Linkage = GlobalValue::getWeakLinkage(flag_odr);
+ else
+ // The user may have explicitly asked for weak linkage - ignore flag_odr.
+ Linkage = GlobalValue::WeakAnyLinkage;
} else if (DECL_ONE_ONLY(decl)) {
Linkage = GlobalValue::getWeakLinkage(flag_odr);
} else if (DECL_COMMON(decl) && // DECL_COMMON is only meaningful if no init
Modified: llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-convert.cpp?rev=102949&r1=102948&r2=102949&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-convert.cpp Mon May 3 15:40:57 2010
@@ -545,8 +545,12 @@
} else if (DECL_COMDAT(FnDecl)) {
Fn->setLinkage(Function::getLinkOnceLinkage(flag_odr));
} else if (DECL_WEAK(FnDecl)) {
- // The user may have explicitly asked for weak linkage - ignore flag_odr.
- Fn->setLinkage(Function::WeakAnyLinkage);
+ if (DECL_ONE_ONLY(FnDecl) &&
+ !lookup_attribute("weak", DECL_ATTRIBUTES(FnDecl)))
+ Fn->setLinkage(Function::getWeakLinkage(flag_odr));
+ else
+ // The user may have explicitly asked for weak linkage - ignore flag_odr.
+ Fn->setLinkage(Function::WeakAnyLinkage);
} else if (DECL_ONE_ONLY(FnDecl)) {
Fn->setLinkage(Function::getWeakLinkage(flag_odr));
}
More information about the llvm-branch-commits
mailing list