summaryrefslogtreecommitdiff
path: root/lib/VMCore
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/LLVMContextImpl.h8
-rw-r--r--lib/VMCore/Type.cpp20
-rw-r--r--lib/VMCore/TypeSymbolTable.cpp15
-rw-r--r--lib/VMCore/ValueSymbolTable.cpp2
4 files changed, 8 insertions, 37 deletions
diff --git a/lib/VMCore/LLVMContextImpl.h b/lib/VMCore/LLVMContextImpl.h
index 6ea4b48e79..d1ff0ecd63 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 566bb28c4a..6c348be18f 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 d68a44bd67..80c6a74790 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 254bf06439..f1c970361a 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