[llvm-commits] [llvm] r46214 - /llvm/branches/release_22/lib/Target/X86/X86AsmPrinter.cpp
Tanya Lattner
tonic at nondot.org
Mon Jan 21 12:45:28 PST 2008
Author: tbrethou
Date: Mon Jan 21 14:45:28 2008
New Revision: 46214
URL: http://llvm.org/viewvc/llvm-project?rev=46214&view=rev
Log:
Merge from mainline.
Honour ByVal parameter attribute for name decoration.
Modified:
llvm/branches/release_22/lib/Target/X86/X86AsmPrinter.cpp
Modified: llvm/branches/release_22/lib/Target/X86/X86AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_22/lib/Target/X86/X86AsmPrinter.cpp?rev=46214&r1=46213&r2=46214&view=diff
==============================================================================
--- llvm/branches/release_22/lib/Target/X86/X86AsmPrinter.cpp (original)
+++ llvm/branches/release_22/lib/Target/X86/X86AsmPrinter.cpp Mon Jan 21 14:45:28 2008
@@ -25,6 +25,7 @@
#include "llvm/Constants.h"
#include "llvm/Module.h"
#include "llvm/DerivedTypes.h"
+#include "llvm/ParameterAttributes.h"
#include "llvm/Type.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/Support/Mangler.h"
@@ -48,11 +49,19 @@
return Info;
}
+ unsigned argNum = 1;
for (Function::const_arg_iterator AI = F->arg_begin(), AE = F->arg_end();
- AI != AE; ++AI)
+ AI != AE; ++AI, ++argNum) {
+ const Type* Ty = AI->getType();
+
+ // 'Dereference' type in case of byval parameter attribute
+ if (F->paramHasAttr(argNum, ParamAttr::ByVal))
+ Ty = cast<PointerType>(Ty)->getElementType();
+
// Size should be aligned to DWORD boundary
- Size += ((TD->getABITypeSize(AI->getType()) + 3)/4)*4;
-
+ Size += ((TD->getABITypeSize(Ty) + 3)/4)*4;
+ }
+
// We're not supporting tooooo huge arguments :)
Info.setBytesToPopOnReturn((unsigned int)Size);
return Info;
More information about the llvm-commits
mailing list