diff options
author | gingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7> | 2006-07-10 21:00:41 +0000 |
---|---|---|
committer | gingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7> | 2006-07-10 21:00:41 +0000 |
commit | 3841c37a946481815c89928ccd15b71b608aa526 (patch) | |
tree | ed57a888c7e291c0ac2b26aa717fff38392bd43f /translate | |
parent | 06c89bf159a88b4339295b6007ff40bee14dd618 (diff) | |
download | ghdl-3841c37a946481815c89928ccd15b71b608aa526.tar.gz ghdl-3841c37a946481815c89928ccd15b71b608aa526.tar.bz2 ghdl-3841c37a946481815c89928ccd15b71b608aa526.zip |
updated for 0.24
Diffstat (limited to 'translate')
-rw-r--r-- | translate/gcc/Make-lang.in | 7 | ||||
-rwxr-xr-x | translate/gcc/dist.sh | 13 | ||||
-rw-r--r-- | translate/gcc/lang-specs.h | 6 | ||||
-rwxr-xr-x | translate/mcode/dist.sh | 4 | ||||
-rw-r--r-- | translate/mcode/windows/ghdl.nsi | 60 | ||||
-rw-r--r-- | translate/translation.adb | 47 |
6 files changed, 110 insertions, 27 deletions
diff --git a/translate/gcc/Make-lang.in b/translate/gcc/Make-lang.in index cb7335c49..0c2cc0f1a 100644 --- a/translate/gcc/Make-lang.in +++ b/translate/gcc/Make-lang.in @@ -139,7 +139,12 @@ vhdl.install-info: ghdl.info install-ghdllib: $(MAKE) -f vhdl/Makefile $(FLAGS_TO_PASS) $(VHDL_FLAGS_TO_PASS) install-ghdllib -vhdl.install-man: +vhdl.install-man: $(DESTDIR)$(man1dir)/ghdl$(man1ext) + +$(DESTDIR)$(man1dir)/ghdl$(man1ext): $(srcdir)/vhdl/ghdl.1 + -rm -f $@ + -$(INSTALL_DATA) $< $@ + -chmod a-x $@ vhdl.uninstall: -$(RM) $(DESTDIR)$(bindir)/ghdl$(exeext) diff --git a/translate/gcc/dist.sh b/translate/gcc/dist.sh index e03e686ed..4b0554b2f 100755 --- a/translate/gcc/dist.sh +++ b/translate/gcc/dist.sh @@ -39,7 +39,7 @@ set -e # GCC version -GCCVERSION=4.1.0 +GCCVERSION=4.1.1 # Machine name used by GCC MACHINE=i686-pc-linux-gnu # Directory where GCC sources (and objects) stay. @@ -105,7 +105,7 @@ for i in $lfiles; do ln -sf $CWD/$i $VHDLDIR/$i; done for i in $cfiles; do ln -sf $CWD/../../$i $VHDLDIR/$i; done -ln -sf $CWD/../../doc/ghdl.texi $VHDLDIR/ghdl.texi +for i in ghdl.texi ghdl.1; do ln -sf $CWD/../../doc/$i $VHDLDIR/$i; done for i in $tfiles; do ln -sf $CWD/../$i $VHDLDIR/$i; done @@ -212,7 +212,7 @@ do_compile2 () do_tar_install () { tar -C $DESTDIR -jcvf $TARINSTALL \ - ./$PREFIX/bin/ghdl ./$PREFIX/info/ghdl.info \ + ./$PREFIX/bin/ghdl ./$PREFIX/info/ghdl.info ./$PREFIX/man/man1/ghdl.1 \ ./$GCCLIBDIR/vhdl \ ./$GCCLIBEXECDIR/ghdl1 } @@ -248,9 +248,12 @@ do_distclean_gcc () rm -f ${DESTDIR}${PREFIX}/info/gcc.info* rm -f ${DESTDIR}${PREFIX}/info/gccinstall.info* rm -f ${DESTDIR}${PREFIX}/info/gccint.info* - rm -f ${DESTDIR}${PREFIX}/lib/*.a ${DESTDIR}${PREFIX}/lib/*.so* + rm -f ${DESTDIR}${PREFIX}/lib/*.a + rm -f ${DESTDIR}${PREFIX}/lib/*.so* + rm -f ${DESTDIR}${PREFIX}/lib/*.la rm -rf ${DESTDIR}${PREFIX}/share - rm -rf ${DESTDIR}${PREFIX}/man + rm -rf ${DESTDIR}${PREFIX}/man/man7 + rm -rf ${DESTDIR}${PREFIX}/man/man1/{cpp,gcc,gcov}.1 rm -rf ${DESTDIR}${PREFIX}/include rm -f ${DESTDIR}${GCCLIBEXECDIR}/cc1 ${DESTDIR}${GCCLIBEXECDIR}/collect2 rm -f ${DESTDIR}${GCCLIBEXECDIR}/cpp0 ${DESTDIR}${GCCLIBEXECDIR}/tradcpp0 diff --git a/translate/gcc/lang-specs.h b/translate/gcc/lang-specs.h index e8e79a2a8..050443521 100644 --- a/translate/gcc/lang-specs.h +++ b/translate/gcc/lang-specs.h @@ -22,7 +22,7 @@ Boston, MA 02111-1307, USA. */ /* This is the contribution to the `default_compilers' array in gcc.c for GHDL. */ - {".vhd", "@vhdl", 0}, - {".vhdl", "@vhdl", 0}, + {".vhd", "@vhdl", 0, 0, 0}, + {".vhdl", "@vhdl", 0, 0, 0}, {"@vhdl", - "ghdl1 %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}", 0}, + "ghdl1 %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}", 0, 0, 0}, diff --git a/translate/mcode/dist.sh b/translate/mcode/dist.sh index e28bec6c8..132ba0b59 100755 --- a/translate/mcode/dist.sh +++ b/translate/mcode/dist.sh @@ -192,6 +192,8 @@ done for i in $windows_files; do ln -sf $CWD/windows/$i $distdir/windows/$i done + echo "!define VERSION \"$VERSION\"" > $distdir/windows/version.nsi + ln -sf $CWD/winbuild.bat $distdir/winbuild.bat @@ -439,7 +441,7 @@ EOF } if [ $# -eq 0 ]; then - do_Makefile; + do_zip; else for i ; do case $i in diff --git a/translate/mcode/windows/ghdl.nsi b/translate/mcode/windows/ghdl.nsi index ec186ef32..4aeab9c8d 100644 --- a/translate/mcode/windows/ghdl.nsi +++ b/translate/mcode/windows/ghdl.nsi @@ -5,19 +5,20 @@ ; Check if administrator
; uninstall support
; TODO:
-; * Add in PATH
; * Add version
; * Check if GHDL is already installed (and uninstall before)
-; * Check Windows version
+; * Doc
; * Allow user install
;--------------------------------
+!include version.nsi
+;--------------------------------
; The name of the installer
Name "Ghdl"
; The file to write
-OutFile "ghdl-install.exe"
+OutFile "ghdl-installer-${VERSION}.exe"
SetDateSave on
@@ -34,6 +35,7 @@ LicenseData ..\COPYING ;--------------------------------
; Pages
+
Page license
Page components
Page directory
@@ -58,6 +60,48 @@ nt_ok: Quit
Admin:
+
+ ;;; Check if already installed.
+ ReadRegStr $0 HKLM "Software\Ghdl" "Install_Dir"
+ IfErrors not_installed
+ ReadRegStr $0 HKLM "Software\Ghdl" "Version"
+ IfErrors unknown_prev_version
+ Goto known_version
+unknown_prev_version:
+ StrCpy $0 "(unknown)"
+known_version:
+ MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "You already have GHDL version $0 installed. Deinstall ?" IDCANCEL install_abort IDOK deinstall
+install_abort:
+ Abort "Installation aborted"
+deinstall:
+ ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ghdl" "UninstallString"
+ IfErrors deinstall_failed
+
+ ; First version of the GHDL installer adds quotes
+ StrCpy $1 $0 1
+ StrCmp $1 '"' 0 str_ok
+ StrCpy $1 $0 "" 1
+ StrCpy $0 $1 -1
+str_ok:
+
+ ; Read install dir
+ ReadRegStr $1 HKLM "Software\Ghdl" "Install_Dir"
+ IfErrors deinstall_failed
+
+; MessageBox MB_OK 'copy $0 to $TEMP'
+
+ ClearErrors
+; MessageBox MB_OK 'copy $0 to $TEMP'
+ CopyFiles $0 $TEMP
+ IfErrors deinstall_failed
+ ExecWait '"$TEMP\uninst-ghdl.exe" /S _?=$1'
+ IfErrors deinstall_failed
+ Delete "$TEMP\uninst-ghdl.exe"
+ Return
+deinstall_failed:
+ Delete $TEMP\uninst-ghdl.exe
+ MessageBox MB_YESNO|MB_ICONSTOP "Can't deinstall GHDL: de-installer not found or failed. Continue installation ?" IDNO install_abort
+not_installed:
Return
FunctionEnd
@@ -76,11 +120,13 @@ Section "Ghdl Compiler (required)" File /oname=COPYING.txt ..\COPYING
; Write the installation path into the registry
- WriteRegStr HKLM "Software\Ghdl" "Install_Dir" "$INSTDIR"
+ WriteRegStr HKLM "Software\Ghdl" "Install_Dir" $INSTDIR
+ ; Write te version
+ WriteRegStr HKLM "Software\Ghdl" "Version" ${VERSION}
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ghdl" "DisplayName" "Ghdl"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ghdl" "UninstallString" '"$INSTDIR\uninst-ghdl.exe"'
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ghdl" "UninstallString" $INSTDIR\uninst-ghdl.exe
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ghdl" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ghdl" "NoRepair" 1
WriteUninstaller $INSTDIR\uninst-ghdl.exe"
@@ -102,6 +148,10 @@ Section "Synopsys libraries (Recommanded)" File /r ..\lib\v93\synopsys
SectionEnd
+Section "Documentation (Recommanded)"
+ File ghdl.htm
+SectionEnd
+
Section "Add in PATH (Recommanded)"
WriteRegDWORD HKLM "Software\Ghdl" "PathSet" 1
Push $INSTDIR\Bin
diff --git a/translate/translation.adb b/translate/translation.adb index 330f4a6ce..ff38401f0 100644 --- a/translate/translation.adb +++ b/translate/translation.adb @@ -961,8 +961,8 @@ package body Translation is range Type_Mode_B2 .. Type_Mode_Acc; -- These parameters are passed by copy, ie a copy of the object is created - -- and the reference of the copy is passed. If the object will not be - -- modified by the subprogram, the object can be passed by reference. + -- and the reference of the copy is passed. If the object is not + -- modified by the subprogram, the object could be passed by reference. subtype Type_Mode_By_Copy is Type_Mode_Type range Type_Mode_Fat_Acc .. Type_Mode_Fat_Acc; @@ -4833,6 +4833,31 @@ package body Translation is Push_Local_Factory; Chap2.Save_Subprg_Instance (Subprg_Instances); + -- Init out parameter passed by value/copy. + declare + Inter : Iir; + Inter_Type : Iir; + Type_Info : Type_Info_Acc; + begin + Inter := Get_Interface_Declaration_Chain (Spec); + while Inter /= Null_Iir loop + if Get_Kind (Inter) = Iir_Kind_Variable_Interface_Declaration + and then Get_Mode (Inter) = Iir_Out_Mode + then + Inter_Type := Get_Type (Inter); + Type_Info := Get_Info (Inter_Type); + if (Type_Info.Type_Mode in Type_Mode_By_Value + or Type_Info.Type_Mode in Type_Mode_By_Copy) + and then Type_Info.Type_Mode /= Type_Mode_File + then + Chap4.Init_Object + (Chap6.Translate_Name (Inter), Inter_Type); + end if; + end if; + Inter := Get_Chain (Inter); + end loop; + end; + Chap4.Translate_Declaration_Chain (Subprg); Rtis.Generate_Subprogram_Body (Subprg); Chap4.Translate_Declaration_Chain_Subprograms (Subprg, Null_Iir); @@ -5057,14 +5082,16 @@ package body Translation is return; end if; + Pkg := Get_Package (Decl); + Restore_Local_Identifier (Get_Info (Pkg).Package_Local_Id); + Chap4.Translate_Declaration_Chain (Decl); + if Flag_Rti then Rtis.Generate_Unit (Decl); end if; - Pkg := Get_Package (Decl); - Restore_Local_Identifier (Get_Info (Pkg).Package_Local_Id); - Chap4.Translate_Declaration_Chain (Decl); Chap4.Translate_Declaration_Chain_Subprograms (Decl, Null_Iir); + Elab_Package_Body (Pkg, Decl); end Translate_Package_Body; @@ -19123,12 +19150,8 @@ package body Translation is Params (Pos) := Stabilize (Param); if In_Conv /= Null_Iir or else Get_Mode (Formal) = Iir_Inout_Mode - -- or else Out_Conv = Null_Iir then - -- Arguments may be assigned if there is an in conversion, - -- or no out conversion. - -- We try to assign even OUT argument, to avoid - -- uninitialized values. + -- Arguments may be assigned if there is an in conversion. Ptr := New_Selected_Element (New_Obj (Res), Formal_Info.Interface_Field); Param := Lv2M (Ptr, Ftype_Info, Mode_Value); @@ -25442,8 +25465,8 @@ package body Translation is Generate_Declaration_Chain (Get_Declaration_Chain (Blk)); when Iir_Kind_Package_Body => Kind := Ghdl_Rtik_Package_Body; - -- FIXME: yes or not ? - --Generate_Declaration_Chain (Get_Declaration_Chain (Blk)); + -- Required at least for 'image + Generate_Declaration_Chain (Get_Declaration_Chain (Blk)); when Iir_Kind_Architecture_Declaration => Kind := Ghdl_Rtik_Architecture; Generate_Declaration_Chain (Get_Declaration_Chain (Blk)); |