diff options
author | Chris Lattner <sabre@nondot.org> | 2011-06-18 21:18:23 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-06-18 21:18:23 +0000 |
commit | 0cd0d881604775f3f97048645f040b2ef4f61e4b (patch) | |
tree | 3340f491b6eefaabc97dc41d3287b6c38fcaa474 /lib/VMCore | |
parent | 70d0ff1a977273c925fea03070cf33c4a6cbd2cf (diff) | |
download | external_llvm-0cd0d881604775f3f97048645f040b2ef4f61e4b.zip external_llvm-0cd0d881604775f3f97048645f040b2ef4f61e4b.tar.gz external_llvm-0cd0d881604775f3f97048645f040b2ef4f61e4b.tar.bz2 |
eliminate the Type::getDescription() method, using "<<" instead. This
removes some gunk from LLVMContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133360 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/LLVMContextImpl.h | 8 | ||||
-rw-r--r-- | lib/VMCore/Type.cpp | 20 | ||||
-rw-r--r-- | lib/VMCore/TypeSymbolTable.cpp | 15 | ||||
-rw-r--r-- | lib/VMCore/ValueSymbolTable.cpp | 2 |
4 files changed, 8 insertions, 37 deletions
diff --git a/lib/VMCore/LLVMContextImpl.h b/lib/VMCore/LLVMContextImpl.h index 6ea4b48e..d1ff0ec 100644 --- a/lib/VMCore/LLVMContextImpl.h +++ b/lib/VMCore/LLVMContextImpl.h @@ -22,7 +22,6 @@ #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Metadata.h" -#include "llvm/Assembly/Writer.h" #include "llvm/Support/ValueHandle.h" #include "llvm/ADT/APFloat.h" #include "llvm/ADT/APInt.h" @@ -182,13 +181,6 @@ public: const IntegerType Int32Ty; const IntegerType Int64Ty; - // Concrete/Abstract TypeDescriptions - We lazily calculate type descriptions - // for types as they are needed. Because resolution of types must invalidate - // all of the abstract type descriptions, we keep them in a separate map to - // make this easy. - TypePrinting ConcreteTypeDescriptions; - TypePrinting AbstractTypeDescriptions; - TypeMap<ArrayValType, ArrayType> ArrayTypes; TypeMap<VectorValType, VectorType> VectorTypes; TypeMap<PointerValType, PointerType> PointerTypes; diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index 566bb28..6c348be 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -286,21 +286,6 @@ void Type::typeBecameConcrete(const DerivedType *AbsTy) { llvm_unreachable("DerivedType is already a concrete type!"); } - -std::string Type::getDescription() const { - LLVMContextImpl *pImpl = getContext().pImpl; - TypePrinting &Map = - isAbstract() ? - pImpl->AbstractTypeDescriptions : - pImpl->ConcreteTypeDescriptions; - - std::string DescStr; - raw_string_ostream DescOS(DescStr); - Map.print(this, DescOS); - return DescOS.str(); -} - - bool StructType::indexValid(const Value *V) const { // Structure indexes require 32-bit integer constants. if (V->getType()->isIntegerTy(32)) @@ -1067,11 +1052,6 @@ void DerivedType::refineAbstractTypeTo(const Type *NewType) { assert(this != NewType && "Can't refine to myself!"); assert(ForwardType == 0 && "This type has already been refined!"); - LLVMContextImpl *pImpl = getContext().pImpl; - - // The descriptions may be out of date. Conservatively clear them all! - pImpl->AbstractTypeDescriptions.clear(); - #ifdef DEBUG_MERGE_TYPES DEBUG(dbgs() << "REFINING abstract type [" << (void*)this << " " << *this << "] to [" << (void*)NewType << " " diff --git a/lib/VMCore/TypeSymbolTable.cpp b/lib/VMCore/TypeSymbolTable.cpp index d68a44b..80c6a74 100644 --- a/lib/VMCore/TypeSymbolTable.cpp +++ b/lib/VMCore/TypeSymbolTable.cpp @@ -59,7 +59,7 @@ Type* TypeSymbolTable::remove(iterator Entry) { #if DEBUG_SYMBOL_TABLE dump(); - dbgs() << " Removing Value: " << Result->getDescription() << "\n"; + dbgs() << " Removing Value: " << *Result << "\n"; #endif tmap.erase(Entry); @@ -69,8 +69,7 @@ Type* TypeSymbolTable::remove(iterator Entry) { if (Result->isAbstract()) { #if DEBUG_ABSTYPE dbgs() << "Removing abstract type from symtab" - << Result->getDescription() - << "\n"; + << *Result << "\n"; #endif cast<DerivedType>(Result)->removeAbstractTypeUser(this); } @@ -88,7 +87,7 @@ void TypeSymbolTable::insert(StringRef Name, const Type* T) { #if DEBUG_SYMBOL_TABLE dump(); - dbgs() << " Inserted type: " << Name << ": " << T->getDescription() << "\n"; + dbgs() << " Inserted type: " << Name << ": " << *T << "\n"; #endif } else { // If there is a name conflict... @@ -101,7 +100,7 @@ void TypeSymbolTable::insert(StringRef Name, const Type* T) { #if DEBUG_SYMBOL_TABLE dump(); dbgs() << " Inserting type: " << UniqueName << ": " - << T->getDescription() << "\n"; + << *T << "\n"; #endif // Insert the tmap entry @@ -112,7 +111,7 @@ void TypeSymbolTable::insert(StringRef Name, const Type* T) { if (T->isAbstract()) { cast<DerivedType>(T)->addAbstractTypeUser(this); #if DEBUG_ABSTYPE - dbgs() << "Added abstract type to ST: " << T->getDescription() << "\n"; + dbgs() << "Added abstract type to ST: " << *T << "\n"; #endif } } @@ -129,7 +128,7 @@ void TypeSymbolTable::refineAbstractType(const DerivedType *OldType, // FIXME when Types aren't const. if (I->second == const_cast<DerivedType *>(OldType)) { #if DEBUG_ABSTYPE - dbgs() << "Removing type " << OldType->getDescription() << "\n"; + dbgs() << "Removing type " << *OldType << "\n"; #endif OldType->removeAbstractTypeUser(this); @@ -137,7 +136,7 @@ void TypeSymbolTable::refineAbstractType(const DerivedType *OldType, I->second = const_cast<Type *>(NewType); if (NewType->isAbstract()) { #if DEBUG_ABSTYPE - dbgs() << "Added type " << NewType->getDescription() << "\n"; + dbgs() << "Added type " << *NewType << "\n"; #endif cast<DerivedType>(NewType)->addAbstractTypeUser(this); } diff --git a/lib/VMCore/ValueSymbolTable.cpp b/lib/VMCore/ValueSymbolTable.cpp index 254bf06..f1c9703 100644 --- a/lib/VMCore/ValueSymbolTable.cpp +++ b/lib/VMCore/ValueSymbolTable.cpp @@ -25,7 +25,7 @@ ValueSymbolTable::~ValueSymbolTable() { #ifndef NDEBUG // Only do this in -g mode... for (iterator VI = vmap.begin(), VE = vmap.end(); VI != VE; ++VI) dbgs() << "Value still in symbol table! Type = '" - << VI->getValue()->getType()->getDescription() << "' Name = '" + << *VI->getValue()->getType() << "' Name = '" << VI->getKeyData() << "'\n"; assert(vmap.empty() && "Values remain in symbol table!"); #endif |