Introduce a new pass to compile the types of global variables
Put compiler error- and performance-reporting into a common function