[llvm-commits] CVS: llvm/lib/Support/Allocator.cpp CommandLine.cpp Debug.cpp GraphWriter.cpp PluginLoader.cpp SlowOperationInformer.cpp Streams.cpp SystemUtils.cpp
Bill Wendling
isanbard at gmail.com
Wed Dec 6 17:32:02 PST 2006
Changes in directory llvm/lib/Support:
Allocator.cpp updated: 1.3 -> 1.4
CommandLine.cpp updated: 1.79 -> 1.80
Debug.cpp updated: 1.9 -> 1.10
GraphWriter.cpp updated: 1.6 -> 1.7
PluginLoader.cpp updated: 1.19 -> 1.20
SlowOperationInformer.cpp updated: 1.11 -> 1.12
Streams.cpp updated: 1.1 -> 1.2
SystemUtils.cpp updated: 1.46 -> 1.47
---
Log message:
Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.
---
Diffs of the changes: (+74 -73)
Allocator.cpp | 4 -
CommandLine.cpp | 94 +++++++++++++++++++++++-----------------------
Debug.cpp | 6 +-
GraphWriter.cpp | 16 +++----
PluginLoader.cpp | 4 -
SlowOperationInformer.cpp | 8 +--
Streams.cpp | 7 +--
SystemUtils.cpp | 8 +--
8 files changed, 74 insertions(+), 73 deletions(-)
Index: llvm/lib/Support/Allocator.cpp
diff -u llvm/lib/Support/Allocator.cpp:1.3 llvm/lib/Support/Allocator.cpp:1.4
--- llvm/lib/Support/Allocator.cpp:1.3 Sun Nov 26 04:52:51 2006
+++ llvm/lib/Support/Allocator.cpp Wed Dec 6 19:30:31 2006
@@ -102,6 +102,6 @@
for (; R; R = R->getNext(), ++NumRegions)
BytesUsed += R->getNumBytesAllocated();
- llvm_cerr << "\nNumber of memory regions: " << NumRegions << "\n";
- llvm_cerr << "Bytes allocated: " << BytesUsed << "\n";
+ cerr << "\nNumber of memory regions: " << NumRegions << "\n";
+ cerr << "Bytes allocated: " << BytesUsed << "\n";
}
Index: llvm/lib/Support/CommandLine.cpp
diff -u llvm/lib/Support/CommandLine.cpp:1.79 llvm/lib/Support/CommandLine.cpp:1.80
--- llvm/lib/Support/CommandLine.cpp:1.79 Sun Nov 26 04:52:51 2006
+++ llvm/lib/Support/CommandLine.cpp Wed Dec 6 19:30:31 2006
@@ -84,8 +84,8 @@
static void AddArgument(const char *ArgName, Option *Opt) {
if (getOption(ArgName)) {
- llvm_cerr << ProgramName << ": CommandLine Error: Argument '"
- << ArgName << "' defined more than once!\n";
+ cerr << ProgramName << ": CommandLine Error: Argument '"
+ << ArgName << "' defined more than once!\n";
} else {
// Add argument to the argument map!
(*Options)[ArgName] = Opt;
@@ -129,9 +129,9 @@
case ValueOptional:
break;
default:
- llvm_cerr << ProgramName
- << ": Bad ValueMask flag! CommandLine usage error:"
- << Handler->getValueExpectedFlag() << "\n";
+ cerr << ProgramName
+ << ": Bad ValueMask flag! CommandLine usage error:"
+ << Handler->getValueExpectedFlag() << "\n";
abort();
break;
}
@@ -468,8 +468,8 @@
}
if (Handler == 0) {
- llvm_cerr << ProgramName << ": Unknown command line argument '"
- << argv[i] << "'. Try: '" << argv[0] << " --help'\n";
+ cerr << ProgramName << ": Unknown command line argument '"
+ << argv[i] << "'. Try: '" << argv[0] << " --help'\n";
ErrorParsing = true;
continue;
}
@@ -505,18 +505,18 @@
// Check and handle positional arguments now...
if (NumPositionalRequired > PositionalVals.size()) {
- llvm_cerr << ProgramName
- << ": Not enough positional command line arguments specified!\n"
- << "Must specify at least " << NumPositionalRequired
- << " positional arguments: See: " << argv[0] << " --help\n";
+ cerr << ProgramName
+ << ": Not enough positional command line arguments specified!\n"
+ << "Must specify at least " << NumPositionalRequired
+ << " positional arguments: See: " << argv[0] << " --help\n";
ErrorParsing = true;
} else if (!HasUnlimitedPositionals
&& PositionalVals.size() > PositionalOpts.size()) {
- llvm_cerr << ProgramName
- << ": Too many positional arguments specified!\n"
- << "Can specify at most " << PositionalOpts.size()
- << " positional arguments: See: " << argv[0] << " --help\n";
+ cerr << ProgramName
+ << ": Too many positional arguments specified!\n"
+ << "Can specify at most " << PositionalOpts.size()
+ << " positional arguments: See: " << argv[0] << " --help\n";
ErrorParsing = true;
} else if (ConsumeAfterOpt == 0) {
@@ -617,11 +617,11 @@
bool Option::error(std::string Message, const char *ArgName) {
if (ArgName == 0) ArgName = ArgStr;
if (ArgName[0] == 0)
- llvm_cerr << HelpStr; // Be nice for positional arguments
+ cerr << HelpStr; // Be nice for positional arguments
else
- llvm_cerr << ProgramName << ": for the -" << ArgName;
+ cerr << ProgramName << ": for the -" << ArgName;
- llvm_cerr << " option: " << Message << "\n";
+ cerr << " option: " << Message << "\n";
return true;
}
@@ -701,8 +701,8 @@
// Print out the option for the alias.
void alias::printOptionInfo(unsigned GlobalWidth) const {
unsigned L = std::strlen(ArgStr);
- llvm_cout << " -" << ArgStr << std::string(GlobalWidth-L-6, ' ') << " - "
- << HelpStr << "\n";
+ cout << " -" << ArgStr << std::string(GlobalWidth-L-6, ' ') << " - "
+ << HelpStr << "\n";
}
@@ -728,13 +728,13 @@
//
void basic_parser_impl::printOptionInfo(const Option &O,
unsigned GlobalWidth) const {
- llvm_cout << " -" << O.ArgStr;
+ cout << " -" << O.ArgStr;
if (const char *ValName = getValueName())
- llvm_cout << "=<" << getValueStr(O, ValName) << ">";
+ cout << "=<" << getValueStr(O, ValName) << ">";
- llvm_cout << std::string(GlobalWidth-getOptionWidth(O), ' ') << " - "
- << O.HelpStr << "\n";
+ cout << std::string(GlobalWidth-getOptionWidth(O), ' ') << " - "
+ << O.HelpStr << "\n";
}
@@ -850,21 +850,21 @@
unsigned GlobalWidth) const {
if (O.hasArgStr()) {
unsigned L = std::strlen(O.ArgStr);
- llvm_cout << " -" << O.ArgStr << std::string(GlobalWidth-L-6, ' ')
- << " - " << O.HelpStr << "\n";
+ cout << " -" << O.ArgStr << std::string(GlobalWidth-L-6, ' ')
+ << " - " << O.HelpStr << "\n";
for (unsigned i = 0, e = getNumOptions(); i != e; ++i) {
unsigned NumSpaces = GlobalWidth-strlen(getOption(i))-8;
- llvm_cout << " =" << getOption(i) << std::string(NumSpaces, ' ')
- << " - " << getDescription(i) << "\n";
+ cout << " =" << getOption(i) << std::string(NumSpaces, ' ')
+ << " - " << getDescription(i) << "\n";
}
} else {
if (O.HelpStr[0])
- llvm_cout << " " << O.HelpStr << "\n";
+ cout << " " << O.HelpStr << "\n";
for (unsigned i = 0, e = getNumOptions(); i != e; ++i) {
unsigned L = std::strlen(getOption(i));
- llvm_cout << " -" << getOption(i) << std::string(GlobalWidth-L-8, ' ')
- << " - " << getDescription(i) << "\n";
+ cout << " -" << getOption(i) << std::string(GlobalWidth-L-8, ' ')
+ << " - " << getDescription(i) << "\n";
}
}
}
@@ -917,9 +917,9 @@
}
if (ProgramOverview)
- llvm_cout << "OVERVIEW:" << ProgramOverview << "\n";
+ cout << "OVERVIEW:" << ProgramOverview << "\n";
- llvm_cout << "USAGE: " << ProgramName << " [options]";
+ cout << "USAGE: " << ProgramName << " [options]";
// Print out the positional options.
std::vector<Option*> &PosOpts = *PositionalOptions;
@@ -929,28 +929,28 @@
for (unsigned i = CAOpt != 0, e = PosOpts.size(); i != e; ++i) {
if (PosOpts[i]->ArgStr[0])
- llvm_cout << " --" << PosOpts[i]->ArgStr;
- llvm_cout << " " << PosOpts[i]->HelpStr;
+ cout << " --" << PosOpts[i]->ArgStr;
+ cout << " " << PosOpts[i]->HelpStr;
}
// Print the consume after option info if it exists...
- if (CAOpt) llvm_cout << " " << CAOpt->HelpStr;
+ if (CAOpt) cout << " " << CAOpt->HelpStr;
- llvm_cout << "\n\n";
+ cout << "\n\n";
// Compute the maximum argument length...
MaxArgLen = 0;
for (unsigned i = 0, e = Opts.size(); i != e; ++i)
MaxArgLen = std::max(MaxArgLen, Opts[i].second->getOptionWidth());
- llvm_cout << "OPTIONS:\n";
+ cout << "OPTIONS:\n";
for (unsigned i = 0, e = Opts.size(); i != e; ++i)
Opts[i].second->printOptionInfo(MaxArgLen);
// Print any extra help the user has declared.
for (std::vector<const char *>::iterator I = MoreHelp->begin(),
E = MoreHelp->end(); I != E; ++I)
- llvm_cout << *I;
+ cout << *I;
MoreHelp->clear();
// Halt the program since help information was printed
@@ -982,21 +982,21 @@
void operator=(bool OptionWasSpecified) {
if (OptionWasSpecified) {
if (OverrideVersionPrinter == 0) {
- llvm_cout << "Low Level Virtual Machine (http://llvm.org/):\n";
- llvm_cout << " " << PACKAGE_NAME << " version " << PACKAGE_VERSION;
+ cout << "Low Level Virtual Machine (http://llvm.org/):\n";
+ cout << " " << PACKAGE_NAME << " version " << PACKAGE_VERSION;
#ifdef LLVM_VERSION_INFO
- llvm_cout << LLVM_VERSION_INFO;
+ cout << LLVM_VERSION_INFO;
#endif
- llvm_cout << "\n ";
+ cout << "\n ";
#ifndef __OPTIMIZE__
- llvm_cout << "DEBUG build";
+ cout << "DEBUG build";
#else
- llvm_cout << "Optimized build";
+ cout << "Optimized build";
#endif
#ifndef NDEBUG
- llvm_cout << " with assertions";
+ cout << " with assertions";
#endif
- llvm_cout << ".\n";
+ cout << ".\n";
Options->clear(); // Don't bother making option dtors remove from map.
exit(1);
} else {
Index: llvm/lib/Support/Debug.cpp
diff -u llvm/lib/Support/Debug.cpp:1.9 llvm/lib/Support/Debug.cpp:1.10
--- llvm/lib/Support/Debug.cpp:1.9 Fri Nov 17 03:54:47 2006
+++ llvm/lib/Support/Debug.cpp Wed Dec 6 19:30:31 2006
@@ -68,9 +68,9 @@
// places the std::c* I/O streams into one .cpp file and relieves the whole
// program from having to have hundreds of static c'tor/d'tors for them.
//
-llvm_ostream llvm::getErrorOutputStream(const char *DebugType) {
+OStream llvm::getErrorOutputStream(const char *DebugType) {
if (DebugFlag && isCurrentDebugType(DebugType))
- return llvm_cerr;
+ return cerr;
else
- return llvm_null;
+ return NullStream;
}
Index: llvm/lib/Support/GraphWriter.cpp
diff -u llvm/lib/Support/GraphWriter.cpp:1.6 llvm/lib/Support/GraphWriter.cpp:1.7
--- llvm/lib/Support/GraphWriter.cpp:1.6 Sun Nov 26 04:52:51 2006
+++ llvm/lib/Support/GraphWriter.cpp Wed Dec 6 19:30:31 2006
@@ -28,9 +28,9 @@
args.push_back(Filename.c_str());
args.push_back(0);
- llvm_cerr << "Running 'Graphviz' program... " << std::flush;
+ cerr << "Running 'Graphviz' program... " << std::flush;
if (sys::Program::ExecuteAndWait(Graphviz, &args[0],0,0,0,&ErrMsg)) {
- llvm_cerr << "Error viewing graph: " << ErrMsg << "\n";
+ cerr << "Error viewing graph: " << ErrMsg << "\n";
}
#elif (HAVE_GV && HAVE_DOT)
sys::Path PSFilename = Filename;
@@ -48,11 +48,11 @@
args.push_back(PSFilename.c_str());
args.push_back(0);
- llvm_cerr << "Running 'dot' program... " << std::flush;
+ cerr << "Running 'dot' program... " << std::flush;
if (sys::Program::ExecuteAndWait(dot, &args[0],0,0,0,&ErrMsg)) {
- llvm_cerr << "Error viewing graph: '" << ErrMsg << "\n";
+ cerr << "Error viewing graph: '" << ErrMsg << "\n";
} else {
- llvm_cerr << " done. \n";
+ cerr << " done. \n";
sys::Path gv(LLVM_PATH_GV);
args.clear();
@@ -62,7 +62,7 @@
ErrMsg.clear();
if (sys::Program::ExecuteAndWait(gv, &args[0],0,0,0,&ErrMsg)) {
- llvm_cerr << "Error viewing graph: " << ErrMsg << "\n";
+ cerr << "Error viewing graph: " << ErrMsg << "\n";
}
}
PSFilename.eraseFromDisk();
@@ -73,9 +73,9 @@
args.push_back(Filename.c_str());
args.push_back(0);
- llvm_cerr << "Running 'dotty' program... " << std::flush;
+ cerr << "Running 'dotty' program... " << std::flush;
if (sys::Program::ExecuteAndWait(dotty, &args[0],0,0,0,&ErrMsg)) {
- llvm_cerr << "Error viewing graph: " << ErrMsg << "\n";
+ cerr << "Error viewing graph: " << ErrMsg << "\n";
} else {
#ifdef __MINGW32__ // Dotty spawns another app and doesn't wait until it returns
return;
Index: llvm/lib/Support/PluginLoader.cpp
diff -u llvm/lib/Support/PluginLoader.cpp:1.19 llvm/lib/Support/PluginLoader.cpp:1.20
--- llvm/lib/Support/PluginLoader.cpp:1.19 Sun Nov 26 04:52:51 2006
+++ llvm/lib/Support/PluginLoader.cpp Wed Dec 6 19:30:31 2006
@@ -26,8 +26,8 @@
std::string Error;
if (sys::DynamicLibrary::LoadLibraryPermanently(Filename.c_str(), &Error)) {
- llvm_cerr << "Error opening '" << Filename << "': " << Error
- << "\n -load request ignored.\n";
+ cerr << "Error opening '" << Filename << "': " << Error
+ << "\n -load request ignored.\n";
} else {
Plugins->push_back(Filename);
}
Index: llvm/lib/Support/SlowOperationInformer.cpp
diff -u llvm/lib/Support/SlowOperationInformer.cpp:1.11 llvm/lib/Support/SlowOperationInformer.cpp:1.12
--- llvm/lib/Support/SlowOperationInformer.cpp:1.11 Sun Nov 26 04:52:51 2006
+++ llvm/lib/Support/SlowOperationInformer.cpp Wed Dec 6 19:30:31 2006
@@ -28,8 +28,8 @@
if (LastPrintAmount) {
// If we have printed something, make _sure_ we print the 100% amount, and
// also print a newline.
- llvm_cout << std::string(LastPrintAmount, '\b') << "Progress "
- << OperationName << ": 100% \n";
+ cout << std::string(LastPrintAmount, '\b') << "Progress "
+ << OperationName << ": 100% \n";
}
}
@@ -40,7 +40,7 @@
bool SlowOperationInformer::progress(unsigned Amount) {
int status = sys::AlarmStatus();
if (status == -1) {
- llvm_cout << "\n";
+ cout << "\n";
LastPrintAmount = 0;
return true;
}
@@ -61,6 +61,6 @@
OS << "% ";
LastPrintAmount = OS.str().size();
- llvm_cout << ToPrint+OS.str() << std::flush;
+ cout << ToPrint+OS.str() << std::flush;
return false;
}
Index: llvm/lib/Support/Streams.cpp
diff -u llvm/lib/Support/Streams.cpp:1.1 llvm/lib/Support/Streams.cpp:1.2
--- llvm/lib/Support/Streams.cpp:1.1 Fri Nov 17 03:51:22 2006
+++ llvm/lib/Support/Streams.cpp Wed Dec 6 19:30:31 2006
@@ -16,6 +16,7 @@
#include <iostream>
using namespace llvm;
-llvm_ostream llvm::llvm_null;
-llvm_ostream llvm::llvm_cout(std::cout);
-llvm_ostream llvm::llvm_cerr(std::cerr);
+OStream llvm::NullStream;
+OStream llvm::cout(std::cout);
+OStream llvm::cerr(std::cerr);
+IStream llvm::cin(std::cin);
Index: llvm/lib/Support/SystemUtils.cpp
diff -u llvm/lib/Support/SystemUtils.cpp:1.46 llvm/lib/Support/SystemUtils.cpp:1.47
--- llvm/lib/Support/SystemUtils.cpp:1.46 Sun Nov 26 04:52:51 2006
+++ llvm/lib/Support/SystemUtils.cpp Wed Dec 6 19:30:31 2006
@@ -23,10 +23,10 @@
bool print_warning) {
if (stream_to_check == &std::cout && sys::Process::StandardOutIsDisplayed()) {
if (print_warning) {
- llvm_cerr << "WARNING: You're attempting to print out a bytecode file.\n"
- << "This is inadvisable as it may cause display problems. If\n"
- << "you REALLY want to taste LLVM bytecode first-hand, you\n"
- << "can force output with the `-f' option.\n\n";
+ cerr << "WARNING: You're attempting to print out a bytecode file.\n"
+ << "This is inadvisable as it may cause display problems. If\n"
+ << "you REALLY want to taste LLVM bytecode first-hand, you\n"
+ << "can force output with the `-f' option.\n\n";
}
return true;
}
More information about the llvm-commits
mailing list