[LLVMdev] Extending AsmPrinter

Chris Lattner sabre at nondot.org
Fri Aug 17 11:17:46 PDT 2007


On Fri, 17 Aug 2007, David Greene wrote:
>> Posix is pretty available, what system doesn't have them?
>
> Windows, for one.  If POSIX is ok, it's better in my mind to just directly

Windows has POSIX calls.

> use open, write and friends, which is what I do now.  Going the cstdio
> route should only be done for portability reasons to support non-POSIX
> systems.

I don't think open/write etc are POSIX.  Windows has them but you have to 
use different headers etc to get access to them.  I am no expert in this 
area though.

>>> To get portability and most of the performance I plan to look at
>>> unbuffered stdio.
>>
>> Buffering is goodness, no?
>
> Buffering is goodness.  The problem with using buffered cstdio under
> iostreams is that you have to go through overflow() and/or xsputn() to send
> data to cstdio.

I'm not suggesting using iostreams.  I'm suggesting using FILE*'s 
directly.

> These are virtual calls and they will be more frequent because there's 
> no buffering at the iostreams level.  It seems wasteful to do buffering 
> at two different levels so I'd say it's better to do it before the 
> virtual calls happen, for performance reasons.

I agree.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list