[llvm-commits] CVS: llvm/include/llvm/CallingConv.h DerivedTypes.h
Anton Korobeynikov
asl at math.spbu.ru
Sun Jan 28 05:32:18 PST 2007
Changes in directory llvm/include/llvm:
CallingConv.h updated: 1.5 -> 1.6
DerivedTypes.h updated: 1.81 -> 1.82
---
Log message:
Propagate changes from my local tree. This patch includes:
1. New parameter attribute called 'inreg'. It has meaning "place this
parameter in registers, if possible". This is some generalization of
gcc's regparm(n) attribute. It's currently used only in X86-32 backend.
2. Completely rewritten CC handling/lowering code inside X86 backend.
Merged stdcall + c CCs and fastcall + fast CC.
3. Dropped CSRET CC. We cannot add struct return variant for each
target-specific CC (e.g. stdcall + csretcc and so on).
4. Instead of CSRET CC introduced 'sret' parameter attribute. Setting in
on first attribute has meaning 'This is hidden pointer to structure
return. Handle it gently'.
5. Fixed small bug in llvm-extract + add new feature to
FunctionExtraction pass, which relinks all internal-linkaged callees
from deleted function to external linkage. This will allow further
linking everything together.
NOTEs: 1. Documentation will be updated soon.
2. llvm-upgrade should be improved to translate csret => sret.
Before this, there will be some unexpected test fails.
---
Diffs of the changes: (+7 -9)
CallingConv.h | 8 --------
DerivedTypes.h | 8 +++++++-
2 files changed, 7 insertions(+), 9 deletions(-)
Index: llvm/include/llvm/CallingConv.h
diff -u llvm/include/llvm/CallingConv.h:1.5 llvm/include/llvm/CallingConv.h:1.6
--- llvm/include/llvm/CallingConv.h:1.5 Sun Sep 17 15:25:45 2006
+++ llvm/include/llvm/CallingConv.h Sun Jan 28 07:31:35 2007
@@ -30,14 +30,6 @@
/// certain amounts of prototype mismatch.
C = 0,
- /// CSRet - C Struct Return calling convention. This convention requires
- /// that the function return void and take a pointer as the first argument
- /// of the struct. This is used by targets which need to distinguish
- /// between C functions returning a structure, and C functions taking a
- /// structure pointer as the first argument to the function.
- CSRet = 1,
-
-
// Generic LLVM calling conventions. None of these calling conventions
// support varargs calls, and all assume that the caller and callee
// prototype exactly match.
Index: llvm/include/llvm/DerivedTypes.h
diff -u llvm/include/llvm/DerivedTypes.h:1.81 llvm/include/llvm/DerivedTypes.h:1.82
--- llvm/include/llvm/DerivedTypes.h:1.81 Fri Jan 19 15:13:56 2007
+++ llvm/include/llvm/DerivedTypes.h Sun Jan 28 07:31:35 2007
@@ -134,7 +134,9 @@
NoAttributeSet = 0, ///< No attribute value has been set
ZExtAttribute = 1, ///< zero extended before/after call
SExtAttribute = 1 << 1, ///< sign extended before/after call
- NoReturnAttribute = 1 << 2 ///< mark the function as not returning
+ NoReturnAttribute = 1 << 2, ///< mark the function as not returning
+ InRegAttribute = 1 << 3, ///< force argument to be passed in register
+ StructRetAttribute= 1 << 4 ///< hidden pointer to structure to return
};
typedef std::vector<ParameterAttributes> ParamAttrsList;
private:
@@ -176,6 +178,10 @@
///
unsigned getNumParams() const { return unsigned(ContainedTys.size()-1); }
+ bool isStructReturn() const {
+ return (getNumParams() && paramHasAttr(1, StructRetAttribute));
+ }
+
/// The parameter attributes for the \p ith parameter are returned. The 0th
/// parameter refers to the return type of the function.
/// @returns The ParameterAttributes for the \p ith parameter.
More information about the llvm-commits
mailing list