Function lookup is slow - replacing with a faster test.

This commit is contained in:
Ben Vanik
2015-06-08 23:44:38 -07:00
parent 1a2b4a38e0
commit dbcdc5b543
3 changed files with 12 additions and 8 deletions

View File

@@ -34,14 +34,9 @@ PPCScanner::PPCScanner(PPCFrontend* frontend) : frontend_(frontend) {}
PPCScanner::~PPCScanner() {}
bool PPCScanner::IsRestGprLr(uint32_t address) {
auto functions = frontend_->processor()->FindFunctionsWithAddress(address);
for (auto& function : functions) {
if (function->symbol_info()->behavior() ==
FunctionBehavior::kEpilogReturn) {
return true;
}
}
return false;
auto function = frontend_->processor()->QueryFunction(address);
return function &&
function->symbol_info()->behavior() == FunctionBehavior::kEpilogReturn;
}
bool PPCScanner::Scan(FunctionInfo* symbol_info, DebugInfo* debug_info) {