[llvm-commits] CVS: llvm/lib/Target/X86/X86AsmPrinter.cpp
Anton Korobeynikov
asl at math.spbu.ru
Sat Mar 31 06:12:09 PDT 2007
Changes in directory llvm/lib/Target/X86:
X86AsmPrinter.cpp updated: 1.237 -> 1.238
---
Log message:
Consistency with native compilers
---
Diffs of the changes: (+9 -3)
X86AsmPrinter.cpp | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
Index: llvm/lib/Target/X86/X86AsmPrinter.cpp
diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.237 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.238
--- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.237 Thu Mar 8 02:25:26 2007
+++ llvm/lib/Target/X86/X86AsmPrinter.cpp Sat Mar 31 08:11:52 2007
@@ -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 @@
} 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] == '_') {
More information about the llvm-commits
mailing list