code generation for passing arguments

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?
Also, can some one point me to clang code where this is done?

thanks
shrey

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