summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-07-10 00:04:23 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-07-10 00:04:23 +0000
commit250c1d8734ae29b8e408e16dc575b21a31fcb0d7 (patch)
treee06370e743baca91abccd3d589ae9d7c6e4e8192 /include
parenteacdef21c65308fe5169b53bdbc2757bd75fdc0e (diff)
downloadllvm-250c1d8734ae29b8e408e16dc575b21a31fcb0d7.tar.gz
llvm-250c1d8734ae29b8e408e16dc575b21a31fcb0d7.tar.bz2
llvm-250c1d8734ae29b8e408e16dc575b21a31fcb0d7.tar.xz
- Replace use of std::map<std::string, ..> with StringMap. Replace use of std::map with DenseMap, std::set with SmallPtrSet. This results in minor speed up.
- Some code clean up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53379 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Support/Mangler.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/include/llvm/Support/Mangler.h b/include/llvm/Support/Mangler.h
index 0a7b33a232..94f0adb267 100644
--- a/include/llvm/Support/Mangler.h
+++ b/include/llvm/Support/Mangler.h
@@ -15,8 +15,7 @@
#define LLVM_SUPPORT_MANGLER_H
#include "llvm/ADT/DenseMap.h"
-#include <map>
-#include <set>
+#include "llvm/ADT/SmallPtrSet.h"
#include <string>
namespace llvm {
@@ -49,13 +48,13 @@ class Mangler {
/// TypeMap - If the client wants us to unique types, this keeps track of the
/// current assignments and TypeCounter keeps track of the next id to assign.
- std::map<const Type*, unsigned> TypeMap;
+ DenseMap<const Type*, unsigned> TypeMap;
unsigned TypeCounter;
/// This keeps track of which global values have had their names
/// mangled in the current module.
///
- std::set<const GlobalValue*> MangledGlobals;
+ SmallPtrSet<const GlobalValue*, 16> MangledGlobals;
/// AcceptableChars - This bitfield contains a one for each character that is
/// allowed to be part of an unmangled name.
@@ -87,10 +86,6 @@ public:
return (AcceptableChars[X/32] & (1 << (X&31))) != 0;
}
- /// getTypeID - Return a unique ID for the specified LLVM type.
- ///
- unsigned getTypeID(const Type *Ty);
-
/// getValueName - Returns the mangled name of V, an LLVM Value,
/// in the current module.
///
@@ -105,9 +100,11 @@ public:
/// from getValueName.
///
std::string makeNameProper(const std::string &x, const char *Prefix = "");
-
+
private:
- void InsertName(GlobalValue *GV, std::map<std::string, GlobalValue*> &Names);
+ /// getTypeID - Return a unique ID for the specified LLVM type.
+ ///
+ unsigned getTypeID(const Type *Ty);
};
} // End llvm namespace