Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Console output using LLVM

Tags:

llvm

llvm-ir

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?

like image 228
Andy Soffer Avatar asked Oct 19 '22 22:10

Andy Soffer


1 Answers

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.

like image 123
Puppy Avatar answered Oct 23 '22 06:10

Puppy