diff options
Diffstat (limited to 'clang/lib/AST')
| -rw-r--r-- | clang/lib/AST/Decl.cpp | 5 | ||||
| -rw-r--r-- | clang/lib/AST/DeclBase.cpp | 8 | ||||
| -rw-r--r-- | clang/lib/AST/DeclPrinter.cpp | 2 |
3 files changed, 7 insertions, 8 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 89b87652d51..3d02150b65b 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -375,12 +375,11 @@ void FunctionDecl::Destroy(ASTContext& C) { } -Stmt *FunctionDecl::getBody(ASTContext &Context, - const FunctionDecl *&Definition) const { +Stmt *FunctionDecl::getBody(const FunctionDecl *&Definition) const { for (const FunctionDecl *FD = this; FD != 0; FD = FD->PreviousDeclaration) { if (FD->Body) { Definition = FD; - return FD->Body.get(Context.getExternalSource()); + return FD->Body.get(getASTContext().getExternalSource()); } } diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index 3d92331792d..a4609d45ad1 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -360,12 +360,12 @@ DeclContext *Decl::castToDeclContext(const Decl *D) { } } -CompoundStmt* Decl::getCompoundBody(ASTContext &Context) const { - return dyn_cast_or_null<CompoundStmt>(getBody(Context)); +CompoundStmt* Decl::getCompoundBody() const { + return dyn_cast_or_null<CompoundStmt>(getBody()); } -SourceLocation Decl::getBodyRBrace(ASTContext &Context) const { - Stmt *Body = getBody(Context); +SourceLocation Decl::getBodyRBrace() const { + Stmt *Body = getBody(); if (!Body) return SourceLocation(); if (CompoundStmt *CS = dyn_cast<CompoundStmt>(Body)) diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp index d3268300c3c..b46656ad3c7 100644 --- a/clang/lib/AST/DeclPrinter.cpp +++ b/clang/lib/AST/DeclPrinter.cpp @@ -361,7 +361,7 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) { } else Out << ' '; - D->getBody(Context)->printPretty(Out, Context, 0, SubPolicy, Indentation); + D->getBody()->printPretty(Out, Context, 0, SubPolicy, Indentation); Out << '\n'; } } |

