27 lines
938 B
C++
27 lines
938 B
C++
#include <iostream>
|
|
#include <final.h>
|
|
#include <stage0.h>
|
|
|
|
#include <safe-input.h>
|
|
|
|
void on_finish_unit(void* plugin_data, void* user_data) {
|
|
/*
|
|
TODO
|
|
The result lbasename(...) is not unique (e.g., "file.c" and "sub/file.c")
|
|
Calculate UID for compilation unit -> hash(main_input_filename)
|
|
Add UID symbol to CU -> __spslr_cu_<uid>
|
|
Then dump accumulated data for finalizer
|
|
*/
|
|
|
|
std::cout << "Finishing unit \"" << lbasename(main_input_filename) << "\" ..." << std::endl;
|
|
|
|
for (const auto& [uid, target] : TargetType::all())
|
|
std::cout << " Target " << uid << " -> \"" << target.name() << "\" (" << target.size() << ")" << std::endl;
|
|
|
|
for (const DataPin& dpin : dpins()) {
|
|
std::cout << " Data pin at symbol \"" << dpin.symbol << "\":" << std::endl;
|
|
for (const DataPin::Component& c : dpin.components)
|
|
std::cout << " offset " << c.offset << " (level " << c.level << ") -> target " << c.target << std::endl;
|
|
}
|
|
}
|