1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Consistency with native compilers

llvm-svn: 35532
This commit is contained in:
Anton Korobeynikov 2007-03-31 13:11:52 +00:00
parent 8f16f4bf9c
commit db09256c9f

View File

@ -24,6 +24,7 @@
#include "llvm/CallingConv.h" #include "llvm/CallingConv.h"
#include "llvm/Constants.h" #include "llvm/Constants.h"
#include "llvm/Module.h" #include "llvm/Module.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Type.h" #include "llvm/Type.h"
#include "llvm/Assembly/Writer.h" #include "llvm/Assembly/Writer.h"
#include "llvm/Support/Mangler.h" #include "llvm/Support/Mangler.h"
@ -84,16 +85,21 @@ void X86SharedAsmPrinter::decorateName(std::string &Name,
} else { } else {
Info = &info_item->second; Info = &info_item->second;
} }
const FunctionType *FT = F->getFunctionType();
switch (Info->getDecorationStyle()) { switch (Info->getDecorationStyle()) {
case None: case None:
break; break;
case StdCall: case StdCall:
if (!F->isVarArg()) // Variadic functions do not receive @0 suffix. // "Pure" variadic functions do not receive @0 suffix.
if (!FT->isVarArg() || (FT->getNumParams() == 0) ||
(FT->getNumParams() == 1 && FT->isStructReturn()))
Name += '@' + utostr_32(Info->getBytesToPopOnReturn()); Name += '@' + utostr_32(Info->getBytesToPopOnReturn());
break; break;
case FastCall: case FastCall:
if (!F->isVarArg()) // Variadic functions do not receive @0 suffix. // "Pure" variadic functions do not receive @0 suffix.
if (!FT->isVarArg() || (FT->getNumParams() == 0) ||
(FT->getNumParams() == 1 && FT->isStructReturn()))
Name += '@' + utostr_32(Info->getBytesToPopOnReturn()); Name += '@' + utostr_32(Info->getBytesToPopOnReturn());
if (Name[0] == '_') { if (Name[0] == '_') {