Consistency with native compilers

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35532 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov 2007-03-31 13:11:52 +00:00
parent 577c7d9dca
commit ad7baee241

View File

@ -24,6 +24,7 @@
#include "llvm/CallingConv.h"
#include "llvm/Constants.h"
#include "llvm/Module.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Type.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/Support/Mangler.h"
@ -84,16 +85,21 @@ void X86SharedAsmPrinter::decorateName(std::string &Name,
} else {
Info = &info_item->second;
}
const FunctionType *FT = F->getFunctionType();
switch (Info->getDecorationStyle()) {
case None:
break;
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());
break;
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());
if (Name[0] == '_') {