jimmy-zx wrote:

Added flush before calling `writeMainFileToStdOut`.

Personally I didn't find this function particularly useful: I was hoping to 
perform rewriting without creating new files, but seems like capturing stdout 
from a shared library requires some complex operation (`dup2` stuff).

`Rewriter::getRewrittenText()` might be a more interesting interface to 
interact with, which returns the rewritten content as a string. (This is 
defined in clang but not exposed by libclang yet).

https://github.com/llvm/llvm-project/blob/179ba129f50aefe6e670800aec7091d958aa6f90/clang/lib/Rewrite/Rewriter.cpp#L180

https://github.com/llvm/llvm-project/pull/77269
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to