RewriteBuffer::write(): Add a doc comment about non-portable use

The function isn't strictly at fault but there are callers using it
incorrectly, causing crashes with in-place edits of 64KB or larger files on
Windows.

See PR17960 for details.

llvm-svn: 194972
This commit is contained in:
Alp Toker 2013-11-17 18:13:43 +00:00
parent 5335cf331b
commit 02413d88f1
1 changed files with 3 additions and 0 deletions

View File

@ -49,6 +49,9 @@ public:
/// \brief Write to \p Stream the result of applying all changes to the
/// original buffer.
/// Note that it isn't safe to use this function to overwrite memory mapped
/// files in-place (PR17960). Consider using a higher-level utility such as
/// Rewriter::overwriteChangedFiles() instead.
///
/// The original buffer is not actually changed.
raw_ostream &write(raw_ostream &Stream) const;