This patch uses *Set::insert_range and a range constructor of DenseSet to clean up the code to populate sets.