[llvm-commits] CVS: llvm/lib/AsmParser/Lexer.l Lexer.l.cvs llvmAsmParser.y llvmAsmParser.y.cvs
Anton Korobeynikov
asl at math.spbu.ru
Sun Jan 28 05:32:19 PST 2007
Changes in directory llvm/lib/AsmParser:
Lexer.l updated: 1.96 -> 1.97
Lexer.l.cvs updated: 1.23 -> 1.24
llvmAsmParser.y updated: 1.313 -> 1.314
llvmAsmParser.y.cvs updated: 1.59 -> 1.60
---
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: (+16 -14)
Lexer.l | 3 ++-
Lexer.l.cvs | 3 ++-
llvmAsmParser.y | 12 ++++++------
llvmAsmParser.y.cvs | 12 ++++++------
4 files changed, 16 insertions(+), 14 deletions(-)
Index: llvm/lib/AsmParser/Lexer.l
diff -u llvm/lib/AsmParser/Lexer.l:1.96 llvm/lib/AsmParser/Lexer.l:1.97
--- llvm/lib/AsmParser/Lexer.l:1.96 Fri Jan 26 02:04:51 2007
+++ llvm/lib/AsmParser/Lexer.l Sun Jan 28 07:31:35 2007
@@ -227,7 +227,6 @@
cc { return CC_TOK; }
ccc { return CCC_TOK; }
-csretcc { return CSRETCC_TOK; }
fastcc { return FASTCC_TOK; }
coldcc { return COLDCC_TOK; }
x86_stdcallcc { return X86_STDCALLCC_TOK; }
@@ -287,6 +286,8 @@
trunc { RET_TOK(CastOpVal, Trunc, TRUNC); }
zext { RET_TOK(CastOpVal, ZExt, ZEXT); }
sext { RET_TOK(CastOpVal, SExt, SEXT); }
+inreg { return INREG; }
+sret { return SRET; }
fptrunc { RET_TOK(CastOpVal, FPTrunc, FPTRUNC); }
fpext { RET_TOK(CastOpVal, FPExt, FPEXT); }
uitofp { RET_TOK(CastOpVal, UIToFP, UITOFP); }
Index: llvm/lib/AsmParser/Lexer.l.cvs
diff -u llvm/lib/AsmParser/Lexer.l.cvs:1.23 llvm/lib/AsmParser/Lexer.l.cvs:1.24
--- llvm/lib/AsmParser/Lexer.l.cvs:1.23 Fri Jan 26 02:05:27 2007
+++ llvm/lib/AsmParser/Lexer.l.cvs Sun Jan 28 07:31:35 2007
@@ -227,7 +227,6 @@
cc { return CC_TOK; }
ccc { return CCC_TOK; }
-csretcc { return CSRETCC_TOK; }
fastcc { return FASTCC_TOK; }
coldcc { return COLDCC_TOK; }
x86_stdcallcc { return X86_STDCALLCC_TOK; }
@@ -287,6 +286,8 @@
trunc { RET_TOK(CastOpVal, Trunc, TRUNC); }
zext { RET_TOK(CastOpVal, ZExt, ZEXT); }
sext { RET_TOK(CastOpVal, SExt, SEXT); }
+inreg { return INREG; }
+sret { return SRET; }
fptrunc { RET_TOK(CastOpVal, FPTrunc, FPTRUNC); }
fpext { RET_TOK(CastOpVal, FPExt, FPEXT); }
uitofp { RET_TOK(CastOpVal, UIToFP, UITOFP); }
Index: llvm/lib/AsmParser/llvmAsmParser.y
diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.313 llvm/lib/AsmParser/llvmAsmParser.y:1.314
--- llvm/lib/AsmParser/llvmAsmParser.y:1.313 Fri Jan 26 02:04:51 2007
+++ llvm/lib/AsmParser/llvmAsmParser.y Sun Jan 28 07:31:35 2007
@@ -984,8 +984,7 @@
%token DLLIMPORT DLLEXPORT EXTERN_WEAK
%token OPAQUE EXTERNAL TARGET TRIPLE ALIGN
%token DEPLIBS CALL TAIL ASM_TOK MODULE SIDEEFFECT
-%token CC_TOK CCC_TOK CSRETCC_TOK FASTCC_TOK COLDCC_TOK
-%token X86_STDCALLCC_TOK X86_FASTCALLCC_TOK
+%token CC_TOK CCC_TOK FASTCC_TOK COLDCC_TOK X86_STDCALLCC_TOK X86_FASTCALLCC_TOK
%token DATALAYOUT
%type <UIntVal> OptCallingConv
%type <ParamAttrs> OptParamAttrs ParamAttr
@@ -1017,7 +1016,7 @@
%token <OtherOpVal> EXTRACTELEMENT INSERTELEMENT SHUFFLEVECTOR
// Function Attributes
-%token NORETURN
+%token NORETURN INREG SRET
// Visibility Styles
%token DEFAULT HIDDEN
@@ -1119,7 +1118,6 @@
OptCallingConv : /*empty*/ { $$ = CallingConv::C; } |
CCC_TOK { $$ = CallingConv::C; } |
- CSRETCC_TOK { $$ = CallingConv::CSRet; } |
FASTCC_TOK { $$ = CallingConv::Fast; } |
COLDCC_TOK { $$ = CallingConv::Cold; } |
X86_STDCALLCC_TOK { $$ = CallingConv::X86_StdCall; } |
@@ -1131,8 +1129,10 @@
CHECK_FOR_ERROR
};
-ParamAttr : ZEXT { $$ = FunctionType::ZExtAttribute; }
- | SEXT { $$ = FunctionType::SExtAttribute; }
+ParamAttr : ZEXT { $$ = FunctionType::ZExtAttribute; }
+ | SEXT { $$ = FunctionType::SExtAttribute; }
+ | INREG { $$ = FunctionType::InRegAttribute; }
+ | SRET { $$ = FunctionType::StructRetAttribute; }
;
OptParamAttrs : /* empty */ { $$ = FunctionType::NoAttributeSet; }
Index: llvm/lib/AsmParser/llvmAsmParser.y.cvs
diff -u llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.59 llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.60
--- llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.59 Fri Jan 26 02:05:27 2007
+++ llvm/lib/AsmParser/llvmAsmParser.y.cvs Sun Jan 28 07:31:35 2007
@@ -984,8 +984,7 @@
%token DLLIMPORT DLLEXPORT EXTERN_WEAK
%token OPAQUE EXTERNAL TARGET TRIPLE ALIGN
%token DEPLIBS CALL TAIL ASM_TOK MODULE SIDEEFFECT
-%token CC_TOK CCC_TOK CSRETCC_TOK FASTCC_TOK COLDCC_TOK
-%token X86_STDCALLCC_TOK X86_FASTCALLCC_TOK
+%token CC_TOK CCC_TOK FASTCC_TOK COLDCC_TOK X86_STDCALLCC_TOK X86_FASTCALLCC_TOK
%token DATALAYOUT
%type <UIntVal> OptCallingConv
%type <ParamAttrs> OptParamAttrs ParamAttr
@@ -1017,7 +1016,7 @@
%token <OtherOpVal> EXTRACTELEMENT INSERTELEMENT SHUFFLEVECTOR
// Function Attributes
-%token NORETURN
+%token NORETURN INREG SRET
// Visibility Styles
%token DEFAULT HIDDEN
@@ -1119,7 +1118,6 @@
OptCallingConv : /*empty*/ { $$ = CallingConv::C; } |
CCC_TOK { $$ = CallingConv::C; } |
- CSRETCC_TOK { $$ = CallingConv::CSRet; } |
FASTCC_TOK { $$ = CallingConv::Fast; } |
COLDCC_TOK { $$ = CallingConv::Cold; } |
X86_STDCALLCC_TOK { $$ = CallingConv::X86_StdCall; } |
@@ -1131,8 +1129,10 @@
CHECK_FOR_ERROR
};
-ParamAttr : ZEXT { $$ = FunctionType::ZExtAttribute; }
- | SEXT { $$ = FunctionType::SExtAttribute; }
+ParamAttr : ZEXT { $$ = FunctionType::ZExtAttribute; }
+ | SEXT { $$ = FunctionType::SExtAttribute; }
+ | INREG { $$ = FunctionType::InRegAttribute; }
+ | SRET { $$ = FunctionType::StructRetAttribute; }
;
OptParamAttrs : /* empty */ { $$ = FunctionType::NoAttributeSet; }
More information about the llvm-commits
mailing list