Use StringSet instead of std::set<std::string>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52836 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov 2008-06-27 21:22:49 +00:00
parent d0ebbff8a3
commit 8573986f30
3 changed files with 25 additions and 26 deletions

View 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();

View File

@ -19,12 +19,11 @@
#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() &&

View 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("");