Fix one more naked asm output problem for mingw32 and remove some

duplicate code
This commit is contained in:
Kelly Wilson
2009-03-30 18:22:30 -06:00
parent aae3d56e32
commit e2d6a94271

View File

@@ -167,30 +167,13 @@ void DtoDefineNakedFunction(FuncDeclaration* fd)
asmstr << mangle << ":" << std::endl;
}
/*
else
{
const char* linkage = "globl";
std::string section = "text";
if (DtoIsTemplateInstance(fd))
{
linkage = "weak";
tmpstr << "section\t.gnu.linkonce.t." << mangle << ",\"ax\",@progbits";
section = tmpstr.str();
}
asmstr << "\t." << section << std::endl;
asmstr << "\t.align\t16" << std::endl;
asmstr << "\t." << linkage << "\t" << mangle << std::endl;
asmstr << "\t.type\t" << mangle << ",@function" << std::endl;
asmstr << mangle << ":" << std::endl;
}*/
// emit body
fd->fbody->toNakedIR(gIR);
// emit size after body
// llvm does this on linux, but not on osx
if (global.params.os != OSMacOSX)
// llvm does this on linux, but not on osx or Win
if (global.params.os != OSMacOSX && global.params.os != OSWindows)
{
asmstr << "\t.size\t" << mangle << ", .-" << mangle << std::endl << std::endl;
}