[llvm-commits] [llvm] r55301 - /llvm/trunk/lib/VMCore/AsmWriter.cpp

Dan Gohman gohman at apple.com
Mon Aug 25 12:47:50 PDT 2008



On Aug 24, 2008, at 9:55 PM, Chris Lattner wrote:
> // Value::dump - allow easy printing of  Values from the debugger.
> // Located here because so much of the needed functionality is here.
> -void Value::dump() const { print(errs()); errs() << '\n'; }
> +void Value::dump() const { print(errs()); errs() << '\n';  
> errs().flush(); }
>
> // Type::dump - allow easy printing of  Values from the debugger.
> // Located here because so much of the needed functionality is here.
> -void Type::dump() const { print(errs()); errs() << '\n'; }
> +void Type::dump() const { print(errs()); errs() << '\n';  
> errs().flush(); }
>
> // Module::dump() - Allow printing from debugger
> -void Module::dump() const { print(errs(), 0); }
> +void Module::dump() const { print(errs(), 0); errs().flush(); }

It's surprising that this is necessary. For comparison, stderr is
unbuffered by default. Wouldn't it be better to make errs() return
a non-buffered stream?

Dan




More information about the llvm-commits mailing list