In alloca, is it required that NumElements be a literal integer, or can it be a computed result? The real question is whether the current IR can support a one-stack implementation of Ada's dynamically sized stack frames. shap
On Tue, Oct 7, 2008 at 3:01 PM, Jonathan S. Shapiro <shap at eros-os.com> wrote:> In alloca, is it required that NumElements be a literal integer, or can > it be a computed result?The LLVM alloca instruction works with non-constant integers. It's used for stuff like calls to the alloca function and VLAs in llvm-gcc. -Eli
On Wednesday 08 October 2008 00:01:28 Jonathan S. Shapiro wrote:> In alloca, is it required that NumElements be a literal integer, or can > it be a computed result?It can be a computed result.> The real question is whether the current IR can support a one-stack > implementation of Ada's dynamically sized stack frames.The Ada front-end in llvm-gcc does make use of this but it also uses a secondary stack in order to return function results for which the size is not known at call time, eg for a function returning String. Ciao, Duncan.