aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-28 23:03:55 +0000
committerChris Lattner <sabre@nondot.org>2009-02-28 23:03:55 +0000
commit87185e82f683cf3c046ddf974513d5a286422f5f (patch)
tree661577e05648a4e16f3c55714129d1b2a7b31e4d /lib/VMCore
parentae3042316fe868e1074c15d61804df0900ddc08a (diff)
downloadexternal_llvm-87185e82f683cf3c046ddf974513d5a286422f5f.zip
external_llvm-87185e82f683cf3c046ddf974513d5a286422f5f.tar.gz
external_llvm-87185e82f683cf3c046ddf974513d5a286422f5f.tar.bz2
switch to densemap for pointer->word map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65735 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/AsmWriter.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index 854c3ba..b6f8313 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -137,8 +137,8 @@ static void PrintLLVMName(raw_ostream &OS, const Value *V) {
// TypePrinting Class: Type printing machinery
//===----------------------------------------------------------------------===//
-static std::map<const Type *, std::string> &getTypeNamesMap(void *M) {
- return *static_cast<std::map<const Type *, std::string>*>(M);
+static DenseMap<const Type *, std::string> &getTypeNamesMap(void *M) {
+ return *static_cast<DenseMap<const Type *, std::string>*>(M);
}
void TypePrinting::clear() {
@@ -146,7 +146,7 @@ void TypePrinting::clear() {
}
TypePrinting::TypePrinting(const Module *M) {
- TypeNames = new std::map<const Type *, std::string>();
+ TypeNames = new DenseMap<const Type *, std::string>();
if (M == 0) return;
// If the module has a symbol table, take all global types and stuff their
@@ -187,8 +187,8 @@ void TypePrinting::CalcTypeName(const Type *Ty,
SmallVectorImpl<const Type *> &TypeStack,
raw_ostream &OS) {
// Check to see if the type is named.
- std::map<const Type*, std::string> &TM = getTypeNamesMap(TypeNames);
- std::map<const Type *, std::string>::iterator I = TM.find(Ty);
+ DenseMap<const Type*, std::string> &TM = getTypeNamesMap(TypeNames);
+ DenseMap<const Type *, std::string>::iterator I = TM.find(Ty);
if (I != TM.end() &&
// If the name wasn't temporarily removed use it.
!I->second.empty()) {
@@ -294,8 +294,8 @@ void TypePrinting::CalcTypeName(const Type *Ty,
///
void TypePrinting::print(const Type *Ty, raw_ostream &OS) {
// Check to see if the type is named.
- std::map<const Type*, std::string> &TM = getTypeNamesMap(TypeNames);
- std::map<const Type*, std::string>::iterator I = TM.find(Ty);
+ DenseMap<const Type*, std::string> &TM = getTypeNamesMap(TypeNames);
+ DenseMap<const Type*, std::string>::iterator I = TM.find(Ty);
if (I != TM.end()) {
OS << I->second;
return;
@@ -320,8 +320,8 @@ void TypePrinting::print(const Type *Ty, raw_ostream &OS) {
void TypePrinting::printAtLeastOneLevel(const Type *Ty, raw_ostream &OS) {
// If the type does not have a name, then it is already guaranteed to print at
// least one level.
- std::map<const Type*, std::string> &TM = getTypeNamesMap(TypeNames);
- std::map<const Type*, std::string>::iterator I = TM.find(Ty);
+ DenseMap<const Type*, std::string> &TM = getTypeNamesMap(TypeNames);
+ DenseMap<const Type*, std::string>::iterator I = TM.find(Ty);
if (I == TM.end())
return print(Ty, OS);