35 lines
1.3 KiB
C++
35 lines
1.3 KiB
C++
#include <iostream>
|
|
#include <final.h>
|
|
#include <stage0.h>
|
|
#include <stage1.h>
|
|
|
|
#include <safe-input.h>
|
|
#include <pinpoint_config.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 : DataPin::all()) {
|
|
std::cout << " " << (dpin.global ? "Global" : "Local") << " 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;
|
|
}
|
|
|
|
for (const auto& [uid, ipin] : S1InstructionPin::all()) {
|
|
std::cout << " Instruction pin at symbol \"" << SPSLR_PINPOINT_STAGE1_SEPARATOR
|
|
<< "_" << uid << "\" -> target " << ipin.target << ", offset " << ipin.offset << std::endl;
|
|
}
|
|
}
|