I have locally a a very large patch which removes the method of StreamString that returns a reference to the underlying std::string buffer, and instead returns a StringRef. There were 1 or 2 instances where someone was relying on this function to reach into the underlying buffer and do stuff like insert or erase from it. This seems like a huge hack, and in the future as I move code towards llvm::raw_ostream this will be incompatible with LLVM's api anyway since it does not allow such things. The only non-trivial fix to this was in something Cocoa related. I don't really understand this code, and I can't test it, but the patch here is intended to be NFC and just re-writing the logic in terms of something that doesn't modify the internal Stream buffer.
If someone could test it for me I would appreciate.