Re: Passing an string argument to a GIMPLE call

2020-06-28 Thread Richard Biener via Gcc
On June 27, 2020 11:15:50 PM GMT+02:00, David Malcolm wrote: >On Sat, 2020-06-27 at 21:27 +0800, Shuai Wang via Gcc wrote: >> Dear Richard, >> >> Thanks for the info. My bad, I will need to append "\0" at the end of >> the >> string. Also, a follow-up question which I just cannot find an >> answ

Re: Passing an string argument to a GIMPLE call

2020-06-27 Thread David Malcolm via Gcc
On Sat, 2020-06-27 at 21:27 +0800, Shuai Wang via Gcc wrote: > Dear Richard, > > Thanks for the info. My bad, I will need to append "\0" at the end of > the > string. Also, a follow-up question which I just cannot find an > answer: > typically in the plugin entry point: > > virtual unsigned int e

Re: Passing an string argument to a GIMPLE call

2020-06-27 Thread Shuai Wang via Gcc
Dear Richard, Thanks for the info. My bad, I will need to append "\0" at the end of the string. Also, a follow-up question which I just cannot find an answer: typically in the plugin entry point: virtual unsigned int execute(function *fun) How do I know which C files I am instrumenting? Can I so

Re: Passing an string argument to a GIMPLE call

2020-06-27 Thread Richard Biener via Gcc
On June 27, 2020 6:21:12 AM GMT+02:00, Shuai Wang via Gcc wrote: >Hello, > >I am writing the following statement to make a GIMPLE call: > > tree function_fn_type = build_function_type_list(void_type_node, >void_type_node, integer_type_node, NULL_TREE); > tree sancov_fndecl = build_fn_de

Passing an string argument to a GIMPLE call

2020-06-26 Thread Shuai Wang via Gcc
Hello, I am writing the following statement to make a GIMPLE call: tree function_fn_type = build_function_type_list(void_type_node, void_type_node, integer_type_node, NULL_TREE); tree sancov_fndecl = build_fn_decl("my_instrumentation_function", function_fn_type); auto gcall = gi