Switch lto codegen to using diagnostic handlers.