This PR creates the following APIs relating to loading and generating header and implementation files.
//"Header" is a set of module declarations (should contain no definitions, although it does not check)
// loaded_modules will contain a set of modules which this header declared.
bool loadHeader(Context*c, std::string filename, std::vector<Module*>& loaded_modules);
//"Impl" a set of modules and definitions.
//Each module in this file should already exist as a declaration in the context
bool linkImpl(Context*c, std::string filename);
//Given a set of modules, this will save a file with only the listed modules as declarations
bool serializeHeader(Context*c, std::string filename, std::vector<std::string> modules);
//Given a set of modules, this will save a file containing all the modules required to implement those modules.
bool serializeImpl(Context*c, std::string filename, std::vector<std::string> modules);
Along with a new API to serialize a single circuit (specified by a top) to json. This new API does not require any hacky library/namespace specification.
This PR creates the following APIs relating to loading and generating header and implementation files.
Along with a new API to serialize a single circuit (specified by a top) to json. This new API does not require any hacky library/namespace specification.
These APIs are tested in
test/gtests/test_linking.cpp
Internal changes required for this to work
pass.*, passmanager.cpp, *instancegraph.*