> URL: http://llvm.org/viewvc/llvm-project?rev=46004&view=rev > Log: > Make use of existing gcc facility to determine if an aggregate > argument should be passed ByVal in x86-64 mode.
Nice. > +/* Target hook for llvm-abi.h. It returns true if an aggregate of the > + specified type should be passed in memory. This is only called for > + x86-64. */ > +int llvm_x86_64_should_pass_aggregate_in_memory(tree type) { > + int needed_intregs, needed_sseregs; > + enum machine_mode mode = type_natural_mode (type); > + return !examine_argument(mode, type, 1, &needed_intregs, > &needed_sseregs); Please document what this is doing: /* if examine_argument says that this arg takes 0 registers, it is passed in memory, pass with byval. */ or something. > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h (original) > +++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h Tue Jan 15 > 02:18:25 2008 > @@ -62,8 +62,11 @@ > } \ > } > > +extern int llvm_x86_64_should_pass_aggregate_in_memory(tree); > + > #define LLVM_SHOULD_PASS_AGGREGATE_USING_BYVAL_ATTR(X) \ > - (!TARGET_64BIT) > + ((!TARGET_64BIT) \ > + ? true : llvm_x86_64_should_pass_aggregate_in_memory(X)) How about: (!TARGET_64BIT || llvm_x86_64_should_pass_aggregate_in_memory(X)) -Chris _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits