Bläddra i källkod

* Add missing calling conventions

git-svn-id: trunk@45461 -
michael 5 år sedan
förälder
incheckning
b1e78f1e75

+ 8 - 2
packages/fcl-passrc/src/pastree.pp

@@ -115,7 +115,10 @@ type
     visStrictPrivate, visStrictProtected);
 
   TCallingConvention = (ccDefault,ccRegister,ccPascal,ccCDecl,ccStdCall,
-                        ccOldFPCCall,ccSafeCall,ccSysCall);
+                        ccOldFPCCall,ccSafeCall,ccSysCall,ccMWPascal,
+                        ccHardFloat,ccSysV_ABI_Default,ccSysV_ABI_CDecl,
+                        ccMS_ABI_Default,ccMS_ABI_CDecl,
+                        ccVectorCall);
   TProcTypeModifier = (ptmOfObject,ptmIsNested,ptmStatic,ptmVarargs,ptmReferenceTo);
   TProcTypeModifiers = set of TProcTypeModifier;
   TPackMode = (pmNone,pmPacked,pmBitPacked);
@@ -1733,7 +1736,10 @@ const
   cPasMemberHint : Array[TPasMemberHint] of string =
       ( 'deprecated', 'library', 'platform', 'experimental', 'unimplemented' );
   cCallingConventions : Array[TCallingConvention] of string =
-      ( '', 'Register','Pascal','CDecl','StdCall','OldFPCCall','SafeCall','SysCall');
+      ( '', 'Register','Pascal','CDecl','StdCall','OldFPCCall','SafeCall','SysCall','MWPascal',
+                        'HardFloat','SysV_ABI_Default','SysV_ABI_CDecl',
+                        'MS_ABI_Default','MS_ABI_CDecl',
+                        'VectorCall');
   ProcTypeModifiers : Array[TProcTypeModifier] of string =
       ('of Object', 'is nested','static','varargs','reference to');
 

+ 3 - 1
packages/fcl-passrc/src/pparser.pp

@@ -630,7 +630,9 @@ Function IsCallingConvention(S : String; out CC : TCallingConvention) : Boolean;
 
 Var
   CCNames : Array[TCallingConvention] of String
-         = ('','register','pascal','cdecl','stdcall','oldfpccall','safecall','syscall');
+         = ('','register','pascal','cdecl','stdcall','oldfpccall','safecall','syscall',
+           'mwpascal', 'hardfloat','sysv_abi_default','sysv_abi_cdecl',
+           'ms_abi_default','ms_abi_cdecl','vectorcall');
 Var
   C : TCallingConvention;
 

+ 50 - 0
packages/fcl-passrc/tests/tcprocfunc.pas

@@ -115,6 +115,13 @@ type
     Procedure TestFunctionStdCall;
     Procedure TestProcedureOldFPCCall;
     Procedure TestFunctionOldFPCCall;
+    procedure TestCallingConventionHardFloat;
+    procedure TestCallingConventionMS_ABI_CDecl;
+    procedure TestCallingConventionMS_ABI_Default;
+    procedure TestCallingConventionMWPascal;
+    procedure TestCallingConventionSysV_ABI_CDec;
+    procedure TestCallingConventionSysV_ABI_Default;
+    procedure TestCallingConventionVectorCall;
     Procedure TestProcedurePublic;
     Procedure TestProcedurePublicIdent;
     Procedure TestFunctionPublic;
@@ -775,6 +782,49 @@ begin
   AssertArrayArg(FuncType,0,'B',argConst,'');
 end;
 
+procedure TTestProcedureFunction.TestCallingConventionSysV_ABI_Default;
+begin
+  ParseProcedure('; SysV_ABI_Default');
+  AssertProc([],[],ccSysV_ABI_Default,0);
+end;
+
+procedure TTestProcedureFunction.TestCallingConventionSysV_ABI_CDec;
+begin
+  ParseProcedure('; SysV_ABI_CDecl');
+  AssertProc([],[],ccSysV_ABI_CDecl,0);
+end;
+
+procedure TTestProcedureFunction.TestCallingConventionMS_ABI_Default;
+begin
+  ParseProcedure('; MS_ABI_Default');
+  AssertProc([],[],ccMS_ABI_Default,0);
+end;
+
+procedure TTestProcedureFunction.TestCallingConventionMS_ABI_CDecl;
+begin
+  ParseProcedure('; MS_ABI_CDecl');
+  AssertProc([],[],ccMS_ABI_CDecl,0);
+end;
+
+procedure TTestProcedureFunction.TestCallingConventionVectorCall;
+begin
+  ParseProcedure('; VectorCall');
+  AssertProc([],[],ccVectorCall,0);
+end;
+
+procedure TTestProcedureFunction.TestCallingConventionHardFloat;
+begin
+  ParseProcedure('; HardFloat');
+  AssertProc([],[],ccHardFloat,0);
+end;
+
+procedure TTestProcedureFunction.TestCallingConventionMWPascal;
+
+begin
+  ParseProcedure('; mwpascal');
+  AssertProc([],[],ccMWPascal,0);
+end;
+
 procedure TTestProcedureFunction.TestProcedureCdecl;
 begin
   ParseProcedure('; cdecl');