]> gcc.gnu.org Git - gcc.git/commit
compiler: compile runtime.getcaller{pc,sp} into builtin functions
authorIan Lance Taylor <iant@golang.org>
Thu, 22 Sep 2016 20:32:16 +0000 (20:32 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 22 Sep 2016 20:32:16 +0000 (20:32 +0000)
commit0cb904afbe28927d4efb343558e641e35580d72c
treec603e6261575dd4da3b11d23174440467f68b4db
parent1c681c7bf7e28ceeeb50e90444b89f833f7bcc23
compiler: compile runtime.getcaller{pc,sp} into builtin functions

    The runtime functions runtime.getcallerpc and runtime.getcallersp are
    intended to be efficient ways to get the return and frame address of the
    caller (that is, the caller of runtime.getcallerpc).  In the C code that
    is implemented by simply using C macros:

    This patch essentially implements those macros in the Go code.

    It would be nice if we could just use //extern for this, but it doesn't
    work because the runtime code passes the right argument.  Of course we
    could change the runtime code, but these are common enough that I'd
    prefer to avoid the difference from the gc version of the runtime code.

    This patch corrects the existing declaration of __builtin_return_address
    to use uint32, rather than uint, for the parameter type.  The builtin
    functions take the C type "unsigned int", which for the targets we use
    corresponds to the Go type uint32.  Not that it should matter, really.

    Reviewed-on: https://go-review.googlesource.com/29653

From-SVN: r240382
gcc/go/ChangeLog
gcc/go/go-gcc.cc
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/expressions.h
gcc/go/gofrontend/gogo.cc
gcc/go/gofrontend/gogo.h
This page took 0.065872 seconds and 5 git commands to generate.