Skip to content

Commit

Permalink
Remove arch-specific init functions from addressSpace interface
Browse files Browse the repository at this point in the history
This makes the interface cleaner, allows for expansion without modifying
the addressSpace class, and doesn't require stub functions on platforms
that don't support all of the bit widths.
  • Loading branch information
Tim Haines committed Nov 11, 2021
1 parent 07fbe11 commit 5a8a97e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
6 changes: 1 addition & 5 deletions dyninstAPI/src/inst-aarch64.C
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,7 @@ void initDefaultPointFrequencyTable() {

/************************************* Register Space **************************************/

void registerSpace::initialize32() {
assert(!"No 32-bit implementation for the ARM architecture!");
}

void registerSpace::initialize64() {
static void initialize64() {
static bool done = false;
if (done)
return;
Expand Down
4 changes: 2 additions & 2 deletions dyninstAPI/src/inst-power.C
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ unsigned int floatingLiveRegListSize = 14;
// of saves that we execute.


void registerSpace::initialize32() {
static void initialize32() {
static bool done = false;
if (done) return;
done = true;
Expand Down Expand Up @@ -251,7 +251,7 @@ void registerSpace::initialize32() {

}

void registerSpace::initialize64() {
static void initialize64() {
static bool done = false;
if (done) return;
done = true;
Expand Down
4 changes: 2 additions & 2 deletions dyninstAPI/src/inst-x86.C
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ extern "C" int cpuidCall();
* an instruction -- used for allocating the new area
*/

void registerSpace::initialize32() {
static void initialize32() {
static bool done = false;
if (done) return;
done = true;
Expand Down Expand Up @@ -198,7 +198,7 @@ void registerSpace::initialize32() {
}

#if defined arch_x86_64
void registerSpace::initialize64() {
static void initialize64() {
static bool done = false;
if (done) return;
done = true;
Expand Down
3 changes: 0 additions & 3 deletions dyninstAPI/src/registerSpace.h
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,6 @@ class registerSpace {
std::vector<registerSlot *> realRegisters_;

static void initialize();
static void initialize32();
static void initialize64();


registerSpace &operator=(const registerSpace &src);

Expand Down

0 comments on commit 5a8a97e

Please sign in to comment.