diff options
26 files changed, 50 insertions, 55 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index 1e82d6574f..ab92d52bb1 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -724,11 +724,11 @@ public: /// function. The variant that accepts a FunctionDecl pointer will /// set that function declaration to the actual declaration /// containing the body (if there is one). - Stmt *getBody(ASTContext &Context, const FunctionDecl *&Definition) const; + Stmt *getBody(const FunctionDecl *&Definition) const; - virtual Stmt *getBody(ASTContext &Context) const { + virtual Stmt *getBody() const { const FunctionDecl* Definition; - return getBody(Context, Definition); + return getBody(Definition); } /// \brief If the function has a body that is immediately available, @@ -1442,8 +1442,8 @@ public: bool IsVariadic() const { return isVariadic; } void setIsVariadic(bool value) { isVariadic = value; } - CompoundStmt *getBody() const { return (CompoundStmt*) Body; } - Stmt *getBody(ASTContext &C) const { return (Stmt*) Body; } + CompoundStmt *getCompoundBody() const { return (CompoundStmt*) Body; } + Stmt *getBody() const { return (Stmt*) Body; } void setBody(CompoundStmt *B) { Body = (Stmt*) B; } // Iterator access to formal parameters. diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index 8c79a8426f..8ef02705f2 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -314,14 +314,14 @@ public: /// getBody - If this Decl represents a declaration for a body of code, /// such as a function or method definition, this method returns the /// top-level Stmt* of that body. Otherwise this method returns null. - virtual Stmt* getBody(ASTContext &Context) const { return 0; } + virtual Stmt* getBody() const { return 0; } /// getCompoundBody - Returns getBody(), dyn_casted to a CompoundStmt. - CompoundStmt* getCompoundBody(ASTContext &Context) const; + CompoundStmt* getCompoundBody() const; /// getBodyRBrace - Gets the right brace of the body, if a body exists. /// This works whether the body is a CompoundStmt or a CXXTryStmt. - SourceLocation getBodyRBrace(ASTContext &Context) const; + SourceLocation getBodyRBrace() const; // global temp stats (until we have a per-module visitor) static void addDeclKind(Kind k); diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h index 3943ddc196..8586c41891 100644 --- a/include/clang/AST/DeclObjC.h +++ b/include/clang/AST/DeclObjC.h @@ -242,10 +242,10 @@ public: return ImplementationControl(DeclImplementation); } - virtual Stmt *getBody(ASTContext &C) const { + virtual Stmt *getBody() const { return (Stmt*) Body; } - CompoundStmt *getBody() { return (CompoundStmt*)Body; } + CompoundStmt *getCompoundBody() { return (CompoundStmt*)Body; } void setBody(Stmt *B) { Body = B; } // Implement isa/cast/dyncast/etc. diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h index fe027ffb57..6a1046e6d0 100644 --- a/include/clang/AST/Expr.h +++ b/include/clang/AST/Expr.h @@ -2433,9 +2433,6 @@ public: const Stmt *getBody() const; Stmt *getBody(); - const Stmt *getBody(ASTContext &C) const { return getBody(); } - Stmt *getBody(ASTContext &C) { return getBody(); } - virtual SourceRange getSourceRange() const { return SourceRange(getCaretLocation(), getBody()->getLocEnd()); } diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 89b87652d5..3d02150b65 100644 --- a/lib/AST/Decl.cpp +++ b/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/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 3d92331792..a4609d45ad 100644 --- a/lib/AST/DeclBase.cpp +++ b/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/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp index d3268300c3..b46656ad3c 100644 --- a/lib/AST/DeclPrinter.cpp +++ b/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'; } } diff --git a/lib/Analysis/BasicStore.cpp b/lib/Analysis/BasicStore.cpp index 7210d2c679..368345dfe4 100644 --- a/lib/Analysis/BasicStore.cpp +++ b/lib/Analysis/BasicStore.cpp @@ -517,7 +517,7 @@ Store BasicStoreManager::getInitialStore() { // Scan the method for ivar references. While this requires an // entire AST scan, the cost should not be high in practice. - St = scanForIvars(MD->getBody(getContext()), PD, St); + St = scanForIvars(MD->getBody(), PD, St); } } } diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp index 38ea458a65..3db96ca9ea 100644 --- a/lib/Analysis/BugReporter.cpp +++ b/lib/Analysis/BugReporter.cpp @@ -146,7 +146,7 @@ public: ParentMap& getParentMap() { if (PM.get() == 0) - PM.reset(new ParentMap(getCodeDecl().getBody(getASTContext()))); + PM.reset(new ParentMap(getCodeDecl().getBody())); return *PM.get(); } @@ -182,8 +182,7 @@ PathDiagnosticBuilder::ExecutionContinues(const ExplodedNode<GRState>* N) { if (Stmt *S = GetNextStmt(N)) return PathDiagnosticLocation(S, getSourceManager()); - return FullSourceLoc(getCodeDecl().getBodyRBrace(getASTContext()), - getSourceManager()); + return FullSourceLoc(getCodeDecl().getBodyRBrace(), getSourceManager()); } PathDiagnosticLocation @@ -893,7 +892,7 @@ public: // statement (if it doesn't already exist). // FIXME: Should handle CXXTryStmt if analyser starts supporting C++. if (const CompoundStmt *CS = - PDB.getCodeDecl().getCompoundBody(PDB.getASTContext())) + PDB.getCodeDecl().getCompoundBody()) if (!CS->body_empty()) { SourceLocation Loc = (*CS->body_begin())->getLocStart(); rawAddEdge(PathDiagnosticLocation(Loc, PDB.getSourceManager())); diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index b25fdb330c..619dbe537d 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -2632,7 +2632,7 @@ CFRefLeakReport::getEndPath(BugReporterContext& BRC, if (!L.isValid()) { const Decl &D = BRC.getCodeDecl(); - L = PathDiagnosticLocation(D.getBodyRBrace(BRC.getASTContext()), SMgr); + L = PathDiagnosticLocation(D.getBodyRBrace(), SMgr); } std::string sbuf; diff --git a/lib/Analysis/CheckObjCDealloc.cpp b/lib/Analysis/CheckObjCDealloc.cpp index f50d7a19c4..e5f0485d8e 100644 --- a/lib/Analysis/CheckObjCDealloc.cpp +++ b/lib/Analysis/CheckObjCDealloc.cpp @@ -172,7 +172,7 @@ void clang::CheckObjCDealloc(ObjCImplementationDecl* D, } // dealloc found. Scan for missing [super dealloc]. - if (MD->getBody(Ctx) && !scan_dealloc(MD->getBody(Ctx), S)) { + if (MD->getBody() && !scan_dealloc(MD->getBody(), S)) { const char* name = LOpts.getGCMode() == LangOptions::NonGC ? "missing [super dealloc]" @@ -223,7 +223,7 @@ void clang::CheckObjCDealloc(ObjCImplementationDecl* D, // ivar must be released if and only if the kind of setter was not 'assign' bool requiresRelease = PD->getSetterKind() != ObjCPropertyDecl::Assign; - if(scan_ivar_release(MD->getBody(Ctx), ID, PD, RS, SelfII, Ctx) + if(scan_ivar_release(MD->getBody(), ID, PD, RS, SelfII, Ctx) != requiresRelease) { const char *name; const char* category = "Memory (Core Foundation/Objective-C)"; diff --git a/lib/Analysis/CheckObjCUnusedIVars.cpp b/lib/Analysis/CheckObjCUnusedIVars.cpp index a68c82fff9..bbcf90ec02 100644 --- a/lib/Analysis/CheckObjCUnusedIVars.cpp +++ b/lib/Analysis/CheckObjCUnusedIVars.cpp @@ -85,7 +85,7 @@ void clang::CheckObjCUnusedIvar(ObjCImplementationDecl* D, BugReporter& BR) { // Now scan the methods for accesses. for (ObjCImplementationDecl::instmeth_iterator I = D->instmeth_begin(Ctx), E = D->instmeth_end(Ctx); I!=E; ++I) - Scan(M, (*I)->getBody(Ctx)); + Scan(M, (*I)->getBody()); // Scan for @synthesized property methods that act as setters/getters // to an ivar. diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp index 51f9a76579..33cb5bca38 100644 --- a/lib/CodeGen/CGObjC.cpp +++ b/lib/CodeGen/CGObjC.cpp @@ -129,8 +129,8 @@ void CodeGenFunction::GenerateObjCMethod(const ObjCMethodDecl *OMD) { if (CGM.getDebugInfo() && !OMD->hasAttr<NodebugAttr>()) DebugInfo = CGM.getDebugInfo(); StartObjCMethod(OMD, OMD->getClassInterface()); - EmitStmt(OMD->getBody(getContext())); - FinishFunction(OMD->getBodyRBrace(getContext())); + EmitStmt(OMD->getBody()); + FinishFunction(OMD->getBodyRBrace()); } // FIXME: I wasn't sure about the synthesis approach. If we end up generating an diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index 672f6da502..c3f9364e7a 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -226,7 +226,7 @@ void CodeGenFunction::GenerateCode(const FunctionDecl *FD, } // FIXME: Support CXXTryStmt here, too. - if (const CompoundStmt *S = FD->getCompoundBody(getContext())) { + if (const CompoundStmt *S = FD->getCompoundBody()) { StartFunction(FD, FD->getResultType(), Fn, Args, S->getLBracLoc()); EmitStmt(S); FinishFunction(S->getRBracLoc()); diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index efa50ba338..f5a985628b 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1102,7 +1102,7 @@ void CodeGenModule::EmitAliasDefinition(const ValueDecl *D) { if (D->hasAttr<DLLExportAttr>()) { if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { // The dllexport attribute is ignored for undefined symbols. - if (FD->getBody(getContext())) + if (FD->getBody()) GA->setLinkage(llvm::Function::DLLExportLinkage); } else { GA->setLinkage(llvm::Function::DLLExportLinkage); @@ -1550,7 +1550,7 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { case Decl::ObjCMethod: { ObjCMethodDecl *OMD = cast<ObjCMethodDecl>(D); // If this is not a prototype, emit the body. - if (OMD->getBody(getContext())) + if (OMD->getBody()) CodeGenFunction(*this).GenerateObjCMethod(OMD); break; } 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; diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 513f3287b1..a0e125f0fc 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -3063,7 +3063,7 @@ Sema::DeclPtrTy Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclPtrTy D) { // See if this is a redefinition. const FunctionDecl *Definition; - if (FD->getBody(Context, Definition)) { + if (FD->getBody(Definition)) { Diag(FD->getLocation(), diag::err_redefinition) << FD->getDeclName(); Diag(Definition->getLocation(), diag::note_previous_definition); } diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index e251cab24a..c5274f6801 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -818,7 +818,7 @@ static void HandleWeakImportAttr(Decl *D, const AttributeList &Attr, Sema &S) { if (VarDecl *VD = dyn_cast<VarDecl>(D)) { isDef = (!VD->hasExternalStorage() || VD->getInit()); } else if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { - isDef = FD->getBody(S.Context); + isDef = FD->getBody(); } else if (isa<ObjCPropertyDecl>(D) || isa<ObjCMethodDecl>(D)) { // We ignore weak import on properties and methods return; diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 62106eb58b..2102bed03b 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -2750,7 +2750,7 @@ Sema::ActOnCallExpr(Scope *S, ExprArg fn, SourceLocation LParenLoc, // Check if we have too few/too many template arguments, based // on our knowledge of the function definition. const FunctionDecl *Def = 0; - if (FDecl->getBody(Context, Def) && NumArgs != Def->param_size()) { + if (FDecl->getBody(Def) && NumArgs != Def->param_size()) { const FunctionProtoType *Proto = Def->getType()->getAsFunctionProtoType(); if (!Proto || !(Proto->isVariadic() && NumArgs >= Def->param_size())) { @@ -5607,7 +5607,7 @@ void Sema::MarkDeclarationReferenced(SourceLocation Loc, Decl *D) { if (FunctionDecl *Function = dyn_cast<FunctionDecl>(D)) { // Implicit instantiation of function templates and member functions of // class templates. - if (!Function->getBody(Context)) { + if (!Function->getBody()) { // FIXME: distinguish between implicit instantiations of function // templates and explicit specializations (the latter don't get // instantiated, naturally). diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index f05323b511..8af9ca1f63 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -1000,7 +1000,7 @@ Sema::InstantiateClassMembers(SourceLocation PointOfInstantiation, DEnd = Instantiation->decls_end(Context); D != DEnd; ++D) { if (FunctionDecl *Function = dyn_cast<FunctionDecl>(*D)) { - if (!Function->getBody(Context)) + if (!Function->getBody()) InstantiateFunctionDefinition(PointOfInstantiation, Function); } else if (VarDecl *Var = dyn_cast<VarDecl>(*D)) { const VarDecl *Def = 0; diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index ac0f46efe9..8cda4ec836 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -670,7 +670,7 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation, if (Function->isInvalidDecl()) return; - assert(!Function->getBody(Context) && "Already instantiated!"); + assert(!Function->getBody() && "Already instantiated!"); // Find the function body that we'll be substituting. const FunctionDecl *PatternDecl = 0; @@ -680,7 +680,7 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation, PatternDecl = Function->getInstantiatedFromMemberFunction(); Stmt *Pattern = 0; if (PatternDecl) - Pattern = PatternDecl->getBody(Context, PatternDecl); + Pattern = PatternDecl->getBody(PatternDecl); if (!Pattern) return; @@ -863,7 +863,7 @@ void Sema::PerformPendingImplicitInstantiations() { PendingImplicitInstantiations.pop(); if (FunctionDecl *Function = dyn_cast<FunctionDecl>(Inst.first)) - if (!Function->getBody(Context)) + if (!Function->getBody()) InstantiateFunctionDefinition(/*FIXME:*/Inst.second, Function); // FIXME: instantiation static member variables |