tree: add build_string_literal overloads
commit244021b6c1a7bdeb777874ddc2ebcecb95610ef1
authorJason Merrill <jason@redhat.com>
Thu, 20 Oct 2022 17:51:37 +0000 (20 13:51 -0400)
committerJason Merrill <jason@redhat.com>
Mon, 24 Oct 2022 20:28:03 +0000 (24 16:28 -0400)
treec6b4c10a0916da733a3fc55f3bb726d5b7286dc6
parent205538832b7033699047900cf25928f5920d8b93
tree: add build_string_literal overloads

Simplify several calls to build_string_literal by not requiring redundant
strlen or IDENTIFIER_* in the caller.

I also corrected a wrong comment on IDENTIFIER_LENGTH.

gcc/ChangeLog:

* tree.h (build_string_literal): New one-argument overloads that
take tree (identifier) and const char *.
* builtins.cc (fold_builtin_FILE)
(fold_builtin_FUNCTION)
* gimplify.cc (gimple_add_init_for_auto_var)
* vtable-verify.cc (verify_bb_vtables): Simplify calls.

gcc/cp/ChangeLog:

* cp-gimplify.cc (fold_builtin_source_location)
* vtable-class-hierarchy.cc (register_all_pairs): Simplify calls to
build_string_literal.
(build_string_from_id): Remove.
gcc/builtins.cc
gcc/cp/cp-gimplify.cc
gcc/cp/vtable-class-hierarchy.cc
gcc/gimplify.cc
gcc/tree.h
gcc/vtable-verify.cc