[cfe-commits] r76269 - in /cfe/trunk: include/clang/AST/DeclObjC.h lib/Sema/SemaDecl.cpp

Argiris Kirtzidis akyrtzi at gmail.com
Fri Jul 17 17:33:34 PDT 2009


Author: akirtzidis
Date: Fri Jul 17 19:33:33 2009
New Revision: 76269

URL: http://llvm.org/viewvc/llvm-project?rev=76269&view=rev
Log:
Set ObjCMethodDecl's EndLoc to the '}' when it's a definition.

Modified:
    cfe/trunk/include/clang/AST/DeclObjC.h
    cfe/trunk/lib/Sema/SemaDecl.cpp

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

==============================================================================
--- cfe/trunk/include/clang/AST/DeclObjC.h (original)
+++ cfe/trunk/include/clang/AST/DeclObjC.h Fri Jul 17 19:33:33 2009
@@ -125,7 +125,7 @@
   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.

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

==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Fri Jul 17 19:33:33 2009
@@ -3208,6 +3208,7 @@
   } 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());





More information about the cfe-commits mailing list