Removing dead ExportResolver code.
This commit is contained in:
parent
9b76d02f26
commit
52678ed1ef
|
@ -29,29 +29,6 @@ void ExportResolver::RegisterTable(const std::string& library_name,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t ExportResolver::GetLibraryOrdinal(const std::string& library_name) {
|
|
||||||
uint16_t n = 0;
|
|
||||||
for (const auto& table : tables_) {
|
|
||||||
if (table.name != library_name) {
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
++n;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
KernelExport* ExportResolver::GetExportByOrdinal(const uint16_t library_ordinal,
|
|
||||||
const uint32_t ordinal) {
|
|
||||||
const auto& table = tables_[library_ordinal];
|
|
||||||
// TODO(benvanik): binary search?
|
|
||||||
for (size_t n = 0; n < table.count; n++) {
|
|
||||||
if (table.exports[n].ordinal == ordinal) {
|
|
||||||
return &table.exports[n];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
KernelExport* ExportResolver::GetExportByOrdinal(
|
KernelExport* ExportResolver::GetExportByOrdinal(
|
||||||
const std::string& library_name, const uint32_t ordinal) {
|
const std::string& library_name, const uint32_t ordinal) {
|
||||||
for (const auto& table : tables_) {
|
for (const auto& table : tables_) {
|
||||||
|
@ -68,13 +45,6 @@ KernelExport* ExportResolver::GetExportByOrdinal(
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
KernelExport* ExportResolver::GetExportByName(const std::string& library_name,
|
|
||||||
const std::string& name) {
|
|
||||||
// TODO(benvanik): lookup by name.
|
|
||||||
assert_always();
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ExportResolver::SetVariableMapping(const std::string& library_name,
|
void ExportResolver::SetVariableMapping(const std::string& library_name,
|
||||||
const uint32_t ordinal,
|
const uint32_t ordinal,
|
||||||
uint32_t value) {
|
uint32_t value) {
|
||||||
|
|
|
@ -61,14 +61,8 @@ class ExportResolver {
|
||||||
void RegisterTable(const std::string& library_name, KernelExport* exports,
|
void RegisterTable(const std::string& library_name, KernelExport* exports,
|
||||||
const size_t count);
|
const size_t count);
|
||||||
|
|
||||||
uint16_t GetLibraryOrdinal(const std::string& library_name);
|
|
||||||
|
|
||||||
KernelExport* GetExportByOrdinal(const uint16_t library_ordinal,
|
|
||||||
const uint32_t ordinal);
|
|
||||||
KernelExport* GetExportByOrdinal(const std::string& library_name,
|
KernelExport* GetExportByOrdinal(const std::string& library_name,
|
||||||
const uint32_t ordinal);
|
const uint32_t ordinal);
|
||||||
KernelExport* GetExportByName(const std::string& library_name,
|
|
||||||
const std::string& name);
|
|
||||||
|
|
||||||
void SetVariableMapping(const std::string& library_name,
|
void SetVariableMapping(const std::string& library_name,
|
||||||
const uint32_t ordinal, uint32_t value);
|
const uint32_t ordinal, uint32_t value);
|
||||||
|
|
Loading…
Reference in New Issue