aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-04-09 21:49:15 +0000
committerBill Wendling <isanbard@gmail.com>2009-04-09 21:49:15 +0000
commit972bbac789d1ca00c39b258a6262286a3551da13 (patch)
treee6be51ec40e2e494035b7124ec15767c2d04d6cb /lib
parentb396992f68711e473d0cae2ac9c04569f20147b4 (diff)
downloadexternal_llvm-972bbac789d1ca00c39b258a6262286a3551da13.zip
external_llvm-972bbac789d1ca00c39b258a6262286a3551da13.tar.gz
external_llvm-972bbac789d1ca00c39b258a6262286a3551da13.tar.bz2
Use a StringMap instead of std::map for storing std::string->DIE* maps. This
gives a micro speedup in the Dwarf writer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68728 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfWriter.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
index b96babf..5a721ac 100644
--- a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
@@ -727,7 +727,7 @@ class CompileUnit {
/// Globals - A map of globally visible named entities for this unit.
///
- std::map<std::string, DIE *> Globals;
+ StringMap<DIE*> Globals;
/// DiesSet - Used to uniquely define dies within the compile unit.
///
@@ -745,7 +745,7 @@ public:
// Accessors.
unsigned getID() const { return ID; }
DIE* getDie() const { return Die; }
- std::map<std::string, DIE *> &getGlobals() { return Globals; }
+ StringMap<DIE*> &getGlobals() { return Globals; }
/// hasContent - Return true if this compile unit has something to write out.
///
@@ -2103,8 +2103,8 @@ private:
void ConstructDefaultDbgScope(MachineFunction *MF) {
const char *FnName = MF->getFunction()->getNameStart();
if (MainCU) {
- std::map<std::string, DIE*> &Globals = MainCU->getGlobals();
- std::map<std::string, DIE*>::iterator GI = Globals.find(FnName);
+ StringMap<DIE*> &Globals = MainCU->getGlobals();
+ StringMap<DIE*>::iterator GI = Globals.find(FnName);
if (GI != Globals.end()) {
DIE *SPDie = GI->second;
@@ -2121,8 +2121,8 @@ private:
} else {
for (unsigned i = 0, e = CompileUnits.size(); i != e; ++i) {
CompileUnit *Unit = CompileUnits[i];
- std::map<std::string, DIE*> &Globals = Unit->getGlobals();
- std::map<std::string, DIE*>::iterator GI = Globals.find(FnName);
+ StringMap<DIE*> &Globals = Unit->getGlobals();
+ StringMap<DIE*>::iterator GI = Globals.find(FnName);
if (GI != Globals.end()) {
DIE *SPDie = GI->second;
@@ -2663,10 +2663,10 @@ private:
true);
Asm->EOL("Compilation Unit Length");
- std::map<std::string, DIE *> &Globals = Unit->getGlobals();
- for (std::map<std::string, DIE *>::iterator GI = Globals.begin(),
- GE = Globals.end(); GI != GE; ++GI) {
- const std::string &Name = GI->first;
+ StringMap<DIE*> &Globals = Unit->getGlobals();
+ for (StringMap<DIE*>::iterator
+ GI = Globals.begin(), GE = Globals.end(); GI != GE; ++GI) {
+ const std::string &Name = GI->first();
DIE * Entity = GI->second;
Asm->EmitInt32(Entity->getOffset()); Asm->EOL("DIE offset");