I don't think it is good to run semantic3 at this stage of compilation as object file generation has already begun but the AST might get changed by semantics.
I also consider all calls of getTypeInfo(NULL) at this stage as bugs, but they seem ubiquitous.