search for: sumsofar

Displaying 2 results from an estimated 2 matches for "sumsofar".

2008 Apr 22
0
[LLVMdev] getting closer!
...le, something like this: class IntList { int count; ListEntry head; ListEntry tail; }; class IntListEntry { IntListEntry prev; IntListEntry next; int value; }; int SumOfList(IntList list) { return RecursiveSumOfList(list.head, 0); } int RecursiveSumOfList(IntList entry, int sumSoFar) { if (entry == null) return sumSoFar; return RecursiveSumOfList(entry.next, sumSoFar + entry.value); } Could be hypothetically translated into the following LLVM IR. Note the following aspects: Class metadata is emitted as constants to allow the GC to trace the heap. Offsets to re...
2008 Apr 22
2
[LLVMdev] getting closer!
On Apr 21, 2008, at 6:23 PM, Gordon Henriksen wrote: > On Apr 21, 2008, at 20:09, Terence Parr wrote: > >> Ok, I *might* be getting this from the assembly code. ... From >> that, it will push/pop in functions? If so, that's easy enough. :) > > Yup! Sounds like you've got it. Yup, what i was missing and what somebody should add to the doc is that