diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-07-07 11:31:19 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-07-07 11:31:19 +0000 |
commit | 36ea32257974baa08e0d10b4b44ffa1a2118a7b5 (patch) | |
tree | 08e6585f46beb9a33cd278305de545cffb271df5 /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | a22e8148d40b3e68e19182839b2e7031408b4af7 (diff) | |
download | bcm5719-llvm-36ea32257974baa08e0d10b4b44ffa1a2118a7b5.tar.gz bcm5719-llvm-36ea32257974baa08e0d10b4b44ffa1a2118a7b5.zip |
Introduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead of getBody() when we are just checking the existence of a body, to avoid de-serialization of the body from PCH.
Makes de-serialization of the function body even more "lazier".
llvm-svn: 107768
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index 06f38e88d58..853f7c30944 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -1181,7 +1181,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl(FunctionDecl *D, D->isThisDeclarationADefinition()) { // Check for a function body. const FunctionDecl *Definition = 0; - if (Function->getBody(Definition) && + if (Function->hasBody(Definition) && Definition->getTemplateSpecializationKind() == TSK_Undeclared) { SemaRef.Diag(Function->getLocation(), diag::err_redefinition) << Function->getDeclName(); @@ -1197,7 +1197,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl(FunctionDecl *D, ((*R)->getFriendObjectKind() != Decl::FOK_None)) { if (const FunctionDecl *RPattern = (*R)->getTemplateInstantiationPattern()) - if (RPattern->getBody(RPattern)) { + if (RPattern->hasBody(RPattern)) { SemaRef.Diag(Function->getLocation(), diag::err_redefinition) << Function->getDeclName(); SemaRef.Diag((*R)->getLocation(), diag::note_previous_definition); @@ -2040,7 +2040,7 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation, FunctionDecl *Function, bool Recursive, bool DefinitionRequired) { - if (Function->isInvalidDecl() || Function->getBody()) + if (Function->isInvalidDecl() || Function->hasBody()) return; // Never instantiate an explicit specialization. |