Convert debug messages to use dbgs(). Generally this means

s/errs/dbgs/g except for certain special cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92032 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Greene 2009-12-23 19:45:49 +00:00
parent 43c48ac801
commit 0eb5b666dd

View File

@ -22,6 +22,7 @@
#include "llvm/Module.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Dwarf.h"
#include "llvm/Support/DebugLoc.h"
#include "llvm/Support/raw_ostream.h"
@ -475,16 +476,16 @@ StringRef DIScope::getDirectory() const {
/// dump - Print descriptor.
void DIDescriptor::dump() const {
errs() << "[" << dwarf::TagString(getTag()) << "] ";
errs().write_hex((intptr_t) &*DbgNode) << ']';
dbgs() << "[" << dwarf::TagString(getTag()) << "] ";
dbgs().write_hex((intptr_t) &*DbgNode) << ']';
}
/// dump - Print compile unit.
void DICompileUnit::dump() const {
if (getLanguage())
errs() << " [" << dwarf::LanguageString(getLanguage()) << "] ";
dbgs() << " [" << dwarf::LanguageString(getLanguage()) << "] ";
errs() << " [" << getDirectory() << "/" << getFilename() << " ]";
dbgs() << " [" << getDirectory() << "/" << getFilename() << " ]";
}
/// dump - Print type.
@ -493,14 +494,14 @@ void DIType::dump() const {
StringRef Res = getName();
if (!Res.empty())
errs() << " [" << Res << "] ";
dbgs() << " [" << Res << "] ";
unsigned Tag = getTag();
errs() << " [" << dwarf::TagString(Tag) << "] ";
dbgs() << " [" << dwarf::TagString(Tag) << "] ";
// TODO : Print context
getCompileUnit().dump();
errs() << " ["
dbgs() << " ["
<< getLineNumber() << ", "
<< getSizeInBits() << ", "
<< getAlignInBits() << ", "
@ -508,12 +509,12 @@ void DIType::dump() const {
<< "] ";
if (isPrivate())
errs() << " [private] ";
dbgs() << " [private] ";
else if (isProtected())
errs() << " [protected] ";
dbgs() << " [protected] ";
if (isForwardDecl())
errs() << " [fwd] ";
dbgs() << " [fwd] ";
if (isBasicType())
DIBasicType(DbgNode).dump();
@ -522,21 +523,21 @@ void DIType::dump() const {
else if (isCompositeType())
DICompositeType(DbgNode).dump();
else {
errs() << "Invalid DIType\n";
dbgs() << "Invalid DIType\n";
return;
}
errs() << "\n";
dbgs() << "\n";
}
/// dump - Print basic type.
void DIBasicType::dump() const {
errs() << " [" << dwarf::AttributeEncodingString(getEncoding()) << "] ";
dbgs() << " [" << dwarf::AttributeEncodingString(getEncoding()) << "] ";
}
/// dump - Print derived type.
void DIDerivedType::dump() const {
errs() << "\n\t Derived From: "; getTypeDerivedFrom().dump();
dbgs() << "\n\t Derived From: "; getTypeDerivedFrom().dump();
}
/// dump - Print composite type.
@ -544,73 +545,73 @@ void DICompositeType::dump() const {
DIArray A = getTypeArray();
if (A.isNull())
return;
errs() << " [" << A.getNumElements() << " elements]";
dbgs() << " [" << A.getNumElements() << " elements]";
}
/// dump - Print global.
void DIGlobal::dump() const {
StringRef Res = getName();
if (!Res.empty())
errs() << " [" << Res << "] ";
dbgs() << " [" << Res << "] ";
unsigned Tag = getTag();
errs() << " [" << dwarf::TagString(Tag) << "] ";
dbgs() << " [" << dwarf::TagString(Tag) << "] ";
// TODO : Print context
getCompileUnit().dump();
errs() << " [" << getLineNumber() << "] ";
dbgs() << " [" << getLineNumber() << "] ";
if (isLocalToUnit())
errs() << " [local] ";
dbgs() << " [local] ";
if (isDefinition())
errs() << " [def] ";
dbgs() << " [def] ";
if (isGlobalVariable())
DIGlobalVariable(DbgNode).dump();
errs() << "\n";
dbgs() << "\n";
}
/// dump - Print subprogram.
void DISubprogram::dump() const {
StringRef Res = getName();
if (!Res.empty())
errs() << " [" << Res << "] ";
dbgs() << " [" << Res << "] ";
unsigned Tag = getTag();
errs() << " [" << dwarf::TagString(Tag) << "] ";
dbgs() << " [" << dwarf::TagString(Tag) << "] ";
// TODO : Print context
getCompileUnit().dump();
errs() << " [" << getLineNumber() << "] ";
dbgs() << " [" << getLineNumber() << "] ";
if (isLocalToUnit())
errs() << " [local] ";
dbgs() << " [local] ";
if (isDefinition())
errs() << " [def] ";
dbgs() << " [def] ";
errs() << "\n";
dbgs() << "\n";
}
/// dump - Print global variable.
void DIGlobalVariable::dump() const {
errs() << " [";
dbgs() << " [";
getGlobal()->dump();
errs() << "] ";
dbgs() << "] ";
}
/// dump - Print variable.
void DIVariable::dump() const {
StringRef Res = getName();
if (!Res.empty())
errs() << " [" << Res << "] ";
dbgs() << " [" << Res << "] ";
getCompileUnit().dump();
errs() << " [" << getLineNumber() << "] ";
dbgs() << " [" << getLineNumber() << "] ";
getType().dump();
errs() << "\n";
dbgs() << "\n";
// FIXME: Dump complex addresses
}