Following Duncan suggestion of improving code to disallow duplication of imported entities from commit: http://reviews.llvm.org/rL263379
By simply filter the AllImportedModules list at DIBuilder::finalize function.
Note: LIT test was committed in revision 263379.
This formatting looks weird - is that what clang-format produced?