Use StringSet instead of std::set<std::string>
authorAnton Korobeynikov <asl@math.spbu.ru>
Fri, 27 Jun 2008 21:22:49 +0000 (21:22 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Fri, 27 Jun 2008 21:22:49 +0000 (21:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52836 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86AsmPrinter.cpp
lib/Target/X86/X86AsmPrinter.h
lib/Target/X86/X86IntelAsmPrinter.cpp

index 9f3f76956dd41e357a716ca3a075d5bcfa5a7af2..409cb20d37c4330dbd3084d98512069889dc9a0e 100644 (file)
@@ -368,32 +368,32 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) {
     SwitchToDataSection(".section .drectve");
   }
 
-  for (std::set<std::string>::iterator i = DLLExportedGVs.begin(),
+  for (StringSet<>::iterator i = DLLExportedGVs.begin(),
          e = DLLExportedGVs.end();
          i != e; ++i) {
-    O << "\t.ascii \" -export:" << *i << ",data\"\n";
-  }    
+    O << "\t.ascii \" -export:" << i->getKeyData() << ",data\"\n";
+  }
 
   if (!DLLExportedFns.empty()) {
     SwitchToDataSection(".section .drectve");
   }
 
-  for (std::set<std::string>::iterator i = DLLExportedFns.begin(),
+  for (StringSet<>::iterator i = DLLExportedFns.begin(),
          e = DLLExportedFns.end();
          i != e; ++i) {
-    O << "\t.ascii \" -export:" << *i << "\"\n";
-  }    
+    O << "\t.ascii \" -export:" << i->getKeyData() << "\"\n";
+  }
 
   if (Subtarget->isTargetDarwin()) {
     SwitchToDataSection("");
 
     // Output stubs for dynamically-linked functions
     unsigned j = 1;
-    for (std::set<std::string>::iterator i = FnStubs.begin(), e = FnStubs.end();
+    for (StringSet<>::iterator i = FnStubs.begin(), e = FnStubs.end();
          i != e; ++i, ++j) {
       SwitchToDataSection("\t.section __IMPORT,__jump_table,symbol_stubs,"
                           "self_modifying_code+pure_instructions,5", 0);
-      std::string p = *i;
+      std::string p = i->getKeyData();
       printSuffixedName(p, "$stub");
       O << ":\n";
       O << "\t.indirect_symbol " << p << "\n";
@@ -416,9 +416,9 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) {
     if (!GVStubs.empty())
       SwitchToDataSection(
                     "\t.section __IMPORT,__pointers,non_lazy_symbol_pointers");
-    for (std::set<std::string>::iterator i = GVStubs.begin(), e = GVStubs.end();
+    for (StringSet<>::iterator i = GVStubs.begin(), e = GVStubs.end();
          i != e; ++i) {
-      std::string p = *i;
+      std::string p = i->getKeyData();
       printSuffixedName(p, "$non_lazy_ptr");
       O << ":\n";
       O << "\t.indirect_symbol " << p << "\n";
@@ -436,16 +436,16 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) {
     O << "\t.subsections_via_symbols\n";
   } else if (Subtarget->isTargetCygMing()) {
     // Emit type information for external functions
-    for (std::set<std::string>::iterator i = FnStubs.begin(), e = FnStubs.end();
+    for (StringSet<>::iterator i = FnStubs.begin(), e = FnStubs.end();
          i != e; ++i) {
-      O << "\t.def\t " << *i
+      O << "\t.def\t " << i->getKeyData()
         << ";\t.scl\t" << COFF::C_EXT
         << ";\t.type\t" << (COFF::DT_FCN << COFF::N_BTSHFT)
         << ";\t.endef\n";
     }
-    
+
     // Emit final debug information.
-    DW.EndModule();    
+    DW.EndModule();
   } else if (Subtarget->isTargetELF()) {
     // Emit final debug information.
     DW.EndModule();
index 6c47e0c27e8f940fd729757e318f2ce0e3fa1ab6..95e24605505fa431904e376fb2c345bb04a5080f 100644 (file)
 #include "X86.h"
 #include "X86MachineFunctionInfo.h"
 #include "X86TargetMachine.h"
+#include "llvm/ADT/StringSet.h"
 #include "llvm/CodeGen/AsmPrinter.h"
 #include "llvm/CodeGen/DwarfWriter.h"
 #include "llvm/CodeGen/MachineModuleInfo.h"
 #include "llvm/Support/Compiler.h"
-#include <set>
-
 
 namespace llvm {
 
@@ -70,10 +69,10 @@ struct VISIBILITY_HIDDEN X86SharedAsmPrinter : public AsmPrinter {
   const X86Subtarget *Subtarget;
 
   // Necessary for Darwin to print out the apprioriate types of linker stubs
-  std::set<std::string> FnStubs, GVStubs, LinkOnceStubs;
+  StringSet<> FnStubs, GVStubs, LinkOnceStubs;
 
   // Necessary for dllexport support
-  std::set<std::string> DLLExportedFns, DLLExportedGVs;
+  StringSet<> DLLExportedFns, DLLExportedGVs;
 
   inline static bool isScale(const MachineOperand &MO) {
     return MO.isImmediate() &&
index 09a40b8ee7faa30c65ec6536f74af2423d5c8a3a..842f9e4ba42d7322465e60032132f5d42a4750d6 100644 (file)
@@ -425,23 +425,23 @@ bool X86IntelAsmPrinter::doFinalization(Module &M) {
     O << "_drectve\t segment info alias('.drectve')\n";
   }
 
-  for (std::set<std::string>::iterator i = DLLExportedGVs.begin(),
+  for (StringSet<>::iterator i = DLLExportedGVs.begin(),
          e = DLLExportedGVs.end();
          i != e; ++i) {
-    O << "\t db ' /EXPORT:" << *i << ",data'\n";
-  }    
+    O << "\t db ' /EXPORT:" << i->getKeyData() << ",data'\n";
+  }
 
-  for (std::set<std::string>::iterator i = DLLExportedFns.begin(),
+  for (StringSet<>::iterator i = DLLExportedFns.begin(),
          e = DLLExportedFns.end();
          i != e; ++i) {
-    O << "\t db ' /EXPORT:" << *i << "'\n";
-  }    
+    O << "\t db ' /EXPORT:" << i->getKeyData() << "'\n";
+  }
 
   if (!DLLExportedGVs.empty() ||
       !DLLExportedFns.empty()) {
-    O << "_drectve\t ends\n";    
+    O << "_drectve\t ends\n";
   }
-  
+
   // Bypass X86SharedAsmPrinter::doFinalization().
   bool Result = AsmPrinter::doFinalization(M);
   SwitchToDataSection("");