Remove IrGenerator::global_ptr function.

It can now be merged into IrGenerator::get_variable_ptr.