فهرست منبع

Removed obsolete darwin calling convention flag

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@8330 8c9fc860-2736-0410-a75d-ab315db34111
negelef 6 سال پیش
والد
کامیت
e31dced224
6فایلهای تغییر یافته به همراه25 افزوده شده و 38 حذف شده
  1. 7 10
      source/Compiler.Mod
  2. 2 2
      source/FoxAMDBackend.Mod
  3. 2 2
      source/FoxIntermediateBackend.Mod
  4. 7 16
      source/FoxSemanticChecker.Mod
  5. 6 7
      source/FoxSyntaxTree.Mod
  6. 1 1
      source/FoxTextualSymbolFile.Mod

+ 7 - 10
source/Compiler.Mod

@@ -17,13 +17,12 @@ CONST
 	FindPC* = 5;
 	FindPC* = 5;
 	Warnings*=7;
 	Warnings*=7;
 	ForceModuleBodies*=8;
 	ForceModuleBodies*=8;
-	UseDarwinCCalls*=9;	(* use Darwin stack alignment for ext. C procedures *)	(*fld*)
-	SingleModule*=10;
-	Oberon07*=11;
-	ChangeCase*=12;
-	Cooperative*=13;
-	CellsAreObjects*=14;
-	UseLineNumbers*=15;
+	SingleModule*=9;
+	Oberon07*=10;
+	ChangeCase*=11;
+	Cooperative*=12;
+	CellsAreObjects*=13;
+	UseLineNumbers*=14;
 
 
 	DefaultBackend = "AMD";
 	DefaultBackend = "AMD";
 	DefaultFrontend = "Oberon";
 	DefaultFrontend = "Oberon";
@@ -177,7 +176,7 @@ TYPE
 				ELSE
 				ELSE
 					backendName := "";
 					backendName := "";
 				END;
 				END;
-				checker := SemanticChecker.NewChecker(diagnostics,Info IN flags,UseDarwinCCalls IN flags,Cooperative IN flags,system,options.symbolFile,importCache,backendName);
+				checker := SemanticChecker.NewChecker(diagnostics,Info IN flags,Cooperative IN flags,system,options.symbolFile,importCache,backendName);
 				checker.replacements := options.replacements;
 				checker.replacements := options.replacements;
 				checker.Module(module);
 				checker.Module(module);
 				IF checker.error THEN
 				IF checker.error THEN
@@ -300,7 +299,6 @@ TYPE
 		options.Add(0X, "symbolFile", Options.String);
 		options.Add(0X, "symbolFile", Options.String);
 		options.Add(0X, "objectFile", Options.String);
 		options.Add(0X, "objectFile", Options.String);
 		options.Add("w","warnings", Options.Flag);
 		options.Add("w","warnings", Options.Flag);
-		options.Add(0X,"darwinHost", Options.Flag);
 		options.Add(0X,"hardware", Options.String);
 		options.Add(0X,"hardware", Options.String);
 		options.Add(0X,"documentation", Options.String);
 		options.Add(0X,"documentation", Options.String);
 		options.Add("S","srcPath", Options.String);
 		options.Add("S","srcPath", Options.String);
@@ -416,7 +414,6 @@ TYPE
 			IF options.GetFlag("info") THEN INCL(compilerOptions.flags,Info) END;
 			IF options.GetFlag("info") THEN INCL(compilerOptions.flags,Info) END;
 			IF options.GetString("findPC",compilerOptions.findPC) THEN INCL(compilerOptions.flags,FindPC) END;
 			IF options.GetString("findPC",compilerOptions.findPC) THEN INCL(compilerOptions.flags,FindPC) END;
 			IF options.GetFlag("warnings") THEN INCL(compilerOptions.flags, Warnings) END;
 			IF options.GetFlag("warnings") THEN INCL(compilerOptions.flags, Warnings) END;
