On 10/12/07, Duncan Sands <[EMAIL PROTECTED]> wrote: > ... many comment corrections Will correct them. > Note that ECX may be used if there is a 'nest' parameter, see this line: > + // The 'nest' parameter, if any, is passed in ECX. > + CCIfNest<CCAssignToReg<[ECX]>>, > > How do you avoid collisions? I don't. A copy paste error. But if i understand correctly the CC_X86_32_C calling convention does not prevent collisions either.
def CC_X86_32_C : CallingConv<[ // Promote i8/i16 arguments to i32. CCIfType<[i8, i16], CCPromoteToType<i32>>, // The 'nest' parameter, if any, is passed in ECX. CCIfNest<CCAssignToReg<[ECX]>>, // The first 3 integer arguments, if marked 'inreg' and if the call is not // a vararg call, are passed in integer registers. CCIfNotVarArg<CCIfInReg<CCIfType<[i32], CCAssignToReg<[EAX, EDX, ECX]>>>>, I would propose that tail call optimized fastcc functions do not support nested functions. The other possiblity would be to reserve a register for the nest parameter but then there is only one register left for argument passing. EAX used for nesting. ECX used for possible function pointer to be called. EDX (only register that can than be) used for inreg argument passing. > Ciao, > > > Duncan. > regards _______________________________________________ llvm-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
