diff options
author | David Greene <greened@obbligato.org> | 2009-07-14 20:18:05 +0000 |
---|---|---|
committer | David Greene <greened@obbligato.org> | 2009-07-14 20:18:05 +0000 |
commit | a31f96cf2bb2d4868d629b17b4e8ec106a23e776 (patch) | |
tree | 90d314a81dfda17ca4c96c57774b0a789e25df90 /llvm/lib/Support/FormattedStream.cpp | |
parent | f6a5ab9abddb9c57c116449490114ec695f7e85f (diff) | |
download | bcm5719-llvm-a31f96cf2bb2d4868d629b17b4e8ec106a23e776.tar.gz bcm5719-llvm-a31f96cf2bb2d4868d629b17b4e8ec106a23e776.zip |
Have asm printers use formatted_raw_ostream directly to avoid a
dynamic_cast<>.
llvm-svn: 75670
Diffstat (limited to 'llvm/lib/Support/FormattedStream.cpp')
-rw-r--r-- | llvm/lib/Support/FormattedStream.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Support/FormattedStream.cpp b/llvm/lib/Support/FormattedStream.cpp index df91641962f..01dea3628c0 100644 --- a/llvm/lib/Support/FormattedStream.cpp +++ b/llvm/lib/Support/FormattedStream.cpp @@ -55,3 +55,16 @@ void formatted_raw_ostream::PadToColumn(unsigned NewCol, unsigned MinPad) } } +/// fouts() - This returns a reference to a formatted_raw_ostream for +/// standard output. Use it like: fouts() << "foo" << "bar"; +formatted_raw_ostream &llvm::fouts() { + static formatted_raw_ostream S(outs()); + return S; +} + +/// ferrs() - This returns a reference to a formatted_raw_ostream for +/// standard error. Use it like: ferrs() << "foo" << "bar"; +formatted_raw_ostream &llvm::ferrs() { + static formatted_raw_ostream S(errs()); + return S; +} |