Andy Soffer
Andy Soffer

Reputation: 183

Console output using LLVM

What is the "correct" way to output data to the console using LLVM? To be clear, I'm looking for the LLVM IR which will write to the console, rather than some special version of std::cout in the LLVM library. All examples which accomplish this that I have found seem to link to external C libraries for their output. Is there really no intrinsic way to do this?

Upvotes: 6

Views: 1514

Answers (1)

Puppy
Puppy

Reputation: 146920

Of course not. Writing to the console has nothing to do with LLVM. It is a library function. LLVM targets machines that don't even have consoles. Trying to write to the console with LLVM does not make sense- you must invoke, at minimum, an OS API to achieve it.

Upvotes: 3

Related Questions