[cfe-commits] r160634 - in /cfe/trunk: include/clang/AST/CommentSema.h lib/AST/CommentSema.cpp

Jordan Rose jordan_rose at apple.com
Mon Jul 23 11:27:17 PDT 2012


On Jul 23, 2012, at 10:40 , Dmitri Gribenko <gribozavr at gmail.com> wrote:

> +bool Sema::isFunctionDecl() {
> +  if (IsThisDeclInspected)
> +    return IsFunctionDecl;
> +
> +  inspectThisDecl();
> +  return IsFunctionDecl;
> +}
> +
> +ArrayRef<const ParmVarDecl *> Sema::getParamVars() {
> +  if (IsThisDeclInspected)
> +    return ParamVars;
> +
> +  inspectThisDecl();
> +  return ParamVars;
> +}

My personal preference would be to have a single return here, since the body is so short (just a call to the inspect… function).

if (!IsThisDeclInspected)
  inspectThisDecl();
return ParamVars;

But more importantly, I don't see where IsThisDeclInspected gets reset to false.

Jordan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120723/1a5a8230/attachment.html>


More information about the cfe-commits mailing list