From dd8004dc73d091ccb3927dbbc3b41639a3738ae3 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 27 Jul 2009 21:53:46 +0000 Subject: Add a new keyword 'inbounds' for use with getelementptr. See the LangRef.html changes for details. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77259 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'docs') diff --git a/docs/LangRef.html b/docs/LangRef.html index 1f9f80d..adc5d9a 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -2091,6 +2091,7 @@ Classifications instruction.
getelementptr ( CSTPTR, IDX0, IDX1, ... )
+
getelementptr inbounds ( CSTPTR, IDX0, IDX1, ... )
Perform the getelementptr operation on constants. As with the getelementptr instruction, the index list may have zero or more indexes, which are @@ -3902,6 +3903,7 @@ Instruction
Syntax:
   <result> = getelementptr <pty>* <ptrval>{, <ty> <idx>}*
+  <result> = getelementptr inbounds <pty>* <ptrval>{, <ty> <idx>}*
 
Overview:
@@ -3990,6 +3992,20 @@ entry: } +

If the inbounds keyword is present, the result value of the + getelementptr is undefined if the base pointer is not pointing + into an allocated object, or if any of the addresses formed by successive + addition of the offsets implied by the indices to the base address is + outside of the allocated object into which the base pointer points.

+ +

If the inbounds keyword is not present, the offsets are added to + the base address with silently-wrapping two's complement arithmetic, and + the result value of the getelementptr may be outside the object + pointed to by the base pointer. The result value may not necessarily be + used to access memory though, even if it happens to point into allocated + storage. See the Pointer Aliasing Rules + section for more information.

+

The getelementptr instruction is often confusing. For some more insight into how it works, see the getelementptr FAQ.

-- cgit v1.1