[llvm-commits] [llvm] r127922 - /llvm/trunk/lib/Transforms/Utils/Local.cpp

Frits van Bommel fvbommel at gmail.com
Sat Mar 19 00:31:41 PDT 2011


On Sat, Mar 19, 2011 at 12:28 AM, Devang Patel <dpatel at apple.com> wrote:
> -  // We don't want debug info removed by anything this general.
> +  // We don't want debug info removed by anything this general, unless
> +  // debug info is empty.
> +  if (DbgDeclareInst *DDI = dyn_cast<DbgDeclareInst>(I)) {
> +    if (DDI->getAddress())
> +      return false;
> +    else
> +      return true;
> +  } else if (DbgValueInst *DVI = dyn_cast<DbgValueInst>(I)) {
> +    if (DVI->getValue())
> +      return false;
> +    else
> +      return true;
> +  }

None of those three 'else's are needed, their 'then' cases all end in 'return'.




More information about the llvm-commits mailing list