[m-rev.] diff: fix RTTI name mangling problem on IL backend

Peter Ross peter.ross at miscrit.be
Fri Feb 8 21:26:47 AEDT 2002


Hi,


===================================================================


Estimated hours taken: 6
Branches: main

Fix a bug where we were generating references to RTTI datastructures in
MC++ code when they were actually defined in the IL code.

compiler/mlds_to_il.m:
    The only handwritten RTTI datastructures are type_ctor_infos and
    pseudo_type_infos which refer to the handwritten RTTI.

Index: mlds_to_il.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_il.m,v
retrieving revision 1.100
diff -u -r1.100 mlds_to_il.m
--- mlds_to_il.m	6 Feb 2002 10:27:51 -0000	1.100
+++ mlds_to_il.m	8 Feb 2002 10:26:26 -0000
@@ -138,7 +138,7 @@
 :- import_module globals, options, passes_aux.
 :- import_module builtin_ops, c_util, modules, tree.
 :- import_module prog_data, prog_out, prog_util, llds_out.
-:- import_module rtti, type_util, code_model, foreign.
+:- import_module pseudo_type_info, rtti, type_util, code_model, foreign.
 
 :- import_module ilasm, il_peephole.
 :- import_module ml_util, ml_code_util, error_util.
@@ -3217,8 +3217,15 @@
 		SymName = qualified(qualified(unqualified("mercury"),
 			LibModuleName0), wrapper_class_name),
 		(
-			DataName = rtti(rtti_type_id(_, Name, Arity),
-				_RttiName),
+			DataName = rtti(RttiTypeId, RttiName),
+			RttiTypeId = rtti_type_id(_, Name, Arity),
+
+			% Only the type_ctor_infos for the following
+			% RTTI names are defined in MC++.
+			( RttiName = type_ctor_info
+			; RttiName = pseudo_type_info(PseudoTypeInfo),
+				PseudoTypeInfo = type_ctor_info(RttiTypeId)
+			),
 			( LibModuleName0 = "builtin",
 				( 
 				  Name = "int", Arity = 0 

--------------------------------------------------------------------------
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