[cfe-dev] code generation for passing arguments

Douglas Gregor dgregor at apple.com
Wed Jun 30 08:46:46 PDT 2010


On Jun 29, 2010, at 10:29 PM, shreyas krishnan wrote:

> Hi
>  I find that in some case clang when passing pointer arguments first
> stores the arguments to stack location and subsequently accesses these
> stack locations.
> I only see this happening when there are other global pointers in the
> code. Can some one pls let me know whats the rationale behind this?

How arguments are passed to functions is dictated by the ABI.

> Also,  can some one point me to clang code where this is done?


Look in Clang's CodeGen library, at ABIInfo and its various implementations that describe how to pass arguments for each target.

	- Doug



More information about the cfe-dev mailing list