[cfe-commits] r74504 - in /cfe/trunk: include/clang/AST/ lib/AST/ lib/Analysis/ lib/CodeGen/ lib/Frontend/ lib/Sema/

Argiris Kirtzidis akyrtzi at gmail.com
Mon Jun 29 19:35:27 PDT 2009


Author: akirtzidis
Date: Mon Jun 29 21:35:26 2009
New Revision: 74504

URL: http://llvm.org/viewvc/llvm-project?rev=74504&view=rev
Log:
Remove the ASTContext parameter from the getBody() methods of Decl and subclasses.

Timings showed no significant difference before and after the commit.

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

Modified: cfe/trunk/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Mon Jun 29 21:35:26 2009
@@ -724,11 +724,11 @@
   /// 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 @@
   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.

Modified: cfe/trunk/include/clang/AST/DeclBase.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclBase.h?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/DeclBase.h (original)
+++ cfe/trunk/include/clang/AST/DeclBase.h Mon Jun 29 21:35:26 2009
@@ -314,14 +314,14 @@
   /// 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);

Modified: cfe/trunk/include/clang/AST/DeclObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/DeclObjC.h (original)
+++ cfe/trunk/include/clang/AST/DeclObjC.h Mon Jun 29 21:35:26 2009
@@ -242,10 +242,10 @@
     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.

Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Mon Jun 29 21:35:26 2009
@@ -2433,9 +2433,6 @@
   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());
   }

Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Mon Jun 29 21:35:26 2009
@@ -375,12 +375,11 @@
 }
 
 
-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());
     }
   }
 

Modified: cfe/trunk/lib/AST/DeclBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/lib/AST/DeclBase.cpp (original)
+++ cfe/trunk/lib/AST/DeclBase.cpp Mon Jun 29 21:35:26 2009
@@ -360,12 +360,12 @@
   }
 }
 
-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))

Modified: cfe/trunk/lib/AST/DeclPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclPrinter.cpp?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/lib/AST/DeclPrinter.cpp (original)
+++ cfe/trunk/lib/AST/DeclPrinter.cpp Mon Jun 29 21:35:26 2009
@@ -361,7 +361,7 @@
     } else
       Out << ' ';
 
-    D->getBody(Context)->printPretty(Out, Context, 0, SubPolicy, Indentation);
+    D->getBody()->printPretty(Out, Context, 0, SubPolicy, Indentation);
     Out << '\n';
   }
 }

Modified: cfe/trunk/lib/Analysis/BasicStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/BasicStore.cpp?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/BasicStore.cpp (original)
+++ cfe/trunk/lib/Analysis/BasicStore.cpp Mon Jun 29 21:35:26 2009
@@ -517,7 +517,7 @@
           
           // 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);
         }
       }
     }

Modified: cfe/trunk/lib/Analysis/BugReporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/BugReporter.cpp?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/BugReporter.cpp (original)
+++ cfe/trunk/lib/Analysis/BugReporter.cpp Mon Jun 29 21:35:26 2009
@@ -146,7 +146,7 @@
   
   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 @@
   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 @@
     // 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()));

Modified: cfe/trunk/lib/Analysis/CFRefCount.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFRefCount.cpp?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Mon Jun 29 21:35:26 2009
@@ -2632,7 +2632,7 @@
   
   if (!L.isValid()) {
     const Decl &D = BRC.getCodeDecl();
-    L = PathDiagnosticLocation(D.getBodyRBrace(BRC.getASTContext()), SMgr);
+    L = PathDiagnosticLocation(D.getBodyRBrace(), SMgr);
   }
   
   std::string sbuf;

Modified: cfe/trunk/lib/Analysis/CheckObjCDealloc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CheckObjCDealloc.cpp?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/CheckObjCDealloc.cpp (original)
+++ cfe/trunk/lib/Analysis/CheckObjCDealloc.cpp Mon Jun 29 21:35:26 2009
@@ -172,7 +172,7 @@
   }
   
   // 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 @@
               
     // 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)";

