[llvm-commits] [llvm] r79838 - in /llvm/trunk/lib/Analysis: DebugInfo.cpp LoopInfo.cpp ProfileInfoLoader.cpp ProfileInfoLoaderPass.cpp
Chris Lattner
sabre at nondot.org
Sun Aug 23 00:33:14 PDT 2009
Author: lattner
Date: Sun Aug 23 02:33:14 2009
New Revision: 79838
URL: http://llvm.org/viewvc/llvm-project?rev=79838&view=rev
Log:
remove uses of llvm/Support/Streams.h.
Modified:
llvm/trunk/lib/Analysis/DebugInfo.cpp
llvm/trunk/lib/Analysis/LoopInfo.cpp
llvm/trunk/lib/Analysis/ProfileInfoLoader.cpp
llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp
Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=79838&r1=79837&r2=79838&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/DebugInfo.cpp Sun Aug 23 02:33:14 2009
@@ -23,8 +23,7 @@
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/Support/Dwarf.h"
#include "llvm/Support/DebugLoc.h"
-#include "llvm/Support/Streams.h"
-
+#include "llvm/Support/raw_ostream.h"
using namespace llvm;
using namespace llvm::dwarf;
@@ -342,17 +341,17 @@
/// dump - Print descriptor.
void DIDescriptor::dump() const {
- cerr << "[" << dwarf::TagString(getTag()) << "] ";
- cerr << std::hex << "[GV:" << DbgGV << "]" << std::dec;
+ errs() << "[" << dwarf::TagString(getTag()) << "] [GV:";
+ errs().write_hex((intptr_t)DbgGV) << ']';
}
/// dump - Print compile unit.
void DICompileUnit::dump() const {
if (getLanguage())
- cerr << " [" << dwarf::LanguageString(getLanguage()) << "] ";
+ errs() << " [" << dwarf::LanguageString(getLanguage()) << "] ";
std::string Res1, Res2;
- cerr << " [" << getDirectory(Res1) << "/" << getFilename(Res2) << " ]";
+ errs() << " [" << getDirectory(Res1) << "/" << getFilename(Res2) << " ]";
}
/// dump - Print type.
@@ -361,27 +360,27 @@
std::string Res;
if (!getName(Res).empty())
- cerr << " [" << Res << "] ";
+ errs() << " [" << Res << "] ";
unsigned Tag = getTag();
- cerr << " [" << dwarf::TagString(Tag) << "] ";
+ errs() << " [" << dwarf::TagString(Tag) << "] ";
// TODO : Print context
getCompileUnit().dump();
- cerr << " ["
- << getLineNumber() << ", "
- << getSizeInBits() << ", "
- << getAlignInBits() << ", "
- << getOffsetInBits()
- << "] ";
+ errs() << " ["
+ << getLineNumber() << ", "
+ << getSizeInBits() << ", "
+ << getAlignInBits() << ", "
+ << getOffsetInBits()
+ << "] ";
if (isPrivate())
- cerr << " [private] ";
+ errs() << " [private] ";
else if (isProtected())
- cerr << " [protected] ";
+ errs() << " [protected] ";
if (isForwardDecl())
- cerr << " [fwd] ";
+ errs() << " [fwd] ";
if (isBasicType(Tag))
DIBasicType(DbgGV).dump();
@@ -390,21 +389,21 @@
else if (isCompositeType(Tag))
DICompositeType(DbgGV).dump();
else {
- cerr << "Invalid DIType\n";
+ errs() << "Invalid DIType\n";
return;
}
- cerr << "\n";
+ errs() << "\n";
}
/// dump - Print basic type.
void DIBasicType::dump() const {
- cerr << " [" << dwarf::AttributeEncodingString(getEncoding()) << "] ";
+ errs() << " [" << dwarf::AttributeEncodingString(getEncoding()) << "] ";
}
/// dump - Print derived type.
void DIDerivedType::dump() const {
- cerr << "\n\t Derived From: "; getTypeDerivedFrom().dump();
+ errs() << "\n\t Derived From: "; getTypeDerivedFrom().dump();
}
/// dump - Print composite type.
@@ -412,32 +411,32 @@
DIArray A = getTypeArray();
if (A.isNull())
return;
- cerr << " [" << A.getNumElements() << " elements]";
+ errs() << " [" << A.getNumElements() << " elements]";
}
/// dump - Print global.
void DIGlobal::dump() const {
std::string Res;
if (!getName(Res).empty())
- cerr << " [" << Res << "] ";
+ errs() << " [" << Res << "] ";
unsigned Tag = getTag();
- cerr << " [" << dwarf::TagString(Tag) << "] ";
+ errs() << " [" << dwarf::TagString(Tag) << "] ";
// TODO : Print context
getCompileUnit().dump();
- cerr << " [" << getLineNumber() << "] ";
+ errs() << " [" << getLineNumber() << "] ";
if (isLocalToUnit())
- cerr << " [local] ";
+ errs() << " [local] ";
if (isDefinition())
- cerr << " [def] ";
+ errs() << " [def] ";
if (isGlobalVariable(Tag))
DIGlobalVariable(DbgGV).dump();
- cerr << "\n";
+ errs() << "\n";
}
/// dump - Print subprogram.
@@ -447,19 +446,21 @@
/// dump - Print global variable.
void DIGlobalVariable::dump() const {
- cerr << " ["; getGlobal()->dump(); cerr << "] ";
+ errs() << " [";
+ getGlobal()->dump();
+ errs() << "] ";
}
/// dump - Print variable.
void DIVariable::dump() const {
std::string Res;
if (!getName(Res).empty())
- cerr << " [" << Res << "] ";
+ errs() << " [" << Res << "] ";
getCompileUnit().dump();
- cerr << " [" << getLineNumber() << "] ";
+ errs() << " [" << getLineNumber() << "] ";
getType().dump();
- cerr << "\n";
+ errs() << "\n";
}
//===----------------------------------------------------------------------===//
Modified: llvm/trunk/lib/Analysis/LoopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopInfo.cpp?rev=79838&r1=79837&r2=79838&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LoopInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/LoopInfo.cpp Sun Aug 23 02:33:14 2009
@@ -20,7 +20,6 @@
#include "llvm/Analysis/Dominators.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/Support/CFG.h"
-#include "llvm/Support/Streams.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/SmallPtrSet.h"
#include <algorithm>
Modified: llvm/trunk/lib/Analysis/ProfileInfoLoader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileInfoLoader.cpp?rev=79838&r1=79837&r2=79838&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ProfileInfoLoader.cpp (original)
+++ llvm/trunk/lib/Analysis/ProfileInfoLoader.cpp Sun Aug 23 02:33:14 2009
@@ -16,7 +16,7 @@
#include "llvm/Analysis/ProfileInfoTypes.h"
#include "llvm/Module.h"
#include "llvm/InstrTypes.h"
-#include "llvm/Support/Streams.h"
+#include "llvm/Support/raw_ostream.h"
#include <cstdio>
#include <cstdlib>
#include <map>
@@ -38,7 +38,7 @@
// Read the number of entries...
unsigned NumEntries;
if (fread(&NumEntries, sizeof(unsigned), 1, F) != 1) {
- cerr << ToolName << ": data packet truncated!\n";
+ errs() << ToolName << ": data packet truncated!\n";
perror(0);
exit(1);
}
@@ -49,7 +49,7 @@
// Read in the block of data...
if (fread(&TempSpace[0], sizeof(unsigned)*NumEntries, 1, F) != 1) {
- cerr << ToolName << ": data packet truncated!\n";
+ errs() << ToolName << ": data packet truncated!\n";
perror(0);
exit(1);
}
@@ -78,7 +78,7 @@
M(TheModule), Warned(false) {
FILE *F = fopen(Filename.c_str(), "r");
if (F == 0) {
- cerr << ToolName << ": Error opening '" << Filename << "': ";
+ errs() << ToolName << ": Error opening '" << Filename << "': ";
perror(0);
exit(1);
}
@@ -96,7 +96,7 @@
case ArgumentInfo: {
unsigned ArgLength;
if (fread(&ArgLength, sizeof(unsigned), 1, F) != 1) {
- cerr << ToolName << ": arguments packet truncated!\n";
+ errs() << ToolName << ": arguments packet truncated!\n";
perror(0);
exit(1);
}
@@ -107,7 +107,7 @@
if (ArgLength)
if (fread(&Chars[0], (ArgLength+3) & ~3, 1, F) != 1) {
- cerr << ToolName << ": arguments packet truncated!\n";
+ errs() << ToolName << ": arguments packet truncated!\n";
perror(0);
exit(1);
}
@@ -132,7 +132,7 @@
break;
default:
- cerr << ToolName << ": Unknown packet type #" << PacketType << "!\n";
+ errs() << ToolName << ": Unknown packet type #" << PacketType << "!\n";
exit(1);
}
}
Modified: llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp?rev=79838&r1=79837&r2=79838&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp (original)
+++ llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp Sun Aug 23 02:33:14 2009
@@ -21,7 +21,7 @@
#include "llvm/Analysis/ProfileInfoLoader.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Streams.h"
+#include "llvm/Support/raw_ostream.h"
using namespace llvm;
static cl::opt<std::string>
@@ -92,8 +92,8 @@
}
}
if (ei != ECs.size()) {
- cerr << "WARNING: profile information is inconsistent with "
- << "the current program!\n";
+ errs() << "WARNING: profile information is inconsistent with "
+ << "the current program!\n";
}
}
@@ -108,8 +108,8 @@
BlockInformation[F][BB] = BCs[bi++];
}
if (bi != BCs.size()) {
- cerr << "WARNING: profile information is inconsistent with "
- << "the current program!\n";
+ errs() << "WARNING: profile information is inconsistent with "
+ << "the current program!\n";
}
}
@@ -123,8 +123,8 @@
FunctionInformation[F] = FCs[fi++];
}
if (fi != FCs.size()) {
- cerr << "WARNING: profile information is inconsistent with "
- << "the current program!\n";
+ errs() << "WARNING: profile information is inconsistent with "
+ << "the current program!\n";
}
}
More information about the llvm-commits
mailing list