-			IF options.GetFlag("darwinHost") THEN INCL(compilerOptions.flags,UseDarwinCCalls) END;	(*fld*)
 			IF options.GetFlag("singleModule") THEN INCL(compilerOptions.flags,SingleModule) END;
 			IF options.GetFlag("singleModule") THEN INCL(compilerOptions.flags,SingleModule) END;
 			IF options.GetFlag("oberon07") THEN INCL(compilerOptions.flags, Oberon07) END;
 			IF options.GetFlag("oberon07") THEN INCL(compilerOptions.flags, Oberon07) END;
 			IF options.GetFlag("cooperative") THEN INCL(compilerOptions.flags, Cooperative) END;
 			IF options.GetFlag("cooperative") THEN INCL(compilerOptions.flags, Cooperative) END;

+ 2 - 2
source/FoxAMDBackend.Mod

@@ -3335,7 +3335,7 @@ TYPE
 			ELSE
 			ELSE
 				CASE callingConvention OF
 				CASE callingConvention OF
 					|SyntaxTree.WinAPICallingConvention:  RETURN 4;
 					|SyntaxTree.WinAPICallingConvention:  RETURN 4;
-					|SyntaxTree.CCallingConvention, SyntaxTree.DarwinCCallingConvention: RETURN 6; 
+					|SyntaxTree.CCallingConvention: RETURN 6; 
 				ELSE
 				ELSE
 					RETURN 0;
 					RETURN 0;
 				END;
 				END;
@@ -3378,7 +3378,7 @@ TYPE
 			IF type.form IN IntermediateCode.Integer THEN
 			IF type.form IN IntermediateCode.Integer THEN
 				CASE callingConvention OF
 				CASE callingConvention OF
 					|SyntaxTree.WinAPICallingConvention:  index := winAPIRegisters[index];
 					|SyntaxTree.WinAPICallingConvention:  index := winAPIRegisters[index];
-					|SyntaxTree.CCallingConvention, SyntaxTree.DarwinCCallingConvention: index := cRegisters[index]
+					|SyntaxTree.CCallingConvention: index := cRegisters[index]
 				END;
 				END;
 				RETURN HardwareIntegerRegister(RAX + index, type.sizeInBits)
 				RETURN HardwareIntegerRegister(RAX + index, type.sizeInBits)
 			ELSIF type.form = IntermediateCode.Float THEN
 			ELSIF type.form = IntermediateCode.Float THEN

+ 2 - 2
source/FoxIntermediateBackend.Mod

@@ -112,8 +112,8 @@ CONST
 		
 		
 		WarningDynamicLoading = FALSE;
 		WarningDynamicLoading = FALSE;
 		
 		
-		SysvABI = {SyntaxTree.CCallingConvention, SyntaxTree.DarwinCCallingConvention}; 
-		SysvABIorWINAPI = {SyntaxTree.CCallingConvention, SyntaxTree.DarwinCCallingConvention, SyntaxTree.WinAPICallingConvention}; 
+		SysvABI = {SyntaxTree.CCallingConvention}; 
+		SysvABIorWINAPI = {SyntaxTree.CCallingConvention, SyntaxTree.WinAPICallingConvention}; 
 		
 		
 	
 	
 TYPE
 TYPE

+ 7 - 16
source/FoxSemanticChecker.Mod

@@ -76,7 +76,6 @@ TYPE
 	VAR
 	VAR
 		module: SyntaxTree.Module;
 		module: SyntaxTree.Module;
 		diagnostics: Diagnostics.Diagnostics;
 		diagnostics: Diagnostics.Diagnostics;
-		useDarwinCCalls: BOOLEAN;
 		cooperative: BOOLEAN;
 		cooperative: BOOLEAN;
 		error-: BOOLEAN;
 		error-: BOOLEAN;
 		VerboseErrorMessage: BOOLEAN;
 		VerboseErrorMessage: BOOLEAN;
