refactor: remove useless versions.

This commit is contained in:
2025-03-01 14:19:31 +08:00
parent 5bd1a582f9
commit b69cad483b
2 changed files with 2 additions and 9 deletions

View File

@@ -4,8 +4,6 @@
namespace di::data_format {
constexpr int BOUND_SYMBOL_LIST_FORMAT_VERSION = 1;
void BoundSymbolList::read(const fs::path& path) {
std::ifstream ifs(path);
if (!ifs) {
@@ -13,9 +11,6 @@ void BoundSymbolList::read(const fs::path& path) {
}
auto data = nlohmann::json::parse(ifs);
if (data["version"] != BOUND_SYMBOL_LIST_FORMAT_VERSION) {
throw std::runtime_error("Unsupported data version.");
}
m_entities.clear();
for (const auto& entity : data["data"]) {
@@ -32,10 +27,8 @@ void BoundSymbolList::write(const fs::path& path) const {
}
nlohmann::json data;
data["version"] = BOUND_SYMBOL_LIST_FORMAT_VERSION;
for (const auto& entity : m_entities) {
data["data"].emplace_back(nlohmann::json{
data.emplace_back(nlohmann::json{
{"symbol", entity.m_symbol_name},
{"rva", entity.m_rva },
{"is_function", entity.m_is_function}

View File

@@ -14,7 +14,7 @@ using namespace llvm::pdb;
using namespace llvm::codeview;
auto load_args(int argc, char* argv[]) {
argparse::ArgumentParser program("extractpdb", "1.0.0");
argparse::ArgumentParser program("extractpdb");
struct {
std::string m_program_database_path;