How to get LLVMTargetDataRef from the C API for a given target ?

I used to rely on LLVMGetTargetMachineData, but it will be gone in 3.8 . What is the correct way to do it going forward from the C API ?