[LLVMdev] Fix for non-standard variable length array
Paolo Invernizzi
arathorn at fastwebnet.it
Mon Oct 18 06:25:29 PDT 2004
There was a similar problem some time ago, and was resolved with
alloca. I think it's a better solution to use the stack instead of the
heap...
---
Paolo Invernizzi
On Oct 18, 2004, at 3:12 PM, Morten Ofstad wrote:
> In lib/CodeGen/LiveVariables.cpp a variable length array is created.
> Since this is not standard C++, it won't compile with Visual Studio
> (for interested readers, there is a discussion of why the C99 style
> variable length array is a bad idea in C++ here:
> http://www.cuj.com/documents/s=8191/cuj0209stroustr/) I have made a
> patch that uses 'new' and 'delete' instead - if this is unacceptable
> for performance reasons, I suggest just choosing some fixed size for
> the arrays (128 for example) and asserting that the actual number of
> registers is smaller than this. Patch follows.
>
> On a side note I can now run the fibonacci example with the x86
> backend compiled with Visual C -- For fun I compiled the fibonacci
> function also with Visual C with max. optimizes, and the LLVM compiled
> version is slightly faster! I'm impressed! More patches will follow,
> sorry for flooding...
>
> m.
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
More information about the llvm-dev
mailing list