[llvm-commits] [llvm] r52836 - in /llvm/trunk/lib/Target/X86: X86AsmPrinter.cpp X86AsmPrinter.h X86IntelAsmPrinter.cpp
Anton Korobeynikov
asl at math.spbu.ru
Fri Jun 27 14:22:50 PDT 2008
Author: asl
Date: Fri Jun 27 16:22:49 2008
New Revision: 52836
URL: http://llvm.org/viewvc/llvm-project?rev=52836&view=rev
Log:
Use StringSet instead of std::set<std::string>
Modified:
llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp
llvm/trunk/lib/Target/X86/X86AsmPrinter.h
llvm/trunk/lib/Target/X86/X86IntelAsmPrinter.cpp
Modified: llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp?rev=52836&r1=52835&r2=52836&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp Fri Jun 27 16:22:49 2008
@@ -368,32 +368,32 @@
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 @@
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 @@
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();
Modified: llvm/trunk/lib/Target/X86/X86AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86AsmPrinter.h?rev=52836&r1=52835&r2=52836&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86AsmPrinter.h (original)
+++ llvm/trunk/lib/Target/X86/X86AsmPrinter.h Fri Jun 27 16:22:49 2008
@@ -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 @@
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() &&
Modified: llvm/trunk/lib/Target/X86/X86IntelAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86IntelAsmPrinter.cpp?rev=52836&r1=52835&r2=52836&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86IntelAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86IntelAsmPrinter.cpp Fri Jun 27 16:22:49 2008
@@ -425,23 +425,23 @@
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("");
More information about the llvm-commits
mailing list