Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove MachineRegister::getSubRegValue #1631

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion common/h/registers/MachRegister.h
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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