There are tons of examples within the LLVM source where raw_ostream
is a function / method argument. It's almost always (..., raw_ostream &OS, ...)
Here's a representative example from CodeGen/AsmPrinter/AsmPrinter.cpp
:
static void emitComments(const MachineInstr &MI, raw_ostream &CommentOS) {
// ... code
}