Add support for optimization passes that use a TargetMachine object.