Modified: cfe/trunk/lib/Analysis/CheckObjCUnusedIVars.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CheckObjCUnusedIVars.cpp?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/CheckObjCUnusedIVars.cpp (original)
+++ cfe/trunk/lib/Analysis/CheckObjCUnusedIVars.cpp Mon Jun 29 21:35:26 2009
@@ -85,7 +85,7 @@
   // 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.

Modified: cfe/trunk/lib/CodeGen/CGObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjC.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjC.cpp Mon Jun 29 21:35:26 2009
@@ -129,8 +129,8 @@
   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

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Mon Jun 29 21:35:26 2009
@@ -226,7 +226,7 @@
   }
 
   // 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());

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Mon Jun 29 21:35:26 2009
@@ -1102,7 +1102,7 @@
   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 @@
   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;
   }

Modified: cfe/trunk/lib/Frontend/AnalysisConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/AnalysisConsumer.cpp?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/AnalysisConsumer.cpp (original)
+++ cfe/trunk/lib/Frontend/AnalysisConsumer.cpp Mon Jun 29 21:35:26 2009
@@ -307,7 +307,7 @@
           Opts.AnalyzeSpecificFunction != FD->getIdentifier()->getName())
         break;
       
-      Stmt* Body = FD->getBody(*Ctx);
+      Stmt* Body = FD->getBody();
       if (Body) HandleCode(FD, Body, FunctionActions);
       break;
     }

Modified: cfe/trunk/lib/Frontend/DeclXML.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/DeclXML.cpp?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/DeclXML.cpp (original)
+++ cfe/trunk/lib/Frontend/DeclXML.cpp Mon Jun 29 21:35:26 2009
@@ -147,7 +147,7 @@
   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();

Modified: cfe/trunk/lib/Frontend/PCHWriterDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHWriterDecl.cpp?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PCHWriterDecl.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHWriterDecl.cpp Mon Jun 29 21:35:26 2009
@@ -146,7 +146,7 @@
   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 @@
   // 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);
   }

Modified: cfe/trunk/lib/Frontend/ResolveLocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ResolveLocation.cpp?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/ResolveLocation.cpp (original)
+++ cfe/trunk/lib/Frontend/ResolveLocation.cpp Mon Jun 29 21:35:26 2009
@@ -211,7 +211,7 @@
   // 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

Modified: cfe/trunk/lib/Frontend/RewriteBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/RewriteBlocks.cpp?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/RewriteBlocks.cpp (original)
+++ cfe/trunk/lib/Frontend/RewriteBlocks.cpp Mon Jun 29 21:35:26 2009
@@ -1089,7 +1089,7 @@
     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 @@
   }
   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 @@
       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.

Modified: cfe/trunk/lib/Frontend/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/RewriteObjC.cpp?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/RewriteObjC.cpp (original)
+++ cfe/trunk/lib/Frontend/RewriteObjC.cpp Mon Jun 29 21:35:26 2009
@@ -993,7 +993,7 @@
     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 @@
     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 @@
     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 @@
     return;
   }
   if (ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(D)) {
-    if (CompoundStmt *Body = MD->getBody()) {
+    if (CompoundStmt *Body = MD->getCompoundBody()) {
       CurMethodDef = MD;
       CollectPropertySetters(Body);
       CurrentBody = Body;

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Mon Jun 29 21:35:26 2009
@@ -3063,7 +3063,7 @@
   
   // 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);
   }

Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Mon Jun 29 21:35:26 2009
@@ -818,7 +818,7 @@
   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;

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Mon Jun 29 21:35:26 2009
@@ -2750,7 +2750,7 @@
       // 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 @@
   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).

Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp Mon Jun 29 21:35:26 2009
@@ -1000,7 +1000,7 @@
                                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;

Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=74504&r1=74503&r2=74504&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Mon Jun 29 21:35:26 2009
@@ -670,7 +670,7 @@
   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 @@
     PatternDecl = Function->getInstantiatedFromMemberFunction();
   Stmt *Pattern = 0;
   if (PatternDecl)
-    Pattern = PatternDecl->getBody(Context, PatternDecl);
+    Pattern = PatternDecl->getBody(PatternDecl);
 
   if (!Pattern)
     return;
@@ -863,7 +863,7 @@
     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





More information about the cfe-commits mailing list