Skip to content

Commit

Permalink
Remove MachineRegister::getSubRegValue
Browse files Browse the repository at this point in the history
It's neither documented nor used.
  • Loading branch information
hainest committed Nov 20, 2023
1 parent b7ca05a commit 8f1b8e2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
1 change: 0 additions & 1 deletion common/h/registers/MachRegister.h
Expand Up @@ -51,7 +51,6 @@ namespace Dyninst {
MachRegister getBaseRegister() const;
Architecture getArchitecture() const;
bool isValid() const;
MachRegisterVal getSubRegValue(const MachRegister& subreg, MachRegisterVal& orig) const;

std::string const& name() const;
unsigned int size() const;
Expand Down
16 changes: 0 additions & 16 deletions common/src/registers/MachRegister.C
Expand Up @@ -85,22 +85,6 @@ namespace Dyninst {

bool MachRegister::isValid() const { return (reg != InvalidReg.reg); }

MachRegisterVal MachRegister::getSubRegValue(const MachRegister& subreg,
MachRegisterVal& orig) const {
if(subreg.reg == reg || getArchitecture() == Arch_ppc32 || getArchitecture() == Arch_ppc64)
return orig;

assert(subreg.getBaseRegister() == getBaseRegister());
switch((subreg.reg & 0x00000f00) >> 8) {
case 0x0: return orig;
case 0x1: return (orig & 0xff);
case 0x2: return (orig & 0xff00) >> 8;
case 0x3: return (orig & 0xffff);
case 0xf: return (orig & 0xffffffff);
default: assert(0); return orig;
}
}

std::string const& MachRegister::name() const {
auto iter = names.find(reg);
if(iter != names.end()) {
Expand Down

0 comments on commit 8f1b8e2

Please sign in to comment.