[Mlir-commits] [mlir] [mlir][VectorOps] Support string literals in `vector.print` (PR #68695)

Benjamin Maxwell llvmlistbot at llvm.org
Thu Oct 19 01:08:27 PDT 2023


MacDue wrote:

> Thanks for adding this very useful feature!
> 
> Note that calling "puts" puts a direct dependence on the std lib for this to work, while originally the idea of the vector print support in the CRunnerlibrary was that users could provide implementation of "just" a few basic print operations (printI64, printU64, etc.) and then provide their own implementation, usually indeed using a std lib, as in
> 
> extern "C" void printNewline() { fputc('\n', stdout); }
> 
> So from that sense, would it make sense to provide
> 
> extern "C" void printString(char *) { fputs(s, stdout); }
> 
> and use that extra indirection to stay along the original philosophy I had for this library?

I've switched this to use `printCStr()` rather than `puts()` directly now, as that already exists in the runner library :+1:   

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


More information about the Mlir-commits mailing list