diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-06-30 02:35:26 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-06-30 02:35:26 +0000 |
commit | 6fb0aee4f9dc261bbec72e1283ad8dc0557a6d96 (patch) | |
tree | 8a5df51bc33e8901405a9c426aee3eddf47ab881 /lib/Frontend | |
parent | f1d60eaf3f70975ee262852af2d6aeabd140ed58 (diff) |
Remove the ASTContext parameter from the getBody() methods of Decl and subclasses.
Timings showed no significant difference before and after the commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74504 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend')
-rw-r--r-- | lib/Frontend/AnalysisConsumer.cpp | 2 | ||||
-rw-r--r-- | lib/Frontend/DeclXML.cpp | 2 | ||||
-rw-r--r-- | lib/Frontend/PCHWriterDecl.cpp | 4 | ||||
-rw-r--r-- | lib/Frontend/ResolveLocation.cpp | 2 | ||||
-rw-r--r-- | lib/Frontend/RewriteBlocks.cpp | 6 | ||||
-rw-r--r-- | lib/Frontend/RewriteObjC.cpp | 8 |
6 files changed, 12 insertions, 12 deletions
diff --git a/lib/Frontend/AnalysisConsumer.cpp b/lib/Frontend/AnalysisConsumer.cpp index 2363ead9c1..3bdd0cacd7 100644 --- a/lib/Frontend/AnalysisConsumer.cpp +++ b/lib/Frontend/AnalysisConsumer.cpp @@ -307,7 +307,7 @@ void AnalysisConsumer::HandleTopLevelSingleDecl(Decl *D) { Opts.AnalyzeSpecificFunction != FD->getIdentifier()->getName()) break; - Stmt* Body = FD->getBody(*Ctx); + Stmt* Body = FD->getBody(); if (Body) HandleCode(FD, Body, FunctionActions); break; } diff --git a/lib/Frontend/DeclXML.cpp b/lib/Frontend/DeclXML.cpp index 5c21999bfa..dcc9ceaa66 100644 --- a/lib/Frontend/DeclXML.cpp +++ b/lib/Frontend/DeclXML.cpp @@ -147,7 +147,7 @@ void DocumentXML::writeDeclToXML(Decl *D) DeclPrinter(*this).Visit(D); if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { - if (Stmt *Body = FD->getBody(*Ctx)) { + if (Stmt *Body = FD->getBody()) { addSubNode("Body"); PrintStmt(Body); toParent(); diff --git a/lib/Frontend/PCHWriterDecl.cpp b/lib/Frontend/PCHWriterDecl.cpp index 97a3a78d35..a6843e1b9e 100644 --- a/lib/Frontend/PCHWriterDecl.cpp +++ b/lib/Frontend/PCHWriterDecl.cpp @@ -146,7 +146,7 @@ void PCHDeclWriter::VisitFunctionDecl(FunctionDecl *D) { VisitValueDecl(D); Record.push_back(D->isThisDeclarationADefinition()); if (D->isThisDeclarationADefinition()) - Writer.AddStmt(D->getBody(Context)); + Writer.AddStmt(D->getBody()); Writer.AddDeclRef(D->getPreviousDeclaration(), Record); Record.push_back(D->getStorageClass()); // FIXME: stable encoding Record.push_back(D->isInline()); @@ -172,7 +172,7 @@ void PCHDeclWriter::VisitObjCMethodDecl(ObjCMethodDecl *D) { // Unlike C/C++, method bodies will never be in header files. Record.push_back(D->getBody() != 0); if (D->getBody() != 0) { - Writer.AddStmt(D->getBody(Context)); + Writer.AddStmt(D->getBody()); Writer.AddDeclRef(D->getSelfDecl(), Record); Writer.AddDeclRef(D->getCmdDecl(), Record); } diff --git a/lib/Frontend/ResolveLocation.cpp b/lib/Frontend/ResolveLocation.cpp index 4bbb94d311..3908e89466 100644 --- a/lib/Frontend/ResolveLocation.cpp +++ b/lib/Frontend/ResolveLocation.cpp @@ -211,7 +211,7 @@ void DeclLocResolver::VisitFunctionDecl(FunctionDecl *D) { // Finally, search through the body of the function. if (D->isThisDeclarationADefinition()) { StmtLocResolver SLR(Ctx, Loc); - SLR.Visit(D->getBody(Ctx)); + SLR.Visit(D->getBody()); if (SLR.FoundIt()) { llvm::tie(Dcl, Stm) = SLR.getResult(); // If we didn't find a more immediate 'parent' declaration for the diff --git a/lib/Frontend/RewriteBlocks.cpp b/lib/Frontend/RewriteBlocks.cpp index 2848532600..29590de851 100644 --- a/lib/Frontend/RewriteBlocks.cpp +++ b/lib/Frontend/RewriteBlocks.cpp @@ -1089,7 +1089,7 @@ void RewriteBlocks::HandleDeclInMainFile(Decl *D) { RewriteFunctionProtoType(FD->getType(), FD); // FIXME: Handle CXXTryStmt - if (CompoundStmt *Body = FD->getCompoundBody(*Context)) { + if (CompoundStmt *Body = FD->getCompoundBody()) { CurFunctionDef = FD; FD->setBody(cast_or_null<CompoundStmt>(RewriteFunctionBody(Body))); // This synthesizes and inserts the block "impl" struct, invoke function, @@ -1101,7 +1101,7 @@ void RewriteBlocks::HandleDeclInMainFile(Decl *D) { } if (ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(D)) { RewriteMethodDecl(MD); - if (Stmt *Body = MD->getBody(*Context)) { + if (Stmt *Body = MD->getBody()) { CurMethodDef = MD; RewriteFunctionBody(Body); InsertBlockLiteralsWithinMethod(MD); @@ -1113,7 +1113,7 @@ void RewriteBlocks::HandleDeclInMainFile(Decl *D) { RewriteBlockPointerDecl(VD); if (VD->getInit()) { if (BlockExpr *CBE = dyn_cast<BlockExpr>(VD->getInit())) { - RewriteFunctionBody(CBE->getBody(*Context)); + RewriteFunctionBody(CBE->getBody()); // We've just rewritten the block body in place. // Now we snarf the rewritten text and stash it away for later use. diff --git a/lib/Frontend/RewriteObjC.cpp b/lib/Frontend/RewriteObjC.cpp index 6c1c10278a..a48e8e6eba 100644 --- a/lib/Frontend/RewriteObjC.cpp +++ b/lib/Frontend/RewriteObjC.cpp @@ -993,7 +993,7 @@ void RewriteObjC::RewriteImplementationDecl(Decl *OID) { ObjCMethodDecl *OMD = *I; RewriteObjCMethodDecl(OMD, ResultStr); SourceLocation LocStart = OMD->getLocStart(); - SourceLocation LocEnd = OMD->getCompoundBody(*Context)->getLocStart(); + SourceLocation LocEnd = OMD->getCompoundBody()->getLocStart(); const char *startBuf = SM->getCharacterData(LocStart); const char *endBuf = SM->getCharacterData(LocEnd); @@ -1009,7 +1009,7 @@ void RewriteObjC::RewriteImplementationDecl(Decl *OID) { ObjCMethodDecl *OMD = *I; RewriteObjCMethodDecl(OMD, ResultStr); SourceLocation LocStart = OMD->getLocStart(); - SourceLocation LocEnd = OMD->getCompoundBody(*Context)->getLocStart(); + SourceLocation LocEnd = OMD->getCompoundBody()->getLocStart(); const char *startBuf = SM->getCharacterData(LocStart); const char *endBuf = SM->getCharacterData(LocEnd); @@ -4554,7 +4554,7 @@ void RewriteObjC::HandleDeclInMainFile(Decl *D) { RewriteBlocksInFunctionProtoType(FD->getType(), FD); // FIXME: If this should support Obj-C++, support CXXTryStmt - if (CompoundStmt *Body = FD->getCompoundBody(*Context)) { + if (CompoundStmt *Body = FD->getCompoundBody()) { CurFunctionDef = FD; CollectPropertySetters(Body); CurrentBody = Body; @@ -4574,7 +4574,7 @@ void RewriteObjC::HandleDeclInMainFile(Decl *D) { return; } if (ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(D)) { - if (CompoundStmt *Body = MD->getBody()) { + if (CompoundStmt *Body = MD->getCompoundBody()) { CurMethodDef = MD; CollectPropertySetters(Body); CurrentBody = Body; |