Migrate addGlobalName to the .cpp file as an intermediate step
to further work.