views:

166

answers:

2

Does Xcode support tail-call optimization on the iPhone?

+1  A: 

xcode just uses gcc -- assuming the same thing for the phone, the question is whether gcc performs tail call elimination. I don't believe it does in anything beyond the most basic of cases.

olliej
+1  A: 

Gcc probably does if you crank up the optimization level.

The newer LLVM may not quite yet:

http://llvm.org/docs/CodeGenerator.html#tailcallopt

That says x86/PPC only... it may be old though as Apple has been doing a lot of work to switch over to LLVM as the new compiler of choice (gcc is still the default though).

Kendall Helmstetter Gelner