aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-04-02 23:17:29 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-04-02 23:17:29 +0000
commit54e3ba5ace52bcdc0d20d69f715c202a31d8c525 (patch)
treee6bea97dce3a77aa76100538736bddb69c28f36e /clang/lib/CodeGen/CodeGenModule.cpp
parentb0abeb098418fea4b87a7bdc0f66d2942d0ca77e (diff)
downloadllvm-54e3ba5ace52bcdc0d20d69f715c202a31d8c525.zip
llvm-54e3ba5ace52bcdc0d20d69f715c202a31d8c525.tar.gz
llvm-54e3ba5ace52bcdc0d20d69f715c202a31d8c525.tar.bz2
CodeGen: Emit some functions as weak_odr under -fms-compatibility
Summary: MSVC always emits inline functions marked with the extern storage class specifier. The result is something similar to the opposite of __attribute__((gnu_inline)). This extension is also available in C. This fixes PR19264. Reviewers: rnk, rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3207 llvm-svn: 205485
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index d997a79..c26f7691 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -589,7 +589,7 @@ CodeGenModule::getFunctionLinkage(GlobalDecl GD) {
// explicit instantiations can occur in multiple translation units
// and must all be equivalent. However, we are not allowed to
// throw away these explicit instantiations.
- if (Linkage == GVA_ExplicitTemplateInstantiation)
+ if (Linkage == GVA_StrongODR)
return !Context.getLangOpts().AppleKext
? llvm::Function::WeakODRLinkage
: llvm::Function::ExternalLinkage;
@@ -1948,8 +1948,7 @@ CodeGenModule::GetLLVMLinkageVarDefinition(const VarDecl *D, bool isConstant) {
return llvm::GlobalVariable::WeakODRLinkage;
else
return llvm::GlobalVariable::WeakAnyLinkage;
- } else if (Linkage == GVA_TemplateInstantiation ||
- Linkage == GVA_ExplicitTemplateInstantiation)
+ } else if (Linkage == GVA_TemplateInstantiation || Linkage == GVA_StrongODR)
return llvm::GlobalVariable::WeakODRLinkage;
else if (!getLangOpts().CPlusPlus &&
((!CodeGenOpts.NoCommon && !D->hasAttr<NoCommonAttr>()) ||