diff options
author | Cherry Zhang <cherryyz@google.com> | 2018-01-09 20:42:08 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-01-09 20:42:08 +0000 |
commit | 594d0e51b75c83cec9be74a304217e3f0c49da6c (patch) | |
tree | 970992e35310a150831f81a3e2b91149653faa35 /gcc/go/gccgo.texi | |
parent | f4f867ca3c54b1bc3d7f6bef824a2d7b78f86c59 (diff) | |
download | gcc-594d0e51b75c83cec9be74a304217e3f0c49da6c.zip gcc-594d0e51b75c83cec9be74a304217e3f0c49da6c.tar.gz gcc-594d0e51b75c83cec9be74a304217e3f0c49da6c.tar.bz2 |
compiler: add escape analysis debug hash
Add a flag -fgo-debug-escape-hash for debugging escape analysis.
It takes a binary string, optionally led by a "-", as argument.
When specified, the escape analysis runs only on functions whose
name is hashed to a value with matching suffix. The "-" sign
negates the match, i.e. the analysis runs only on functions with
non-matching hash.
Reviewed-on: https://go-review.googlesource.com/83878
* lang.opt (fgo-debug-escape-hash): New option.
* go-c.h (struct go_create_gogo_args): Add debug_escape_hash
field.
* go-lang.c (go_langhook_init): Set debug_escape_hash field.
* gccgo.texi (Invoking gccgo): Document -fgo-debug-escape-hash.
From-SVN: r256393
Diffstat (limited to 'gcc/go/gccgo.texi')
-rw-r--r-- | gcc/go/gccgo.texi | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/go/gccgo.texi b/gcc/go/gccgo.texi index f54cc10..48e69d4 100644 --- a/gcc/go/gccgo.texi +++ b/gcc/go/gccgo.texi @@ -239,6 +239,13 @@ heap when possible. In the future this may be the default. Output escape analysis debugging information. Larger values of @var{n} generate more information. +@item -fgo-debug-escape-hash=@var{n} +@cindex @option{-fgo-debug-escape-hash} +A hash value to debug escape analysis. @var{n} is a binary string. +This runs escape analysis only on functions whose names hash to values +that match the given suffix @var{n}. This can be used to binary +search across functions to uncover escape analysis bugs. + @item -fgo-c-header=@var{file} @cindex @option{-fgo-c-header} Write top-level named Go struct definitions to @var{file} as C code. |