Commit 1276e713 authored by dsyme's avatar dsyme
Browse files

[project @ 2001-04-13 03:50:52 by dsyme]

More changes to the ILX code generator, currently only relevant to Don
parent ebf2c802
......@@ -4,15 +4,15 @@
.method public static void Main(class [mscorlib]System.String[]) {
.entrypoint
ldstr "LOG: loading main value\n" call void [mscorlib]System.Console::WriteLine(class [mscorlib]System.String)
ldsfld (func (unit) --> class [ilx std]'()') class Main::'Main_main'
ldsfld (func ( /* unit skipped */ ) --> class [ilx std]'()') class Main::'Main_main'
ldstr "LOG: evaluating main value\n"
call void [mscorlib]System.Console::WriteLine(class [mscorlib]System.String)
callfunc () --> (func (unit) --> class [ilx std]PrelBase_Z0T)
callfunc () --> (func ( /* unit skipped */ ) --> class [ilx std]PrelBase_Z0T)
ldstr "LOG: calling main value\n"
call void [mscorlib]System.Console::WriteLine(class [mscorlib]System.String)
ldunit
callfunc (void) --> class [ilx std]PrelBase_Z0T
// ldunit
callfunc ( /* unit skipped */ ) --> class [ilx std]PrelBase_Z0T
pop
......@@ -25,28 +25,22 @@
ldstr "LOG: calling critical finalizers manually in main()\n"
call void [mscorlib]System.Console::WriteLine(class [mscorlib]System.String)
ldsfld (func (thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handle__>>) --> (func (unit) --> class [ilx std]PrelBase_Z0T)) [ilx std]'PrelHandle'::'PrelHandle_stdHandleFinalizzer'
ldsfld thunk<(func (thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handlezuzu>>) --> (func (/* unit skipped */) --> class [ilx std]PrelBase_Z0T))> [ilx std]'PrelHandle'::'PrelHandle_stdHandleFinalizzer'
ldsfld thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handle__>> [ilx std]'PrelHandle'::'PrelHandle_stdin'
callfunc (thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handle__>>) --> (func (unit) --> class [ilx std]PrelBase_Z0T)
callfunc () --> (func (unit) --> class [ilx std]PrelBase_Z0T)
ldunit
callfunc (void) --> class [ilx std]PrelBase_Z0T
callfunc (thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handle__>>) --> (func ( /* unit skipped */ ) --> class [ilx std]PrelBase_Z0T)
callfunc ( /* unit skipped */ ) --> class [ilx std]PrelBase_Z0T
pop
ldsfld (func (thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handle__>>) --> (func (unit) --> class [ilx std]PrelBase_Z0T)) [ilx std]'PrelHandle'::'PrelHandle_stdHandleFinalizzer'
ldsfld thunk<(func (thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handlezuzu>>) --> (func (/* unit skipped */) --> class [ilx std]PrelBase_Z0T))> [ilx std]'PrelHandle'::'PrelHandle_stdHandleFinalizzer'
ldsfld thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handle__>> [ilx std]'PrelHandle'::'PrelHandle_stdout'
callfunc (thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handle__>>) --> (func (unit) --> class [ilx std]PrelBase_Z0T)
callfunc () --> (func (unit) --> class [ilx std]PrelBase_Z0T)
ldunit
callfunc (void) --> class [ilx std]PrelBase_Z0T
callfunc (thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handle__>>) --> (func ( /* unit skipped */ ) --> class [ilx std]PrelBase_Z0T)
callfunc ( /* unit skipped */ ) --> class [ilx std]PrelBase_Z0T
pop
ldsfld (func (thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handle__>>) --> (func (unit) --> class [ilx std]PrelBase_Z0T)) [ilx std]'PrelHandle'::'PrelHandle_stdHandleFinalizzer'
ldsfld thunk<(func (thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handlezuzu>>) --> (func (/* unit skipped */) --> class [ilx std]PrelBase_Z0T))> [ilx std]'PrelHandle'::'PrelHandle_stdHandleFinalizzer'
ldsfld thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handle__>> [ilx std]'PrelHandle'::'PrelHandle_stderr'
callfunc (thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handle__>>) --> (func (unit) --> class [ilx std]PrelBase_Z0T)
callfunc () --> (func (unit) --> class [ilx std]PrelBase_Z0T)
ldunit
callfunc (void) --> class [ilx std]PrelBase_Z0T
callfunc (thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handle__>>) --> (func ( /* unit skipped */ ) --> class [ilx std]PrelBase_Z0T)
callfunc ( /* unit skipped */ ) --> class [ilx std]PrelBase_Z0T
pop
ldstr "LOG: exit main()\n"
......
This diff is collapsed.
# These settings are if you use a visual studio build
CVS=cvs
TOP = ../../..
include $(TOP)/mk/boilerplate.mk
WAYS=$(GhcLibWays)
#-----------------------------------------------------------------------------
# Setting the standard variables
#
HC = $(GHC_INPLACE)
SRC_HC_OPTS+=-cpp -fglasgow-exts
#-----------------------------------------------------------------------------
#
CORENV_DEBUG=
CORENV_RETAIL=
LOCALRUN=./
ILX_FAST=x
ifeq ($(HOSTNAME),MSRC-HILDA)
CORENV_DEBUG="call devcorb2gen.bat fastchecked"
CORENV_RETAIL="call devcorb2gen.bat free"
LOCALRUN=.\\
ILX_FAST=
endif
ILX2IL_HOME=C:/devel/fcom/src
......@@ -23,56 +33,28 @@ ilx:
$(MAKE) -C $(ILX2IL_HOME) ilxdefault
prel: ilx
$(MAKE) -C ../../../lib/std std.Onot.mono-b2.dll
%.o: %.hs ../../ghc-4.11
../../ghc-inplace -o $@ -c $*.hs
$(MAKE) -C ../../../lib/std std.$(ilx_way).dll std.$(ilx_way).vlb
#========================================================================
# 1. From Haskell to ILX
%.Onot.ilx: %.hs ../../ghc-4.11
../../ghc-inplace -c -fglasgow-exts -o $@ -i../../../lib/std/.Onot -Onot -filx -fkeep-stg-types $*.hs -osuf Onot.ilx
%.O.ilx: %.hs ../../ghc-4.11
../../ghc-inplace -c -fglasgow-exts -o $@ -i../../../lib/std/.O -O -filx -fkeep-stg-types $*.hs -osuf O.ilx
../Entry.Onot.ilx: ../Entry.ilx
sed -e "s|ilx std|ilx std.Onot|g" ../Entry.ilx > $@.tmp
mv $@.tmp $@
../Entry.O.ilx: ../Entry.ilx
sed -e "s|ilx std|ilx std.O|g" ../Entry.ilx > $@.tmp
mv $@.tmp $@
# 1. From Haskell to ILX and then to IL - see build.mk
#========================================================================
# 2. From ILX to IL
#------------------------------------------------------------------------
# 2. From IL to .EXE
%.generic.il: $(ILX2IL) %.ilx
$(ILX2IL) --generic $(ILX2IL_FLAGS) -o $@.tmp $*.ilx
mv $@.tmp $@
%.$(ilx_way).exe : %.$(ilx_way).il ../Entry.$(ilx_way).il
cat $*.$(ilx_way).il ../Entry.$(ilx_way).il > $@.tmp
echo "call devcorb2gen free" > tmp.bat
echo "ilasm /DEBUG /QUIET /OUT=$@ $@.tmp" >> tmp.bat
cmd /c tmp.bat
%.mono.il: $(ILX2IL) %.ilx
$(ILX2IL) --mono $(ILX2IL_FLAGS) -o $@.tmp $*.ilx
../Entry.$(hs2ilx_suffix)_o: ../Entry.ilx
sed -e "s|ilx std|ilx std.$(hs2ilx_suffix)|g" ../Entry.ilx > $@.tmp
mv $@.tmp $@
#------------------------------------------------------------------------
# From IL to .EXE
%.generic.exe: %.generic.il ../Entry.Onot.generic.il
cat $*.generic.il ../Entry.Onot.generic.il > $@.tmp
echo "$(CORENV_RETAIL)" > $@.bat
echo "ilasm /exe /quiet /out=$(subst /,\\,$@.tmp) $(subst /,\\,$@.tmp)" >> $@.bat
time -p cmd /c $(subst /,\\,$@).bat
rm $@.bat
%.$(ilx_way).mvl: %.$(ilx_way).il
(ILVALID_HOME=c:\\devel\\fcom\\src\\ ILVALID_MSCORLIB=mscorlib.vlb $(ILVALID) c:\\devel\\fcom\\src\\bin\\msilxlib$(ilx2il_suffix).vlb $(TOP)/lib/std/std.$(ilx_way).vlb $<) 2>&1
%.mono.exe: %.mono.il ../Entry.Onot.mono.il
cat $*.mono.il ../Entry.Onot.mono.il > $@.tmp
echo "$(CORENV_RETAIL)" > $@.bat
echo "ilasm /exe /quiet /out=$(subst /,\\,$@.tmp) $(subst /,\\,$@.tmp)" >> $@.bat
time -p cmd /c $(subst /,\\,$@).bat
rm $@.bat
#------------------------------------------------------------------------
# From .HS to .EXE without using ILX
......@@ -94,16 +76,14 @@ HSstd_cbits.dll: ../../../lib/std/cbits/HSstd_cbits.dll
cp $< $@
%.debug.run: HSstd_cbits.dll %.exe
echo "$(CORENV_DEBUG)" > $@.bat
echo "set CORPATH=$(subst /,\\,$(ILX2IL_HOME))\\bin;\\GHC\\fptools\\ghc\\lib\\std;%CORPATH%" >> $@.bat
echo "$(LOCALRUN)$(subst /,\\,$*).debug.exe 2>&1" >> $@.bat
time -p cmd /c $(subst /,\\,$@).bat
rm $@.bat
%.retail.run: HSstd_cbits.dll %.exe
echo "$(CORENV_RETAIL)" > $@.bat
echo "set CORPATH=$(subst /,\\,$(ILX2IL_HOME))\\bin;\\GHC\\fptools\\ghc\\lib\\std;%CORPATH%" >> $@.bat
echo "$(LOCALRUN)$(subst /,\\,$*).retail.exe 2>&1" >> $@.bat
cp $(TOP)/lib/std/*.dll .
cp $(TOP)/lib/std/*.pdb .
cp $(TOP)/lib/std/*.il .
cp $(ILX2IL_HOME)/bin/*.dll .
cp $(ILX2IL_HOME)/bin/*.pdb .
cp $(ILX2IL_HOME)/bin/*.il .
echo "call devcorb2gen free" > $@.bat
echo "$(LOCALRUN)$(subst /,\\,$*).exe 2>&1" >> $@.bat
time -p cmd /c $(subst /,\\,$@).bat
rm $@.bat
......@@ -127,6 +107,7 @@ upd:
(cd ../..; $(CVS) up)
(cd ../../../lib/std; $(CVS) up)
.PRECIOUS: %.mono-nonstatic.il %.fullgeneric-nonstatic.il %.fullgeneric.il %.nolib.il %.Onot.ilx %.O.ilx %.nolib.ilx %-nonstatic.ilx %.exe %.debug.exe %.dll %.O.exe
.PHONY: %.run
include $(TOP)/mk/target.mk
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment