[llvm] [offload] Add `std::ostream` version of OffloadPrint.hpp (PR #222269)

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 06:21:57 PDT 2026


Jan =?utf-8?q?Trusiłło?= <jan.trusillo at intel.com>,
Jan =?utf-8?q?Trusiłło?= <jan.trusillo at intel.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/222269 at github.com>


jhuber6 wrote:

> They're used by OffloadImpl.cpp, and as far as I'm aware the LLVM iostream ban definitely applies there.

`iostream` is banned because `std::cout` injects static constructors into the TU, it shouldn't apply to `std::ostream` as far as I am aware.

> Rewrote PR to remove the `OFFLOAD_PRINT_USE_STD_OSTREAM` option and instead offer 2 headers, `OffloadPrintRaw.hpp` and `OffloadPrintStd.hpp` as suggested by @pbalcer.

I would really just prefer to not deal with multiple versions. I see `OffloadImpl.cpp` includes this but it isn't actually used to my knowledge. We should probably just formally separate these because I see no ABI edge that would prevent us from doing this. Any user including this should not need to find LLVM headers to make it work.

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


More information about the llvm-commits mailing list