As Alex said, treat the bloat first. If the pig is pooping, then it's less indicative of a blockage so it's ok for the pig to eat. Avoid the brassica family of veg - cauliflower, broccoli, kale, cabbage, brussels sprouts. Avoid sugary foods like fruits too.
If the pig isn't pooping, then no food until a blockage has been ruled out (hence attending an urgent vet appointment, as you need to get food into the pig but need to know that there's not a blockage before you do feed).