Remove stems, if necessary, from tomatoes. With the tip of a sharp knife, pierce tomatoes. Carefully insert a sliver of garlic into each one.
Place tomatoes in the center of a 18x12 sheet of foil. Drizzle tomatoes with olive oil; sprinkle with rosemary, sugar, and salt. Bring the two long sides of the foil together and seal with a double fold. Fold remaining edges together to completely enclose tomatoes.
Grill tomatoes on the rack of a grill directly over coals or gas burners for 4 to 5 minutes or until heated through. (Or bake in a preheated 350 degree F oven for 4 to 5 minutes or until heated through.)
To serve, carefully open foil packet (hot steam may escape from packet). Transfer tomatoes to serving plate or platter. Sprinkle with salt and serve immediately. Makes 24.