14 #ifndef MLIR_CAPI_UTILS_H
15 #define MLIR_CAPI_UTILS_H
20 #include "llvm/Support/raw_ostream.h"
34 : raw_ostream(true), callback(std::move(callback)),
35 opaqueData(opaqueData), pos(0u) {}
39 callback(
string, opaqueData);
A simple raw ostream subclass that forwards write_impl calls to the user-supplied callback together w...
CallbackOstream(std::function< void(MlirStringRef, void *)> callback, void *opaqueData)
uint64_t current_pos() const override
void write_impl(const char *ptr, size_t size) override
static MlirStringRef mlirStringRefCreate(const char *str, size_t length)
Constructs a string reference from the pointer and length.
Include the generated interface declarations.
A pointer to a sized fragment of a string, not necessarily null-terminated.