Reworked initialization of globals for -O gen-standalone-C++ code

This commit is contained in:
Vern Paxson 2025-09-30 11:27:53 -07:00
parent 0700427bac
commit eb13ff3110
15 changed files with 155 additions and 62 deletions

View file

@ -117,6 +117,11 @@ std::string GenIntVector(const std::vector<int>& vec);
std::string GenField(const ExprPtr& rec, int field);
std::string GenEnum(const TypePtr& et, const ValPtr& ev);
// Creates all the initializations needed to evaluate the given expression.
// Returns the maximum cohort associated with these.
friend class GlobalInitInfo;
int ReadyExpr(const ExprPtr& e);
// For record that are extended via redef's, maps fields beyond the original
// definition to locations in the global (in the compiled code) "field_mapping"
// array.