Simplify FunctionDecl::getBody.

llvm-svn: 193025
This commit is contained in:
Rafael Espindola 2013-10-19 01:37:17 +00:00
parent c2697f8390
commit 4450301eaf
1 changed files with 5 additions and 9 deletions

View File

@ -2233,15 +2233,11 @@ bool FunctionDecl::isDefined(const FunctionDecl *&Definition) const {
}
Stmt *FunctionDecl::getBody(const FunctionDecl *&Definition) const {
for (redecl_iterator I = redecls_begin(), E = redecls_end(); I != E; ++I) {
if (I->Body) {
Definition = *I;
return I->Body.get(getASTContext().getExternalSource());
} else if (I->IsLateTemplateParsed) {
Definition = *I;
return 0;
}
}
if (!hasBody(Definition))
return 0;
if (Definition->Body)
return Definition->Body.get(getASTContext().getExternalSource());
return 0;
}