On Thu, Jul 16, 2009 at 9:29 PM, Joshua Moore-Oliva<llvm-dev at chatgris.com> wrote:> To the list of modifications I need to be able to perform, add > > the ability to specify the ordering of local variables in the stackIf you need specific locations for everything you're allocating on the stack, you should probably just use a continuation-passing style like the one mentioned in http://nondot.org/sabre/LLVMNotes/ExplicitlyManagedStackFrames.txt ; LLVM won't preserve the values of variables allocated with alloca whose address isn't taken. -Eli
If I could reduce my requirements to the ability to the following: * Ability to know how much stack space a function requires * Move the stack pointer arbitrarily (the ability to write my own function prologue and epilogue, would need to be able to insert assembly/low level code here) before and after a method call could LLVM do that for me, using the system stack, (not continuations with malloc)? Or am I barking up the wrong tree with this tool? Thanks, Josh On July 17, 2009 12:42:23 am Eli Friedman wrote:> On Thu, Jul 16, 2009 at 9:29 PM, Joshua > > Moore-Oliva<llvm-dev at chatgris.com> wrote: > > To the list of modifications I need to be able to perform, add > > > > the ability to specify the ordering of local variables in the stack > > If you need specific locations for everything you're allocating on the > stack, you should probably just use a continuation-passing style like > the one mentioned in > http://nondot.org/sabre/LLVMNotes/ExplicitlyManagedStackFrames.txt ; > LLVM won't preserve the values of variables allocated with alloca > whose address isn't taken. > > -Eli > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
On Thu, Jul 23, 2009 at 4:06 PM, Joshua Moore-Oliva<llvm-dev at chatgris.com> wrote:> If I could reduce my requirements to the ability to the following: > * Ability to know how much stack space a function requires > * Move the stack pointer arbitrarily (the ability to write my own function > prologue and epilogue, would need to be able to insert assembly/low level > code here) before and after a method call > > could LLVM do that for me, using the system stack, (not continuations with > malloc)? Or am I barking up the wrong tree with this tool?Messing with the prologue and epilogue should be feasible, although you'll have to modify the code, and it's very platform-specific; see X86RegisterInfo::emitPrologue in lib/Target/X86/X86RegisterInfo.cpp in the source tree. -Eli