mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-20 19:42:54 +02:00
updated handling dllexport in X86AsmPrinter
changed dllexport code to use EmitBytes instead of EmitRawText, and changed the export option to use /EXPORT: instead of -export: on the windows platform llvm-svn: 103377
This commit is contained in:
parent
e9d4a38d5e
commit
7a7c1e206b
@ -598,14 +598,28 @@ void X86AsmPrinter::EmitEndOfAsmFile(Module &M) {
|
|||||||
// Output linker support code for dllexported globals on windows.
|
// Output linker support code for dllexported globals on windows.
|
||||||
if (!DLLExportedGlobals.empty() || !DLLExportedFns.empty()) {
|
if (!DLLExportedGlobals.empty() || !DLLExportedFns.empty()) {
|
||||||
OutStreamer.SwitchSection(TLOFCOFF.getDrectveSection());
|
OutStreamer.SwitchSection(TLOFCOFF.getDrectveSection());
|
||||||
for (unsigned i = 0, e = DLLExportedGlobals.size(); i != e; ++i)
|
SmallString<128> name;
|
||||||
OutStreamer.EmitRawText("\t.ascii \" -export:" +
|
for (unsigned i = 0, e = DLLExportedGlobals.size(); i != e; ++i) {
|
||||||
Twine(DLLExportedGlobals[i]->getName()) +
|
if (Subtarget->isTargetWindows())
|
||||||
",data\"");
|
name = " /EXPORT:";
|
||||||
|
else
|
||||||
|
name = " -export:";
|
||||||
|
name += DLLExportedGlobals[i]->getName();
|
||||||
|
if (Subtarget->isTargetWindows())
|
||||||
|
name += ",DATA";
|
||||||
|
else
|
||||||
|
name += ",data";
|
||||||
|
OutStreamer.EmitBytes(name, 0);
|
||||||
|
}
|
||||||
|
|
||||||
for (unsigned i = 0, e = DLLExportedFns.size(); i != e; ++i)
|
for (unsigned i = 0, e = DLLExportedFns.size(); i != e; ++i) {
|
||||||
OutStreamer.EmitRawText("\t.ascii \" -export:" +
|
if (Subtarget->isTargetWindows())
|
||||||
Twine(DLLExportedFns[i]->getName()) + "\"");
|
name = " /EXPORT:";
|
||||||
|
else
|
||||||
|
name = " -export:";
|
||||||
|
name += DLLExportedFns[i]->getName();
|
||||||
|
OutStreamer.EmitBytes(name, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user