This is an archive of the discontinued LLVM Phabricator instance.

Make some code not manipulate the underlying buffer of a StreamString
ClosedPublic

Authored by zturner on Nov 14 2016, 10:00 AM.

Details

Summary

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.

Diff Detail

Event Timeline

zturner updated this revision to Diff 77830.Nov 14 2016, 10:00 AM
zturner retitled this revision from to Make some code not manipulate the underlying buffer of a StreamString.
zturner updated this object.
zturner added reviewers: tfiala, beanz.
zturner added a subscriber: lldb-commits.
tfiala edited edge metadata.Nov 14 2016, 10:20 AM

I will give this a run a bit later this morning. Should be no later than early afternoon.

tfiala accepted this revision.Nov 14 2016, 1:47 PM
tfiala edited edge metadata.

LGTM. Built and passed all existing tests.

This revision is now accepted and ready to land.Nov 14 2016, 1:47 PM
This revision was automatically updated to reflect the committed changes.