diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-07-10 00:04:23 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-07-10 00:04:23 +0000 |
commit | e32cb992b4b572d32cf8673f8d25536961651bcf (patch) | |
tree | e06370e743baca91abccd3d589ae9d7c6e4e8192 /include/llvm/Support/Mangler.h | |
parent | 4560c26a3aff6f500efa414d3007abadf728946a (diff) | |
download | external_llvm-e32cb992b4b572d32cf8673f8d25536961651bcf.zip external_llvm-e32cb992b4b572d32cf8673f8d25536961651bcf.tar.gz external_llvm-e32cb992b4b572d32cf8673f8d25536961651bcf.tar.bz2 |
- 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/llvm/Support/Mangler.h')
-rw-r--r-- | include/llvm/Support/Mangler.h | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/include/llvm/Support/Mangler.h b/include/llvm/Support/Mangler.h index 0a7b33a..94f0adb 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 |