summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-05-15 06:25:57 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-05-15 06:25:57 +0000
commitc3d0733cf8d514ad4a149b79f2c569076aeb82a1 (patch)
tree1c0cc69a1164ee09b4e70a0fc7292a4ccb19a58f /clang/lib/AST/ASTContext.cpp
parentf675f4201b8a0e3060c1d08d1497ca431e1a0c74 (diff)
downloadbcm5719-llvm-c3d0733cf8d514ad4a149b79f2c569076aeb82a1.tar.gz
bcm5719-llvm-c3d0733cf8d514ad4a149b79f2c569076aeb82a1.zip
AST: Remove dead-code/update reference to standard
GetGVALinkageForFunction handles TSK_ExplicitInstantiationDeclaration twice, remove the redundant code trying to handle it again. While we are here, update the reference we make to the standard. It seems like another paragraph was added causing this text to get renumbered. llvm-svn: 208850
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 822ae54ae52..aa74e1a6924 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -7756,6 +7756,12 @@ GVALinkage ASTContext::GetGVALinkageForFunction(const FunctionDecl *FD) const {
case TSK_ExplicitInstantiationDefinition:
return GVA_StrongODR;
+ // C++11 [temp.explicit]p10:
+ // [ Note: The intent is that an inline function that is the subject of
+ // an explicit instantiation declaration will still be implicitly
+ // instantiated when used so that the body can be considered for
+ // inlining, but that no out-of-line copy of the inline function would be
+ // generated in the translation unit. -- end note ]
case TSK_ExplicitInstantiationDeclaration:
return GVA_AvailableExternally;
@@ -7778,16 +7784,6 @@ GVALinkage ASTContext::GetGVALinkageForFunction(const FunctionDecl *FD) const {
return GVA_AvailableExternally;
}
- // C++0x [temp.explicit]p9:
- // [ Note: The intent is that an inline function that is the subject of
- // an explicit instantiation declaration will still be implicitly
- // instantiated when used so that the body can be considered for
- // inlining, but that no out-of-line copy of the inline function would be
- // generated in the translation unit. -- end note ]
- if (FD->getTemplateSpecializationKind()
- == TSK_ExplicitInstantiationDeclaration)
- return GVA_AvailableExternally;
-
// Functions specified with extern and inline in -fms-compatibility mode
// forcibly get emitted. While the body of the function cannot be later
// replaced, the function definition cannot be discarded.
@@ -7910,7 +7906,8 @@ bool ASTContext::DeclMustBeEmitted(const Decl *D) {
// Variables that can be needed in other TUs are required.
GVALinkage L = GetGVALinkageForVariable(VD);
- if (L != GVA_Internal && L != GVA_DiscardableODR)
+ if (L != GVA_Internal && L != GVA_AvailableExternally &&
+ L != GVA_DiscardableODR)
return true;
// Variables that have destruction with side-effects are required.
OpenPOWER on IntegriCloud