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
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user