[m-rev.] trivial diff: fix abort for --dump-mlds all --grade il

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Jul 13 18:25:30 AEST 2003


Estimated hours taken: 0.25
Branches: main

compiler/mlds_to_c.m:
	Don't abort if a `foreign_import' is encountered.
	Those won't happen when generating C code, but
	they may occur when compiling in IL grade and
	dumping the MLDS.

Workspace: /home/ceres/fjh/mercury
Index: compiler/mlds_to_c.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_c.m,v
retrieving revision 1.150
diff -u -d -r1.150 mlds_to_c.m
--- compiler/mlds_to_c.m	3 Jul 2003 12:10:48 -0000	1.150
+++ compiler/mlds_to_c.m	8 Jul 2003 06:58:32 -0000
@@ -216,8 +216,13 @@
 			ModuleName = ModuleName0
 		)
 	;
-		Import = foreign_import(_),
-		unexpected(this_file, "foreign import in C backend")
+		Import = foreign_import(ForeignImport),
+		% This case shouldn't happen when compiling to C,
+		% but we need to handle it for MLDS dumps when
+		% compiling to IL.
+		ForeignImport = il_assembly_name(ImportName),
+		ModuleName = mlds_module_name_to_sym_name(ImportName),
+		HeaderExt = ".dll"
 	},
 
 	module_name_to_search_file_name(ModuleName, HeaderExt, HeaderFile),

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list