@@ -112,10 +111,9 @@ TYPE
 		cellsAreObjects: BOOLEAN;
 		cellsAreObjects: BOOLEAN;
 		variableAccessed: BOOLEAN;
 		variableAccessed: BOOLEAN;
 
 
-		PROCEDURE &InitChecker*(diagnostics: Diagnostics.Diagnostics; verboseErrorMessage,useDarwinCCalls,cooperative: BOOLEAN; system: Global.System; symbolFileFormat: Formats.SymbolFileFormat; VAR importCache: SyntaxTree.ModuleScope; CONST backend: ARRAY OF CHAR);
+		PROCEDURE &InitChecker*(diagnostics: Diagnostics.Diagnostics; verboseErrorMessage,cooperative: BOOLEAN; system: Global.System; symbolFileFormat: Formats.SymbolFileFormat; VAR importCache: SyntaxTree.ModuleScope; CONST backend: ARRAY OF CHAR);
 		BEGIN
 		BEGIN
 			SELF.diagnostics := diagnostics;
 			SELF.diagnostics := diagnostics;
-			SELF.useDarwinCCalls := useDarwinCCalls;
 			SELF.cooperative := cooperative;
 			SELF.cooperative := cooperative;
 			SELF.system := system;
 			SELF.system := system;
 			SELF.symbolFileFormat := symbolFileFormat;
 			SELF.symbolFileFormat := symbolFileFormat;
@@ -938,11 +936,7 @@ TYPE
 					procedureType.SetInterrupt(TRUE);
 					procedureType.SetInterrupt(TRUE);
 					procedureType.SetCallingConvention(SyntaxTree.InterruptCallingConvention)
 					procedureType.SetCallingConvention(SyntaxTree.InterruptCallingConvention)
 				ELSIF HasFlag(modifiers,Global.NameC,position) THEN
 				ELSIF HasFlag(modifiers,Global.NameC,position) THEN
-					IF useDarwinCCalls THEN	(*fld*)
-						procedureType.SetCallingConvention(SyntaxTree.DarwinCCallingConvention)
-					ELSE
-						procedureType.SetCallingConvention(SyntaxTree.CCallingConvention)
-					END
+					procedureType.SetCallingConvention(SyntaxTree.CCallingConvention)
 				ELSIF HasFlag(modifiers,Global.NamePlatformCC, position) THEN
 				ELSIF HasFlag(modifiers,Global.NamePlatformCC, position) THEN
 					IF system.platformCallingConvention = SyntaxTree.UndefinedCallingConvention THEN
 					IF system.platformCallingConvention = SyntaxTree.UndefinedCallingConvention THEN
 						Error(position, "undefined platform calling convention");
 						Error(position, "undefined platform calling convention");
@@ -6947,13 +6941,10 @@ TYPE
 				IF Trace THEN D.Str("undefined"); D.Ln; END;
 				IF Trace THEN D.Str("undefined"); D.Ln; END;
 				procedureType := procedure.type(SyntaxTree.ProcedureType);
 				procedureType := procedure.type(SyntaxTree.ProcedureType);
 				modifiers := procedureType.modifiers;
 				modifiers := procedureType.modifiers;
-				IF HasFlag(modifiers, Global.NameWinAPI,position) THEN procedureType.SetCallingConvention(SyntaxTree.WinAPICallingConvention)
+				IF HasFlag(modifiers, Global.NameWinAPI,position) THEN
+					procedureType.SetCallingConvention(SyntaxTree.WinAPICallingConvention)
 				ELSIF HasFlag(modifiers, Global.NameC,position) THEN
 				ELSIF HasFlag(modifiers, Global.NameC,position) THEN
