From 7ed3f79c87f2cda1fde37b3fc6b6e272360e3b3d Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Fri, 6 Dec 2024 16:16:35 -0800 Subject: [PATCH] modified merge_types() to skip work if given identical types, which also preserves type names (useful for -O gen-C++) --- src/Type.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Type.cc b/src/Type.cc index 4b6d78a066..e32a4565bb 100644 --- a/src/Type.cc +++ b/src/Type.cc @@ -2376,6 +2376,9 @@ TypeListPtr merge_list_types(const Type* t1, const Type* t2) { } TypePtr merge_types(const TypePtr& arg_t1, const TypePtr& arg_t2) { + if ( arg_t1 == arg_t2 ) + return arg_t1; + auto t1 = arg_t1.get(); auto t2 = arg_t2.get(); // t1 = flatten_type(t1);