]> granicus.if.org Git - clang/commitdiff
Remove the ASTContext parameter from the getBody() methods of Decl and subclasses.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 30 Jun 2009 02:35:26 +0000 (02:35 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 30 Jun 2009 02:35:26 +0000 (02:35 +0000)
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

26 files changed:
include/clang/AST/Decl.h
include/clang/AST/DeclBase.h
include/clang/AST/DeclObjC.h
include/clang/AST/Expr.h
lib/AST/Decl.cpp
lib/AST/DeclBase.cpp
lib/AST/DeclPrinter.cpp
lib/Analysis/BasicStore.cpp
lib/Analysis/BugReporter.cpp
lib/Analysis/CFRefCount.cpp
lib/Analysis/CheckObjCDealloc.cpp
lib/Analysis/CheckObjCUnusedIVars.cpp
lib/CodeGen/CGObjC.cpp
lib/CodeGen/CodeGenFunction.cpp
lib/CodeGen/CodeGenModule.cpp
lib/Frontend/AnalysisConsumer.cpp
lib/Frontend/DeclXML.cpp
lib/Frontend/PCHWriterDecl.cpp
lib/Frontend/ResolveLocation.cpp
lib/Frontend/RewriteBlocks.cpp
lib/Frontend/RewriteObjC.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclAttr.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaTemplateInstantiate.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp

index 1e82d6574fbb6e09a87165a9623ce3f461b0bb0d..ab92d52bb121f1d4e124f5eeca9335996517bf23 100644 (file)
@@ -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.
index 8c79a8426ffd24c0c980b10404f0c6cb8f11d1fd..8ef02705f27db98108487629883854060b13bec6 100644 (file)
@@ -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);
index 3943ddc19638c82dcd8788c69d8b5fa7a0e3a23c..8586c41891a130c11513f63fed4e10a45105615d 100644 (file)
@@ -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.
index fe027ffb57e516894544eba31b8f9879cd45b308..6a1046e6d03feec8ada649439134e342b129bb32 100644 (file)
@@ -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());
   }
index 89b87652d51c2fe2f176975450821c8faaed8294..3d02150b65bff96863f9c444e0e74148362915ca 100644 (file)
@@ -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());
     }
   }
 
index 3d92331792dc0d07755f0b029d3b09f7cedb15d7..a4609d45ad1a5cd830dcb23729636f769a10acd3 100644 (file)
@@ -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))
index d3268300c3ceea9249a169ba3c2f13e41ce7278d..b46656ad3c7dab5dbfde2f5eaf979db682d61694 100644 (file)
@@ -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';
   }
 }
index 7210d2c6794c593732f866a503921bf5c3993494..368345dfe453a6d7b35ef4aa3839f7964b83e26a 100644 (file)
@@ -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);
         }
       }
     }
index 38ea458a65994a39f8f404b67f179ba9fddae3db..3db96ca9eacba1b3ebe62a1a58144fcd7c74788b 100644 (file)
@@ -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()));
index b25fdb330c5ff1f79b1abb8e4d691cd7f2555729..619dbe537df31622fd4825890102f2a5b9235439 100644 (file)
@@ -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;
index f50d7a19c4209e1d4078d1d3c579e442fb8a90c9..e5f0485d8e09a860eae24a7799d04189299b346d 100644 (file)
@@ -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)";
index a68c82fff9e332ce3e344736adf58c69b47f2b49..bbcf90ec02cb43c09bd241df01cc1f55fc134386 100644 (file)
@@ -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.
index 51f9a7657928f5572734c5205d84751d0294079e..33cb5bca3869b4e0f3cdf5615e08b3b2c8a54909 100644 (file)
@@ -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
index 672f6da502b184e0a2201740bd70757ec83819be..c3f9364e7ae440d43ce63ad33414aa3f67c8b62d 100644 (file)
@@ -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());
index efa50ba3387cde577e5050ba0ddefa0c3c677f7e..f5a985628bd670dce39fe8d747714b7a6dbbeaf2 100644 (file)
@@ -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;
   }
index 2363ead9c19767810cd747f79f48a84a203202af..3bdd0cacd7a135e23bab869b1aaf9377fb2d3b4f 100644 (file)
@@ -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;
     }
index 5c21999bfa058b29c74366a8e8a22f3e6d7426cb..dcc9ceaa66e9b2b08bf5a9444948e4e4946e8c61 100644 (file)
@@ -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();
index 97a3a78d359e60994e2897f7d377b5f309bd0b31..a6843e1b9efdc348a1ebd51ddf16c17bbb9d1436 100644 (file)
@@ -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);
   }
index 4bbb94d311ad1761c923c80765b3280d3a4bb429..3908e894663dcb8dc3f7c257ffd38822ba354882 100644 (file)
@@ -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
index 28485326009a423a908b4a087176e302492704c1..29590de851d19818e5cf39c6eeed4b8ff330cd12 100644 (file)
@@ -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.
index 6c1c10278a35480ca788134fbebea43e3dd2f387..a48e8e6eba6be2dd712bcf110ad7b1341ea59bb8 100644 (file)
@@ -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;
index 513f3287b11d29586ac0b397d9e66d461bf667b9..a0e125f0fcef9edeb9136538dec5c624a6925b03 100644 (file)
@@ -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);
   }
index e251cab24a84ca3b3aad07147c580c8bc37ecccd..c5274f680157e4f6dd09521a9b4aa37a3b2abc14 100644 (file)
@@ -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;
index 62106eb58b15e19e5f6d5446d4d8062b192cea55..2102bed03b5c1f8483d29d8adb038c679ef20729 100644 (file)
@@ -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).
index f05323b511be2b88d0b6094f3c6e64cde41452bf..8af9ca1f635ac44df35fbf435db1616c5e967f07 100644 (file)
@@ -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;
index ac0f46efe9e35679597a4ba4762c74e5539b878d..8cda4ec836c90b310d46caa834d13ad68a19e888 100644 (file)
@@ -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