gccrs: Memoize Backend::wchar_type

gcc/rust/ChangeLog:

	* rust-gcc.cc
	(Backend::wchar_type): Store static wchar tree.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
This commit is contained in:
Owen Avery 2023-09-12 12:52:25 -04:00 committed by Arthur Cohen
parent bf6fcd8790
commit a05079fa6c

View file

@ -345,8 +345,14 @@ get_identifier_node (const std::string &str)
tree
wchar_type ()
{
tree wchar = make_unsigned_type (32);
TYPE_STRING_FLAG (wchar) = 1;
static tree wchar;
if (wchar == NULL_TREE)
{
wchar = make_unsigned_type (32);
TYPE_STRING_FLAG (wchar) = 1;
}
return wchar;
}