[cfe-commits] [PATCH]: GPROF implementation

Roman Divacky rdivacky at freebsd.org
Mon Jan 24 09:10:59 PST 2011


Hi,

The attached patch implemented GPROF (ie. -pg) support in clang.

It introduces GPROFInstrument CodeGenOption and sets it when -pg
is specified. The FreeBSD ::Link() method was adjusted to link
the correct libraries when -pg is specified. Finally, CodeGen
was modified to emit calls to "mcount" (the actual name differs
between arch/OS tuples) at the start of the function body.

This patch is quite FreeBSD specific (the driver modification
and the mcount name selection) but adding other OSes should be
trivial once this is commited.

Please review!

roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-gprof.patch
Type: text/x-diff
Size: 8245 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110124/f6c3bef9/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110124/f6c3bef9/attachment.sig>


More information about the cfe-commits mailing list