~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

Viewing changes to lib/hipe/arm/hipe_arm_main.erl

  • Committer: Bazaar Package Importer
  • Author(s): Erlang Packagers, Sergei Golovan
  • Date: 2006-12-03 17:07:44 UTC
  • mfrom: (2.1.11 feisty)
  • Revision ID: james.westby@ubuntu.com-20061203170744-rghjwupacqlzs6kv
Tags: 1:11.b.2-4
[ Sergei Golovan ]
Fixed erlang-base and erlang-base-hipe prerm scripts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%% -*- erlang-indent-level: 2 -*-
 
2
%%% $Id$
 
3
 
 
4
-module(hipe_arm_main).
 
5
-export([rtl_to_arm/3]).
 
6
 
 
7
rtl_to_arm(MFA, RTL, Options) ->
 
8
  Defun1 = hipe_rtl_to_arm:translate(RTL),
 
9
  %% io:format("~w: after translate\n", [?MODULE]),
 
10
  %% hipe_arm_pp:pp(Defun1),
 
11
  Defun2 = hipe_arm_ra:ra(Defun1, Options),
 
12
  %% io:format("~w: after regalloc\n", [?MODULE]),
 
13
  %% hipe_arm_pp:pp(Defun2),
 
14
  Defun3 = hipe_arm_frame:frame(Defun2),
 
15
  %% io:format("~w: after frame\n", [?MODULE]),
 
16
  %% hipe_arm_pp:pp(Defun3),
 
17
  Defun4 = hipe_arm_finalise:finalise(Defun3),
 
18
  %% io:format("~w: after finalise\n", [?MODULE]),
 
19
  pp(Defun4, MFA, Options),
 
20
  {native, arm, {unprofiled, Defun4}}.
 
21
 
 
22
pp(Defun, MFA, Options) ->
 
23
  case proplists:get_value(pp_native, Options) of
 
24
    true ->
 
25
      hipe_arm_pp:pp(Defun);
 
26
    {only,Lst} when is_list(Lst) ->
 
27
      case lists:member(MFA,Lst) of
 
28
        true ->
 
29
          hipe_arm_pp:pp(Defun);
 
30
        false ->
 
31
          ok
 
32
      end;
 
33
    {only,MFA} ->
 
34
       hipe_arm_pp:pp(Defun);
 
35
    {file,FileName} ->
 
36
      {ok, File} = file:open(FileName, [write,append]),
 
37
      hipe_arm_pp:pp(File, Defun),
 
38
      file:close(File);
 
39
    _ ->
 
40
      []
 
41
  end.