The attached patches naively implement the FIXME in Refactoring.h (switch Replacements to be a vector) and add in naive de-duplication in the applyAll method. The -extra patch is for the tools/extra repository. I would not be surprised if there is some subtlety that I am missing, but I figured I might as well provide the naive patch first and see what people thought.
replacement-vector-clang-extra.patch (5.87 KB)
replacement-vector-clang.patch (15.3 KB)