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:
parent
bf6fcd8790
commit
a05079fa6c
1 changed files with 8 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue