mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
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:
parent
577c7d9dca
commit
ad7baee241
@ -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] == '_') {
|
||||
|
Loading…
Reference in New Issue
Block a user