Skip to content

Commit

Permalink
Remove deprecated insnCodeGen::generate (#836)
Browse files Browse the repository at this point in the history
dyninstAPI/src/codegen-power.C: Removed by 5274e3b in 2011.
dyninstAPI/src/codegen-aarch64.C: Removed by 0cbe684 in 2015.
dyninstAPI/src/codegen-x86.C: git can't figure out when this was removed.
  • Loading branch information
hainest committed Oct 30, 2020
1 parent bb62252 commit 1481cbb
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 98 deletions.
11 changes: 0 additions & 11 deletions dyninstAPI/src/codegen-aarch64.C
Original file line number Diff line number Diff line change
Expand Up @@ -670,17 +670,6 @@ assert(0);
//#warning "This function is not implemented yet!"
}

bool insnCodeGen::generate(codeGen &gen,
instruction &insn,
AddressSpace * /*proc*/,
Address /*origAddr*/,
Address /*relocAddr*/,
patchTarget * /*fallthroughOverride*/,
patchTarget * /*targetOverride*/) {
assert(0 && "Deprecated!");
return false;
}

bool insnCodeGen::generateMem(codeGen &,
instruction&,
Address,
Expand Down
75 changes: 0 additions & 75 deletions dyninstAPI/src/codegen-power.C
Original file line number Diff line number Diff line change
Expand Up @@ -1098,81 +1098,6 @@ void insnCodeGen::removeStackFrame(codeGen &gen) {
popStack(gen);
}

bool insnCodeGen::generate(codeGen & /*gen*/,
instruction & /*insn*/,
AddressSpace * /*proc*/,
Address /*origAddr*/,
Address /*relocAddr*/,
patchTarget * /*fallthroughOverride*/,
patchTarget * /*targetOverride*/) {
assert(0 && "Deprecated!");
return false;
#if 0
assert(fallthroughOverride == NULL);

Address targetAddr = targetOverride ? targetOverride->get_address() : 0;
long newOffset = 0;
Address to;

if (insn.isThunk()) {
}
else if (insn.isUncondBranch()) {
// unconditional pc relative branch.

#if defined(os_vxworks)
if (!targetOverride) relocationTarget(origAddr, &targetAddr);
#endif

// This was a check in old code. Assert it isn't the case,
// since this is a _conditional_ branch...
assert(insn.isInsnType(Bmask, BCAAmatch) == false);

// We may need an instPoint for liveness calculations

instPoint *point = gen.func()->findInstPByAddr(origAddr);
if (!point)
point = instPoint::createArbitraryInstPoint(origAddr,
gen.addrSpace(),
gen.func());
gen.setPoint(point);


if (targetAddr) {
generateBranch(gen,
relocAddr,
targetAddr,
IFORM_LK(insn));
}
else {
generateBranch(gen,
relocAddr,
insn.getTarget(origAddr),
IFORM_LK(insn));
}
}
else if (insn.isCondBranch()) {
// conditional pc relative branch.
#if defined(os_vxworks)
if (!targetOverride) relocationTarget(origAddr, &targetAddr);
#endif

if (!targetAddr) {
newOffset = origAddr - relocAddr + insn.getBranchOffset();
to = origAddr + insn.getBranchOffset();
} else {
newOffset = targetAddr - relocAddr;
to = targetAddr;
}
}
else {
#if defined(os_vxworks)
if (relocationTarget(origAddr + 2, &targetAddr)) DFORM_SI_SET(insn, targetAddr);
#endif
generate(gen,insn);
}
return true;
#endif
}
// {insn_ = {byte = {0xa6, 0x3, 0x8, 0x7c}, raw = 0x7c0803a6}}
// {insn_ = {byte = {0xa6, 0x3, 0x8, 0x7c}, raw = 0x7c0803a6}}
bool insnCodeGen::generateMem(codeGen &,
Expand Down
12 changes: 0 additions & 12 deletions dyninstAPI/src/codegen-x86.C
Original file line number Diff line number Diff line change
Expand Up @@ -782,18 +782,6 @@ bool pcRelData::canPreApply()
return (gen->startAddr() != 0x0);
}

bool insnCodeGen::generate(codeGen &,
instruction &,
AddressSpace *,
Address , // Could be kept in the instruction class.
Address ,
patchTarget *,
patchTarget *)
{
assert(0 && "Deprecated");
return false;
}

#define SIB_SET_REG(x, y) ((x) |= ((y) & 7))
#define SIB_SET_INDEX(x, y) ((x) |= (((y) & 7) << 3))

Expand Down

0 comments on commit 1481cbb

Please sign in to comment.