]> granicus.if.org Git - clang/commitdiff
Not sure why we bother updating FunctionDecl's EndRangeLoc in FunctionDecl::setParams.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 30 Jul 2011 17:23:28 +0000 (17:23 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 30 Jul 2011 17:23:28 +0000 (17:23 +0000)
EndRangeLoc should always be set to at least the ending paren or brace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136573 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Decl.cpp

index 64fd355446a1d4bc4ca3f8f4340ca9ba525cecd2..32b9a624e0e0899d385b74f361856f917242fdf5 100644 (file)
@@ -1697,11 +1697,6 @@ void FunctionDecl::setParams(ASTContext &C,
     void *Mem = C.Allocate(sizeof(ParmVarDecl*)*NumParams);
     ParamInfo = new (Mem) ParmVarDecl*[NumParams];
     memcpy(ParamInfo, NewParamInfo, sizeof(ParmVarDecl*)*NumParams);
-
-    // Update source range. The check below allows us to set EndRangeLoc before
-    // setting the parameters.
-    if (EndRangeLoc.isInvalid() || EndRangeLoc == getLocation())
-      EndRangeLoc = NewParamInfo[NumParams-1]->getLocEnd();
   }
 }