[llvm] r176491 - Clarify comment for function getObjectSize

Dmitri Gribenko gribozavr at gmail.com
Tue Mar 5 10:51:02 PST 2013


On Tue, Mar 5, 2013 at 6:53 PM, Arnold Schwaighofer
<aschwaighofer at apple.com> wrote:
> Author: arnolds
> Date: Tue Mar  5 10:53:24 2013
> New Revision: 176491
>
> URL: http://llvm.org/viewvc/llvm-project?rev=176491&view=rev
> Log:
> Clarify comment for function getObjectSize
>
> Clarify that we mean the object starting at the pointer to the end of the
> underlying object and not the size of the whole allocated object.
>
> Modified:
>     llvm/trunk/include/llvm/Analysis/MemoryBuiltins.h
>
> Modified: llvm/trunk/include/llvm/Analysis/MemoryBuiltins.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/MemoryBuiltins.h?rev=176491&r1=176490&r2=176491&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Analysis/MemoryBuiltins.h (original)
> +++ llvm/trunk/include/llvm/Analysis/MemoryBuiltins.h Tue Mar  5 10:53:24 2013
> @@ -138,7 +138,9 @@ static inline CallInst *isFreeCall(Value
>  //
>
>  /// \brief Compute the size of the object pointed by Ptr. Returns true and the
> -/// object size in Size if successful, and false otherwise.
> +// object size in Size if successful, and false otherwise. In this context, by
> +// object we mean the region of memory starting at Ptr to the end of the
> +// underlying object pointed to by Ptr.
>  /// If RoundToAlign is true, then Size is rounded up to the aligment of allocas,
>  /// byval arguments, and global variables.
>  bool getObjectSize(const Value *Ptr, uint64_t &Size, const DataLayout *TD,

Arnold,

Please use three slashes so that it stays a documentation comment.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the llvm-commits mailing list