]> granicus.if.org Git - clang/commitdiff
Set ObjCMethodDecl's EndLoc to the '}' when it's a definition.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 18 Jul 2009 00:33:33 +0000 (00:33 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 18 Jul 2009 00:33:33 +0000 (00:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76269 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclObjC.h
lib/Sema/SemaDecl.cpp

index ded2fc97725f259021ae7b2ed8b47637e0772429..1411c37cad4f929c39e709040174402484af79fe 100644 (file)
@@ -125,7 +125,7 @@ private:
   ObjCList<ParmVarDecl> ParamInfo;
   
   /// List of attributes for this method declaration.
-  SourceLocation EndLoc; // the location of the ';' or '{'.
+  SourceLocation EndLoc; // the location of the ';' or '}'.
   
   // The following are only used for method definitions, null otherwise.
   // FIXME: space savings opportunity, consider a sub-class.
index 92afc343f39d3f07500b3f356ba51235522f6fd5..bc497aa1421e117a91ed9f3f729f3e0eba447567 100644 (file)
@@ -3208,6 +3208,7 @@ Sema::DeclPtrTy Sema::ActOnFinishFunctionBody(DeclPtrTy D, StmtArg BodyArg,
   } else if (ObjCMethodDecl *MD = dyn_cast_or_null<ObjCMethodDecl>(dcl)) {
     assert(MD == getCurMethodDecl() && "Method parsing confused");
     MD->setBody(Body);
+    MD->setEndLoc(Body->getLocEnd());
     
     if (!MD->isInvalidDecl())
       DiagnoseUnusedParameters(MD->param_begin(), MD->param_end());