My itunes got deleted, how to transfer songs from iphone?

So my computer needed to get cleaned out and all my music on itunes got deleted. I still have all the music from itunes on my iphone, once i download itunes again how can i transfer the songs on my iphone to itunes?

(btw i didn't buy my music)

If when you plug your phone back in it doesn't automatically transfer all of your music from your phone to your computer you'll have to download it all again. No harm done, anyways, since you didn't pay for it: p

Gotta start backin' up your files