From 569f121f4ecc53f8ab505c4ccb6e1e77c78e188d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 23 Aug 2009 04:44:11 +0000 Subject: [PATCH] remove some DOUTs git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79821 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/ConstantsContext.h | 3 ++- lib/VMCore/Type.cpp | 38 +++++++++++++-------------- lib/VMCore/TypesContext.h | 10 +++---- lib/VMCore/ValueSymbolTable.cpp | 16 +++++------ utils/TableGen/AsmWriterEmitter.cpp | 4 +-- utils/TableGen/CodeGenDAGPatterns.cpp | 30 ++++++++++----------- utils/TableGen/DAGISelEmitter.cpp | 8 +++--- 7 files changed, 55 insertions(+), 54 deletions(-) diff --git a/lib/VMCore/ConstantsContext.h b/lib/VMCore/ConstantsContext.h index 3ace92efd8c..22aba7e1d35 100644 --- a/lib/VMCore/ConstantsContext.h +++ b/lib/VMCore/ConstantsContext.h @@ -20,6 +20,7 @@ #include "llvm/Operator.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/raw_ostream.h" #include "llvm/System/Mutex.h" #include "llvm/System/RWMutex.h" #include @@ -773,7 +774,7 @@ public: } void dump() const { - DOUT << "Constant.cpp: ValueMap\n"; + DEBUG(errs() << "Constant.cpp: ValueMap\n"); } }; diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index 8aaee5433da..3f64e81f92f 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -467,7 +467,7 @@ PointerType::PointerType(const Type *E, unsigned AddrSpace) OpaqueType::OpaqueType(LLVMContext &C) : DerivedType(C, OpaqueTyID) { setAbstract(true); #ifdef DEBUG_MERGE_TYPES - DOUT << "Derived new type: " << *this << "\n"; + DEBUG(errs() << "Derived new type: " << *this << "\n"); #endif } @@ -756,7 +756,7 @@ const IntegerType *IntegerType::get(LLVMContext &C, unsigned NumBits) { pImpl->IntegerTypes.add(IVT, ITy); } #ifdef DEBUG_MERGE_TYPES - DOUT << "Derived new type: " << *ITy << "\n"; + DEBUG(errs() << "Derived new type: " << *ITy << "\n"); #endif return ITy; } @@ -800,7 +800,7 @@ FunctionType *FunctionType::get(const Type *ReturnType, } #ifdef DEBUG_MERGE_TYPES - DOUT << "Derived new type: " << FT << "\n"; + DEBUG(errs() << "Derived new type: " << FT << "\n"); #endif return FT; } @@ -822,7 +822,7 @@ ArrayType *ArrayType::get(const Type *ElementType, uint64_t NumElements) { pImpl->ArrayTypes.add(AVT, AT = new ArrayType(ElementType, NumElements)); } #ifdef DEBUG_MERGE_TYPES - DOUT << "Derived new type: " << *AT << "\n"; + DEBUG(errs() << "Derived new type: " << *AT << "\n"); #endif return AT; } @@ -855,7 +855,7 @@ VectorType *VectorType::get(const Type *ElementType, unsigned NumElements) { pImpl->VectorTypes.add(PVT, PT = new VectorType(ElementType, NumElements)); } #ifdef DEBUG_MERGE_TYPES - DOUT << "Derived new type: " << *PT << "\n"; + DEBUG(errs() << "Derived new type: " << *PT << "\n"); #endif return PT; } @@ -891,7 +891,7 @@ StructType *StructType::get(LLVMContext &Context, pImpl->StructTypes.add(STV, ST); } #ifdef DEBUG_MERGE_TYPES - DOUT << "Derived new type: " << *ST << "\n"; + DEBUG(errs() << "Derived new type: " << *ST << "\n"); #endif return ST; } @@ -944,7 +944,7 @@ PointerType *PointerType::get(const Type *ValueType, unsigned AddressSpace) { pImpl->PointerTypes.add(PVT, PT = new PointerType(ValueType, AddressSpace)); } #ifdef DEBUG_MERGE_TYPES - DOUT << "Derived new type: " << *PT << "\n"; + DEBUG(errs() << "Derived new type: " << *PT << "\n"); #endif return PT; } @@ -1004,14 +1004,14 @@ void Type::removeAbstractTypeUser(AbstractTypeUser *U) const { AbstractTypeUsers.erase(AbstractTypeUsers.begin()+i); #ifdef DEBUG_MERGE_TYPES - DOUT << " remAbstractTypeUser[" << (void*)this << ", " - << *this << "][" << i << "] User = " << U << "\n"; + DEBUG(errs() << " remAbstractTypeUser[" << (void*)this << ", " + << *this << "][" << i << "] User = " << U << "\n"); #endif if (AbstractTypeUsers.empty() && getRefCount() == 0 && isAbstract()) { #ifdef DEBUG_MERGE_TYPES - DOUT << "DELETEing unused abstract type: <" << *this - << ">[" << (void*)this << "]" << "\n"; + DEBUG(errs() << "DELETEing unused abstract type: <" << *this + << ">[" << (void*)this << "]" << "\n"); #endif this->destroy(); @@ -1037,9 +1037,9 @@ void DerivedType::unlockedRefineAbstractTypeTo(const Type *NewType) { pImpl->AbstractTypeDescriptions.clear(); #ifdef DEBUG_MERGE_TYPES - DOUT << "REFINING abstract type [" << (void*)this << " " - << *this << "] to [" << (void*)NewType << " " - << *NewType << "]!\n"; + DEBUG(errs() << "REFINING abstract type [" << (void*)this << " " + << *this << "] to [" << (void*)NewType << " " + << *NewType << "]!\n"); #endif // Make sure to put the type to be refined to into a holder so that if IT gets @@ -1075,10 +1075,10 @@ void DerivedType::unlockedRefineAbstractTypeTo(const Type *NewType) { unsigned OldSize = AbstractTypeUsers.size(); OldSize=OldSize; #ifdef DEBUG_MERGE_TYPES - DOUT << " REFINING user " << OldSize-1 << "[" << (void*)User - << "] of abstract type [" << (void*)this << " " - << *this << "] to [" << (void*)NewTy.get() << " " - << *NewTy << "]!\n"; + DEBUG(errs() << " REFINING user " << OldSize-1 << "[" << (void*)User + << "] of abstract type [" << (void*)this << " " + << *this << "] to [" << (void*)NewTy.get() << " " + << *NewTy << "]!\n"); #endif User->refineAbstractType(this, NewTy); @@ -1108,7 +1108,7 @@ void DerivedType::refineAbstractTypeTo(const Type *NewType) { // void DerivedType::notifyUsesThatTypeBecameConcrete() { #ifdef DEBUG_MERGE_TYPES - DOUT << "typeIsREFINED type: " << (void*)this << " " << *this << "\n"; + DEBUG(errs() << "typeIsREFINED type: " << (void*)this << " " << *this <<"\n"); #endif LLVMContextImpl *pImpl = getContext().pImpl; diff --git a/lib/VMCore/TypesContext.h b/lib/VMCore/TypesContext.h index 8e2487901f6..2a287fe5df6 100644 --- a/lib/VMCore/TypesContext.h +++ b/lib/VMCore/TypesContext.h @@ -304,8 +304,8 @@ public: void RefineAbstractType(TypeClass *Ty, const DerivedType *OldType, const Type *NewType) { #ifdef DEBUG_MERGE_TYPES - DOUT << "RefineAbstractType(" << (void*)OldType << "[" << *OldType - << "], " << (void*)NewType << " [" << *NewType << "])\n"; + DEBUG(errs() << "RefineAbstractType(" << (void*)OldType << "[" << *OldType + << "], " << (void*)NewType << " [" << *NewType << "])\n"); #endif // Otherwise, we are changing one subelement type into another. Clearly the @@ -410,12 +410,12 @@ public: void print(const char *Arg) const { #ifdef DEBUG_MERGE_TYPES - DOUT << "TypeMap<>::" << Arg << " table contents:\n"; + DEBUG(errs() << "TypeMap<>::" << Arg << " table contents:\n"); unsigned i = 0; for (typename std::map::const_iterator I = Map.begin(), E = Map.end(); I != E; ++I) - DOUT << " " << (++i) << ". " << (void*)I->second.get() << " " - << *I->second.get() << "\n"; + DEBUG(errs() << " " << (++i) << ". " << (void*)I->second.get() << " " + << *I->second.get() << "\n"); #endif } diff --git a/lib/VMCore/ValueSymbolTable.cpp b/lib/VMCore/ValueSymbolTable.cpp index 8579ad98c1b..7765a98c1fd 100644 --- a/lib/VMCore/ValueSymbolTable.cpp +++ b/lib/VMCore/ValueSymbolTable.cpp @@ -38,7 +38,7 @@ void ValueSymbolTable::reinsertValue(Value* V) { // Try inserting the name, assuming it won't conflict. if (vmap.insert(V->Name)) { - //DOUT << " Inserted value: " << V->Name << ": " << *V << "\n"; + //DEBUG(errs() << " Inserted value: " << V->Name << ": " << *V << "\n"); return; } @@ -62,14 +62,14 @@ void ValueSymbolTable::reinsertValue(Value* V) { // Newly inserted name. Success! NewName.setValue(V); V->Name = &NewName; - //DEBUG(DOUT << " Inserted value: " << UniqueName << ": " << *V << "\n"); + //DEBUG(errs() << " Inserted value: " << UniqueName << ": " << *V << "\n"); return; } } } void ValueSymbolTable::removeValueName(ValueName *V) { - //DEBUG(DOUT << " Removing Value: " << V->getKeyData() << "\n"); + //DEBUG(errs() << " Removing Value: " << V->getKeyData() << "\n"); // Remove the value from the symbol table. vmap.remove(V); } @@ -82,7 +82,7 @@ ValueName *ValueSymbolTable::createValueName(const StringRef &Name, Value *V) { ValueName &Entry = vmap.GetOrCreateValue(Name); if (Entry.getValue() == 0) { Entry.setValue(V); - //DEBUG(DOUT << " Inserted value: " << Entry.getKeyData() << ": " + //DEBUG(errs() << " Inserted value: " << Entry.getKeyData() << ": " // << *V << "\n"); return &Entry; } @@ -102,7 +102,7 @@ ValueName *ValueSymbolTable::createValueName(const StringRef &Name, Value *V) { if (NewName.getValue() == 0) { // Newly inserted name. Success! NewName.setValue(V); - //DEBUG(DOUT << " Inserted value: " << UniqueName << ": " << *V << "\n"); + //DEBUG(errs() << " Inserted value: " << UniqueName << ": " << *V << "\n"); return &NewName; } } @@ -112,10 +112,10 @@ ValueName *ValueSymbolTable::createValueName(const StringRef &Name, Value *V) { // dump - print out the symbol table // void ValueSymbolTable::dump() const { - //DOUT << "ValueSymbolTable:\n"; + //DEBUG(errs() << "ValueSymbolTable:\n"); for (const_iterator I = begin(), E = end(); I != E; ++I) { - //DOUT << " '" << I->getKeyData() << "' = "; + //DEBUG(errs() << " '" << I->getKeyData() << "' = "); I->getValue()->dump(); - //DOUT << "\n"; + //DEBUG(errs() << "\n"); } } diff --git a/utils/TableGen/AsmWriterEmitter.cpp b/utils/TableGen/AsmWriterEmitter.cpp index bdf07f09024..1e85ff9b7f2 100644 --- a/utils/TableGen/AsmWriterEmitter.cpp +++ b/utils/TableGen/AsmWriterEmitter.cpp @@ -658,8 +658,8 @@ void AsmWriterEmitter::run(raw_ostream &O) { // If we don't have enough bits for this operand, don't include it. if (NumBits > BitsLeft) { - DOUT << "Not enough bits to densely encode " << NumBits - << " more bits\n"; + DEBUG(errs() << "Not enough bits to densely encode " << NumBits + << " more bits\n"); break; } diff --git a/utils/TableGen/CodeGenDAGPatterns.cpp b/utils/TableGen/CodeGenDAGPatterns.cpp index efa7fe4ae95..2f12a6c4cbe 100644 --- a/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/utils/TableGen/CodeGenDAGPatterns.cpp @@ -135,14 +135,14 @@ void FindDepVars(TreePatternNode *N, MultipleUseVarSet &DepVars) { //! Dump the dependent variable set: void DumpDepVars(MultipleUseVarSet &DepVars) { if (DepVars.empty()) { - DOUT << ""; + DEBUG(errs() << ""); } else { - DOUT << "[ "; + DEBUG(errs() << "[ "); for (MultipleUseVarSet::const_iterator i = DepVars.begin(), e = DepVars.end(); i != e; ++i) { - DOUT << (*i) << " "; + DEBUG(errs() << (*i) << " "); } - DOUT << "]"; + DEBUG(errs() << "]"); } } } @@ -2381,7 +2381,7 @@ static void GenerateVariantsOf(TreePatternNode *N, // GenerateVariants - Generate variants. For example, commutative patterns can // match multiple ways. Add them to PatternsToMatch as well. void CodeGenDAGPatterns::GenerateVariants() { - DOUT << "Generating instruction variants.\n"; + DEBUG(errs() << "Generating instruction variants.\n"); // Loop over all of the patterns we've collected, checking to see if we can // generate variants of the instruction, through the exploitation of @@ -2396,9 +2396,9 @@ void CodeGenDAGPatterns::GenerateVariants() { MultipleUseVarSet DepVars; std::vector Variants; FindDepVars(PatternsToMatch[i].getSrcPattern(), DepVars); - DOUT << "Dependent/multiply used variables: "; + DEBUG(errs() << "Dependent/multiply used variables: "); DEBUG(DumpDepVars(DepVars)); - DOUT << "\n"; + DEBUG(errs() << "\n"); GenerateVariantsOf(PatternsToMatch[i].getSrcPattern(), Variants, *this, DepVars); assert(!Variants.empty() && "Must create at least original variant!"); @@ -2407,16 +2407,16 @@ void CodeGenDAGPatterns::GenerateVariants() { if (Variants.empty()) // No variants for this pattern. continue; - DOUT << "FOUND VARIANTS OF: "; - DEBUG(PatternsToMatch[i].getSrcPattern()->dump()); - DOUT << "\n"; + DEBUG(errs() << "FOUND VARIANTS OF: "; + PatternsToMatch[i].getSrcPattern()->dump(); + errs() << "\n"); for (unsigned v = 0, e = Variants.size(); v != e; ++v) { TreePatternNode *Variant = Variants[v]; - DOUT << " VAR#" << v << ": "; - DEBUG(Variant->dump()); - DOUT << "\n"; + DEBUG(errs() << " VAR#" << v << ": "; + Variant->dump(); + errs() << "\n"); // Scan to see if an instruction or explicit pattern already matches this. bool AlreadyExists = false; @@ -2427,7 +2427,7 @@ void CodeGenDAGPatterns::GenerateVariants() { continue; // Check to see if this variant already exists. if (Variant->isIsomorphicTo(PatternsToMatch[p].getSrcPattern(), DepVars)) { - DOUT << " *** ALREADY EXISTS, ignoring variant.\n"; + DEBUG(errs() << " *** ALREADY EXISTS, ignoring variant.\n"); AlreadyExists = true; break; } @@ -2443,7 +2443,7 @@ void CodeGenDAGPatterns::GenerateVariants() { PatternsToMatch[i].getAddedComplexity())); } - DOUT << "\n"; + DEBUG(errs() << "\n"); } } diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp index 7c98f5d5829..119c991f5ae 100644 --- a/utils/TableGen/DAGISelEmitter.cpp +++ b/utils/TableGen/DAGISelEmitter.cpp @@ -2094,12 +2094,12 @@ void DAGISelEmitter::run(raw_ostream &OS) { EmitNodeTransforms(OS); EmitPredicateFunctions(OS); - DOUT << "\n\nALL PATTERNS TO MATCH:\n\n"; + DEBUG(errs() << "\n\nALL PATTERNS TO MATCH:\n\n"); for (CodeGenDAGPatterns::ptm_iterator I = CGP.ptm_begin(), E = CGP.ptm_end(); I != E; ++I) { - DOUT << "PATTERN: "; DEBUG(I->getSrcPattern()->dump()); - DOUT << "\nRESULT: "; DEBUG(I->getDstPattern()->dump()); - DOUT << "\n"; + DEBUG(errs() << "PATTERN: "; I->getSrcPattern()->dump()); + DEBUG(errs() << "\nRESULT: "; I->getDstPattern()->dump()); + DEBUG(errs() << "\n"); } // At this point, we have full information about the 'Patterns' we need to