[llvm-commits] [llvm] r169145 - in /llvm/trunk: include/llvm/DebugInfo.h lib/VMCore/DebugInfo.cpp

Bill Wendling wendling at apple.com
Mon Dec 3 11:48:53 PST 2012


For the curious, this is for a fix that is coming later on today after the testsuite finishes.

-bw

On Dec 3, 2012, at 11:44 AM, Bill Wendling <isanbard at gmail.com> wrote:

> Author: void
> Date: Mon Dec  3 13:44:25 2012
> New Revision: 169145
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=169145&view=rev
> Log:
> Add 'getInt64Field()' method to get the signed integer instead of unsigned.
> 
> Modified:
>    llvm/trunk/include/llvm/DebugInfo.h
>    llvm/trunk/lib/VMCore/DebugInfo.cpp
> 
> Modified: llvm/trunk/include/llvm/DebugInfo.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo.h?rev=169145&r1=169144&r2=169145&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo.h Mon Dec  3 13:44:25 2012
> @@ -71,6 +71,7 @@
>       return (unsigned)getUInt64Field(Elt);
>     }
>     uint64_t getUInt64Field(unsigned Elt) const;
> +    int64_t getInt64Field(unsigned Elt) const;
>     DIDescriptor getDescriptorField(unsigned Elt) const;
> 
>     template <typename DescTy>
> 
> Modified: llvm/trunk/lib/VMCore/DebugInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/DebugInfo.cpp?rev=169145&r1=169144&r2=169145&view=diff
> ==============================================================================
> --- llvm/trunk/lib/VMCore/DebugInfo.cpp (original)
> +++ llvm/trunk/lib/VMCore/DebugInfo.cpp Mon Dec  3 13:44:25 2012
> @@ -75,6 +75,18 @@
>   return 0;
> }
> 
> +int64_t DIDescriptor::getInt64Field(unsigned Elt) const {
> +  if (DbgNode == 0)
> +    return 0;
> +
> +  if (Elt < DbgNode->getNumOperands())
> +    if (ConstantInt *CI
> +        = dyn_cast_or_null<ConstantInt>(DbgNode->getOperand(Elt)))
> +      return CI->getSExtValue();
> +
> +  return 0;
> +}
> +
> DIDescriptor DIDescriptor::getDescriptorField(unsigned Elt) const {
>   if (DbgNode == 0)
>     return DIDescriptor();
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list