diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-01-25 00:08:28 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-01-25 00:08:28 +0000 |
commit | d4497dde6fc8f5ce79e0ec37682b8dc920bbbef0 (patch) | |
tree | 3106623ac7118b60c1cd6608c7d9aad8388b8c38 /lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | 57e2a1662e6e5faff01beba4b29ee35b635e0aa9 (diff) |
Clean up: since we have FunctionDecl::IsInline, make it store the right value
for template instantiations, and use it to simplify the implementation of
FunctionDecl::isInlined().
This incidentally changes the result of isInlined on a declared-but-not-defined
non-inline member function from true to false. This is sort of a bug fix, but
currently isInlined is only called on function definitions, so it has no visible
effects.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173397 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index b0935a54ac..b679d49215 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -1120,6 +1120,9 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl(FunctionDecl *D, D->isInlineSpecified(), D->hasWrittenPrototype(), D->isConstexpr()); + if (D->isInlined()) + Function->setImplicitlyInline(); + if (QualifierLoc) Function->setQualifierInfo(QualifierLoc); @@ -1485,6 +1488,9 @@ TemplateDeclInstantiator::VisitCXXMethodDecl(CXXMethodDecl *D, D->isConstexpr(), D->getLocEnd()); } + if (D->isInlined()) + Method->setImplicitlyInline(); + if (QualifierLoc) Method->setQualifierInfo(QualifierLoc); @@ -2763,6 +2769,9 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation, !PatternDecl->isInlined()) return; + if (PatternDecl->isInlined()) + Function->setImplicitlyInline(); + InstantiatingTemplate Inst(*this, PointOfInstantiation, Function); if (Inst) return; |