summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2013-07-01 20:53:07 +0000
committerEli Friedman <eli.friedman@gmail.com>2013-07-01 20:53:07 +0000
commitc48d31c31c97dc3b0314f20f2b9c93d8277bfae5 (patch)
tree4b68f4a3e685d11724bebcc3022f5f020cd71618 /clang/lib/CodeGen/CodeGenModule.cpp
parent48fc20a0343d426abc4ac4818b7b6895ca310617 (diff)
downloadbcm5719-llvm-c48d31c31c97dc3b0314f20f2b9c93d8277bfae5.tar.gz
bcm5719-llvm-c48d31c31c97dc3b0314f20f2b9c93d8277bfae5.zip
Simplify linkage code for static local vars.
The key insight here is that weak linkage for a static local variable should always mean linkonce_odr, because every file that needs it will generate a definition. We don't actually care about the precise linkage of the parent context. I feel a bit silly that I didn't realize this before. llvm-svn: 185381
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index cfb9e783687..250442caae6 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -515,11 +515,7 @@ void CodeGenModule::EmitCtorList(const CtorList &Fns, const char *GlobalName) {
llvm::GlobalValue::LinkageTypes
CodeGenModule::getFunctionLinkage(GlobalDecl GD) {
- return getFunctionLinkage(cast<FunctionDecl>(GD.getDecl()));
-}
-
-llvm::GlobalValue::LinkageTypes
-CodeGenModule::getFunctionLinkage(const FunctionDecl *D) {
+ const FunctionDecl *D = cast<FunctionDecl>(GD.getDecl());
GVALinkage Linkage = getContext().GetGVALinkageForFunction(D);
if (Linkage == GVA_Internal)
OpenPOWER on IntegriCloud