Call shouldOutlineFromFunctionByDefault, isFunctionSafeToOutlineFrom, getOutliningType, and getMachineOutlinerMBBFlags using the correct TargetInstrInfo. And don't create a MachineFunction for a function declaration.
The call to getOutliningCandidateInfo is still a little weird, but at least the weirdness is explicitly called out.