From 0e671491d700af3988b4c905bd3872b565686970 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Mon, 30 Nov 2009 08:03:53 +0000 Subject: [PATCH] First pass at llvm.objectsize documentation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90116 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/docs/LangRef.html b/docs/LangRef.html index 17af1b34e12..5eeea6452e3 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -291,6 +291,8 @@ 'llvm.trap' Intrinsic
  • 'llvm.stackprotector' Intrinsic
  • +
  • + 'llvm.objectsize' Intrinsic
  • @@ -7246,6 +7248,41 @@ LLVM.

    + +
    + 'llvm.objectsize' Intrinsic +
    + +
    + +
    Syntax:
    +
    +  declare i32 @llvm.objectsize.i32( i8* <ptr>, i32 <type> )
    +  declare i64 @llvm.objectsize.i64( i8* <ptr>, i32 <type> )
    +
    + +
    Overview:
    +

    The llvm.objectsize intrinsic returns the constant number of bytes + from ptr to the end of the object ptr points to if it + can deduce this at compile time. If there are any side-effects in evaluating + the argument or it cannot deduce which objects ptr points to at compile + time the intrinsic returns (size_t) -1 for type 0 + or 1 and (size_t) 0 for type 2 or 3.

    + +
    Arguments:
    +

    The llvm.objectsize intrinsic takes two arguments. The first + argument is a pointer to the object ptr and an integer type. + type is an integer ranging from 0 to 3. The lsb corresponds to + a return value based on whole objects, the second bit whether or not we + return the maximum or minimum remaining bytes computed.

    + +
    Semantics:
    +

    The llvm.objectsize intrinsic is lowered to either a constant + representing the size of the object concerned or (size_t) -1 if + it cannot be determined at compile time.

    + +
    +