-O gen-standalone-C++ fixes for recent more aggressive AST profiling

This commit is contained in:
Vern Paxson 2024-12-12 14:26:21 -08:00
parent b547c7287d
commit 0a813a53c7
16 changed files with 188 additions and 104 deletions

View file

@ -1264,7 +1264,8 @@ string CPPCompile::GenEnum(const TypePtr& t, const ValPtr& ev) {
mapping_slot = num_ev_mappings++;
string enum_name = et->Lookup(v);
enum_names.emplace_back(TypeOffset(t), std::move(enum_name));
bool create_if_missing = standalone && obj_matches_opt_files(ev);
enum_names.emplace_back(EnumMappingInfo{TypeOffset(t), std::move(enum_name), create_if_missing});
if ( evm != enum_val_mappings.end() ) {
// We're already tracking this enum.