diff options
author | Bill Wendling <isanbard@gmail.com> | 2006-12-07 22:21:48 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2006-12-07 22:21:48 +0000 |
commit | 9bfb1e1f29124d62e2290b20e395e76fff6f9a2a (patch) | |
tree | 74be612bc2cc5525dbdd5e05705e82ba3fcca8ff /llvm/utils/TableGen/FileLexer.l | |
parent | f4805ce89acbd92db0f143cbed9d66013e0ec0f3 (diff) | |
download | bcm5719-llvm-9bfb1e1f29124d62e2290b20e395e76fff6f9a2a.tar.gz bcm5719-llvm-9bfb1e1f29124d62e2290b20e395e76fff6f9a2a.zip |
What should be the last unnecessary <iostream>s in the library.
llvm-svn: 32333
Diffstat (limited to 'llvm/utils/TableGen/FileLexer.l')
-rw-r--r-- | llvm/utils/TableGen/FileLexer.l | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/llvm/utils/TableGen/FileLexer.l b/llvm/utils/TableGen/FileLexer.l index 653e9d10fbf..cc6825f5e07 100644 --- a/llvm/utils/TableGen/FileLexer.l +++ b/llvm/utils/TableGen/FileLexer.l @@ -28,6 +28,7 @@ %{ #include "llvm/Config/config.h" +#include "llvm/Support/Streams.h" #include "Record.h" typedef std::pair<llvm::Record*, std::vector<llvm::Init*>*> SubClassRefTy; #include "FileParser.h" @@ -63,14 +64,17 @@ struct IncludeRec { static std::vector<IncludeRec> IncludeStack; std::ostream &err() { - if (IncludeStack.empty()) - return std::cerr << "At end of input: "; + if (IncludeStack.empty()) { + cerr << "At end of input: "; + return *cerr.stream(); + } for (unsigned i = 0, e = IncludeStack.size()-1; i != e; ++i) - std::cerr << "Included from " << IncludeStack[i].Filename << ":" - << IncludeStack[i].LineNo << ":\n"; - return std::cerr << "Parsing " << IncludeStack.back().Filename << ":" - << Filelineno << ": "; + cerr << "Included from " << IncludeStack[i].Filename << ":" + << IncludeStack[i].LineNo << ":\n"; + cerr << "Parsing " << IncludeStack.back().Filename << ":" + << Filelineno << ": "; + return *cerr.stream(); } /// ParseFile - this function begins the parsing of the specified tablegen file. @@ -82,7 +86,7 @@ void ParseFile(const std::string &Filename, F = fopen(Filename.c_str(), "r"); if (F == 0) { - std::cerr << "Could not open input file '" + Filename + "'!\n"; + cerr << "Could not open input file '" + Filename + "'!\n"; exit (1); } IncludeStack.push_back(IncludeRec(Filename, F)); @@ -114,7 +118,7 @@ static void HandleInclude(const char *Buffer) { } assert(Length >= 2 && "Double quotes not found?"); std::string Filename(Buffer+1, Buffer+Length-1); - //std::cerr << "Filename = '" << Filename << "'\n"; + //cerr << "Filename = '" << Filename << "'\n"; // Save the line number and lex buffer of the includer... IncludeStack.back().LineNo = Filelineno; |