[m-rev.] diff: enable inlining of erlang foreign_procs

Peter Wang wangp at students.csse.unimelb.edu.au
Mon Jun 25 15:01:07 AEST 2007


Estimated hours taken: 0.1
Branches: main

compiler/inlining.m:
	Enable inlining of Erlang foreign_procs.

	Fix some comments which had foreign_code when it meant foreign_proc.

Index: compiler/inlining.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/inlining.m,v
retrieving revision 1.153
diff -u -r1.153 inlining.m
--- compiler/inlining.m	19 Jan 2007 07:04:15 -0000	1.153
+++ compiler/inlining.m	25 Jun 2007 05:00:19 -0000
@@ -970,7 +970,7 @@
         CalledGoal = hlds_goal(call_foreign_proc(ForeignAttributes,
             _, _, _, _, _, _), _)
     ->
-        % Only inline foreign_code if it is appropriate for the target
+        % Only inline a foreign_proc if it is appropriate for the target
         % language.
         (
             ForeignLanguage = get_foreign_language(ForeignAttributes)
@@ -978,8 +978,8 @@
             ok_to_inline_language(ForeignLanguage, Target)
         ),
 
-        % Don't inline foreign_code if it is has been marked with the attribute
-        % that requests the code not be duplicated.
+        % Don't inline a foreign_proc if it is has been marked with the
+        % attribute that requests the code not be duplicated.
         (
             MaybeMayDuplicate = get_may_duplicate(ForeignAttributes)
         =>
@@ -1004,7 +1004,7 @@
         pred_info_get_promised_purity(PredInfo, purity_impure)
     ).
 
-    % Succeed iff it is appropriate to inline `pragma foreign_code'
+    % Succeed iff it is appropriate to inline `pragma foreign_proc'
     % in the specified language for the given compilation_target.
     % Generally that will only be the case if the target directly
     % supports inline code in that language.
@@ -1013,6 +1013,7 @@
     is semidet.
 
 ok_to_inline_language(lang_c, target_c).
+ok_to_inline_language(lang_erlang, target_erlang).
 
 % ok_to_inline_language(il, il). %
 % XXX we need to fix the handling of parameter marshalling for inlined code
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list