[llvm] [TableGen] Use a more efficient memory buffer for output (PR #123353)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 22 01:07:02 PST 2025


jayfoad wrote:

> Would it be acceptable to call `std::string::reserve` with the size of the existing output file?

That's a clever trick but it only helps if you're using `-write-if-change` and the file already exists. For example it does not help if you're building LLVM from scratch.

But I guess if you're not using `-write-if-change`, or the file doesn't already exist, then there is no need for the memory buffer at all and you can write directly to the output file. Is that what you were thinking?

https://github.com/llvm/llvm-project/pull/123353


More information about the llvm-commits mailing list