memory: update memory_unused() for latest changes to bid counting
MODIFY
ir/globals.cpp
ir/globals.cpp
@@ -15,7 +15,6 @@ unsigned bits_program_pointer;
unsigned bits_size_t;
unsigned bits_byte;
bool little_endian;
-bool nullptr_is_used;
bool has_int2ptr;
bool has_ptr2int;
bool has_malloc;

MODIFY
ir/globals.h
ir/globals.h
@@ -34,9 +34,6 @@ extern unsigned bits_byte;
extern bool little_endian;
-/// Whether the null pointer is used in either function
-extern bool nullptr_is_used;
-
/// Whether int2ptr or ptr2int are used in either function
extern bool has_int2ptr;
extern bool has_ptr2int;

MODIFY
ir/memory.cpp
ir/memory.cpp
@@ -844,9 +844,7 @@ static unsigned last_local_bid = 0;
static unsigned last_nonlocal_bid = 1;
static bool memory_unused() {
- // +1 for the null block
- return num_locals == 0 && num_nonlocals == 1 && !nullptr_is_used &&
- !observes_addresses();
+ return num_locals == 0 && num_nonlocals == 0;
}
static expr mk_block_val_array() {

MODIFY
tools/transform.cpp
tools/transform.cpp
@@ -623,7 +623,7 @@ static void calculateAndInitConstants(Transform &t) {
}
}
- nullptr_is_used = false;
+ bool nullptr_is_used = false;
has_int2ptr = false;
has_ptr2int = false;
has_malloc = false;

memory: update memory_unused() for latest changes to bid counting