-					IF useDarwinCCalls THEN	(*fld*)
-						procedureType.SetCallingConvention(SyntaxTree.DarwinCCallingConvention)
-					ELSE
-						procedureType.SetCallingConvention(SyntaxTree.CCallingConvention)
-					END
+					procedureType.SetCallingConvention(SyntaxTree.CCallingConvention)
 				END;
 				END;
 				IF HasFlag(modifiers, Global.NameInterrupt, position) THEN
 				IF HasFlag(modifiers, Global.NameInterrupt, position) THEN
 					procedureType.SetInterrupt(TRUE);
 					procedureType.SetInterrupt(TRUE);
@@ -10084,10 +10075,10 @@ TYPE
 	END EnterCase;
 	END EnterCase;
 
 
 	(** generate and return a new checker object, errors are entered into diagnostics **)
 	(** generate and return a new checker object, errors are entered into diagnostics **)
-	PROCEDURE NewChecker*(diagnostics: Diagnostics.Diagnostics; verboseErrorMessage,useDarwinCCalls,cooperative: BOOLEAN; system: Global.System; symbolFileFormat: Formats.SymbolFileFormat; VAR importCache: SyntaxTree.ModuleScope; CONST backend: ARRAY OF CHAR): Checker;
+	PROCEDURE NewChecker*(diagnostics: Diagnostics.Diagnostics; verboseErrorMessage,cooperative: BOOLEAN; system: Global.System; symbolFileFormat: Formats.SymbolFileFormat; VAR importCache: SyntaxTree.ModuleScope; CONST backend: ARRAY OF CHAR): Checker;
 	VAR checker: Checker;
 	VAR checker: Checker;
 	BEGIN
 	BEGIN
-		NEW(checker, diagnostics,verboseErrorMessage,useDarwinCCalls,cooperative,system,symbolFileFormat,importCache,backend);
+		NEW(checker, diagnostics,verboseErrorMessage,cooperative,system,symbolFileFormat,importCache,backend);
 		RETURN checker
 		RETURN checker
 	END NewChecker;
 	END NewChecker;
 
 

+ 6 - 7
source/FoxSyntaxTree.Mod

@@ -17,13 +17,12 @@ CONST
 		flag numbers have no meaning and are not used for object files etc., i.e. flag renumbering is possible without effect
 		flag numbers have no meaning and are not used for object files etc., i.e. flag renumbering is possible without effect
 	*)
 	*)
 	(** calling conventions *)
 	(** calling conventions *)
-	OberonCallingConvention* =0;
-	CCallingConvention* =1;
-	WinAPICallingConvention* =2;
-	DarwinCCallingConvention* =3;
-	InterruptCallingConvention* = 4;
-	PlatformCallingConvention*= 5;
-	UndefinedCallingConvention*=6;
+	OberonCallingConvention* = 0;
+	CCallingConvention* = 1;
+	WinAPICallingConvention* = 2;
+	InterruptCallingConvention* = 3;
+	PlatformCallingConvention* = 4;
+	UndefinedCallingConvention* = 5;
 
 
 	(** Access Flags *)
 	(** Access Flags *)
 	InternalRead* = 0;			(** can read symbol in same module *)
 	InternalRead* = 0;			(** can read symbol in same module *)

+ 1 - 1
source/FoxTextualSymbolFile.Mod

@@ -27,7 +27,7 @@ TYPE
 
 
 			IF (module # NIL) & ~(SyntaxTree.Resolved IN module.state) THEN
 			IF (module # NIL) & ~(SyntaxTree.Resolved IN module.state) THEN
 				(*! should rather be done by importer *)
 				(*! should rather be done by importer *)
-				checker := SemanticChecker.NewChecker(NIL,FALSE,FALSE,TRUE,system,SELF,importCache,"");
+				checker := SemanticChecker.NewChecker(NIL,FALSE,TRUE,system,SELF,importCache,"");
 				checker.Module(module); (* semantic check *)
 				checker.Module(module); (* semantic check *)
 				IF checker.error THEN module := NIL END;
 				IF checker.error THEN module := NIL END;
 			END;
 			END;