[llvm-commits] [llvm] r65735 - /llvm/trunk/lib/VMCore/AsmWriter.cpp
Chris Lattner
sabre at nondot.org
Sat Feb 28 15:03:56 PST 2009
Author: lattner
Date: Sat Feb 28 17:03:55 2009
New Revision: 65735
URL: http://llvm.org/viewvc/llvm-project?rev=65735&view=rev
Log:
switch to densemap for pointer->word map.
Modified:
llvm/trunk/lib/VMCore/AsmWriter.cpp
Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=65735&r1=65734&r2=65735&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Sat Feb 28 17:03:55 2009
@@ -137,8 +137,8 @@
// 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 @@
}
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 @@
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::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::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);
More information about the llvm-commits
mailing list