From 938443807150a1259283412bf8b89bd4141f9111 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 9 Nov 2009 18:40:39 +0000 Subject: [PATCH] Remove the "special case" for zero-length arrays, and rephrase this paragraph to be more precise. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86572 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/LangRef.html b/docs/LangRef.html index eea1f030609..be2b93b5a03 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -1576,12 +1576,13 @@ Classifications -

Note that 'variable sized arrays' can be implemented in LLVM with a zero - length array. Normally, accesses past the end of an array are undefined in - LLVM (e.g. it is illegal to access the 5th element of a 3 element array). As - a special case, however, zero length arrays are recognized to be variable - length. This allows implementation of 'pascal style arrays' with the LLVM - type "{ i32, [0 x float]}", for example.

+

Except when the inbounds keyword is present, there is no limitation + on indexing beyond the end of the array implied by the static type (though + any loads or stores must of course be within the bounds of the allocated + object!). This means that single-dimension 'variable sized array' addressing + can be implemented in LLVM with a zero length array type. An implementation + of 'pascal style arrays' in LLVM could use the type + "{ i32, [0 x float]}", for example.

Note that the code generator does not yet support large aggregate types to be used as function return types. The specific limit on how large an aggregate