From 4c8fa3972ad50c07631418620eb9be44d629b2ae Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Mon, 20 Oct 2025 23:28:36 -0700 Subject: Move implementations of key functions on Variable and SSAVariable to headers These types are heavily used as map keys so allowing the compiler to inline these functions makes map lookups cheaper. --- function.cpp | 63 ------------------------------------------------------------ 1 file changed, 63 deletions(-) (limited to 'function.cpp') diff --git a/function.cpp b/function.cpp index 1d35aa7d..df41b977 100644 --- a/function.cpp +++ b/function.cpp @@ -29,69 +29,6 @@ using namespace BinaryNinja; using namespace std; -Variable::Variable() -{ - type = RegisterVariableSourceType; - index = 0; - storage = 0; -} - - -Variable::Variable(BNVariableSourceType t, uint32_t i, uint64_t s) -{ - type = t; - index = i; - storage = s; -} - - -Variable::Variable(const BNVariable& var) -{ - type = var.type; - index = var.index; - storage = var.storage; -} - - -Variable::Variable(const Variable& var) -{ - type = var.type; - index = var.index; - storage = var.storage; -} - - -Variable& Variable::operator=(const Variable& var) -{ - type = var.type; - index = var.index; - storage = var.storage; - return *this; -} - - -bool Variable::operator==(const Variable& var) const -{ - if (type != var.type) - return false; - if (index != var.index) - return false; - return storage == var.storage; -} - - -bool Variable::operator!=(const Variable& var) const -{ - return !((*this) == var); -} - - -bool Variable::operator<(const Variable& var) const -{ - return ToIdentifier() < var.ToIdentifier(); -} - - uint64_t Variable::ToIdentifier() const { return BNToVariableIdentifier(this); -- cgit v1.3.1