How do I print the name of a variable created with create_tmp_var_raw

Tobias Burnus tobias@codesourcery.com
Tue Dec 8 19:48:15 GMT 2020


Hi Thomas,

On 08.12.20 19:34, Thomas Koenig via Fortran wrote:
> I would like to know the name of a variable created with
> create_tmp_var_raw, but it is not clear to my how to do it.
> ...
>    t = create_tmp_var_raw (type, prefix);
> -
> +  dprintf (2, "%s\n", IDENTIFIER_POINTER (DECL_NAME (t)));

I think that's okay. However:

Do you have a prefix or not?

If there is no prefix, DECL_NAME (t) == NULL.

If there is a prefix, the name is create_tmp_var_name (prefix),
which is (on most systems)   "%s.%d", prefix, tmp_var_id_num++

Otherwise, the D.1234 you see in the dump is mostly the result of
"D.%u", DECL_UID (t).

I hope it helps,

Tobias

-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter


More information about the Fortran mailing list