Open an IR and print every symbol pointing to data.
#include <fstream>
#include <iomanip>
#include <iostream>
auto Flags = Os.flags();
Os << "0x" << std::hex << std::setw(8) << std::setfill('0') << uint64_t(A);
Os.flags(Flags);
return Os;
}
int main(int argc, char** argv) {
if (argc == 2) {
std::ifstream in(argv[1]);
I = *IoE;
}
if (!I)
return EXIT_FAILURE;
for (
const auto& M : I->
modules()) {
std::cout << "Module " << M.getName() << "\n";
for (const auto& Sym : M.symbols()) {
if (
auto* Ref = Sym.getReferent<
DataBlock>(); Ref !=
nullptr) {
std::cout << Sym.getName() << ":\t" << Ref->getAddress() << "\t"
<< Ref->getSize() << " bytes\n";
}
}
}
return EXIT_SUCCESS;
}