Add D front-end, libphobos library, and D2 testsuite.
ChangeLog: * Makefile.def (target_modules): Add libphobos. (flags_to_pass): Add GDC, GDCFLAGS, GDC_FOR_TARGET and GDCFLAGS_FOR_TARGET. (dependencies): Make libphobos depend on libatomic, libbacktrace configure, and zlib configure. (language): Add language d. * Makefile.in: Rebuild. * Makefile.tpl (BUILD_EXPORTS): Add GDC and GDCFLAGS. (HOST_EXPORTS): Add GDC. (POSTSTAGE1_HOST_EXPORTS): Add GDC and GDC_FOR_BUILD. (BASE_TARGET_EXPORTS): Add GDC. (GDC_FOR_BUILD, GDC, GDCFLAGS): New variables. (GDC_FOR_TARGET, GDC_FLAGS_FOR_TARGET): New variables. (EXTRA_HOST_FLAGS): Add GDC. (STAGE1_FLAGS_TO_PASS): Add GDC. (EXTRA_TARGET_FLAGS): Add GDC and GDCFLAGS. * config-ml.in: Treat GDC and GDCFLAGS like other compiler/flag environment variables. * configure: Rebuild. * configure.ac: Add target-libphobos to target_libraries. Set and substitute GDC_FOR_BUILD and GDC_FOR_TARGET. config/ChangeLog: * multi.m4: Set GDC. gcc/ChangeLog: * Makefile.in (tm_d_file_list, tm_d_include_list): New variables. (TM_D_H, D_TARGET_DEF, D_TARGET_H, D_TARGET_OBJS): New variables. (tm_d.h, cs-tm_d.h, default-d.o): New rules. (d/d-target-hooks-def.h, s-d-target-hooks-def-h): New rules. (s-tm-texi): Also check timestamp on d-target.def. (generated_files): Add TM_D_H and d-target-hooks-def.h. (build/genhooks.o): Also depend on D_TARGET_DEF. * config.gcc (tm_d_file, d_target_objs, target_has_targetdm): New variables. * config/aarch64/aarch64-d.c: New file. * config/aarch64/aarch64-linux.h (GNU_USER_TARGET_D_CRITSEC_SIZE): Define. * config/aarch64/aarch64-protos.h (aarch64_d_target_versions): New prototype. * config/aarch64/aarch64.h (TARGET_D_CPU_VERSIONS): Define. * config/aarch64/t-aarch64 (aarch64-d.o): New rule. * config/arm/arm-d.c: New file. * config/arm/arm-protos.h (arm_d_target_versions): New prototype. * config/arm/arm.h (TARGET_D_CPU_VERSIONS): Define. * config/arm/linux-eabi.h (EXTRA_TARGET_D_OS_VERSIONS): Define. * config/arm/t-arm (arm-d.o): New rule. * config/default-d.c: New file. * config/glibc-d.c: New file. * config/gnu.h (GNU_USER_TARGET_D_OS_VERSIONS): Define. * config/i386/i386-d.c: New file. * config/i386/i386-protos.h (ix86_d_target_versions): New prototype. * config/i386/i386.h (TARGET_D_CPU_VERSIONS): Define. * config/i386/linux-common.h (EXTRA_TARGET_D_OS_VERSIONS): Define. (GNU_USER_TARGET_D_CRITSEC_SIZE): Define. * config/i386/t-i386 (i386-d.o): New rule. * config/kfreebsd-gnu.h (GNU_USER_TARGET_D_OS_VERSIONS): Define. * config/kopensolaris-gnu.h (GNU_USER_TARGET_D_OS_VERSIONS): Define. * config/linux-android.h (ANDROID_TARGET_D_OS_VERSIONS): Define. * config/linux.h (GNU_USER_TARGET_D_OS_VERSIONS): Define. * config/mips/linux-common.h (EXTRA_TARGET_D_OS_VERSIONS): Define. * config/mips/mips-d.c: New file. * config/mips/mips-protos.h (mips_d_target_versions): New prototype. * config/mips/mips.h (TARGET_D_CPU_VERSIONS): Define. * config/mips/t-mips (mips-d.o): New rule. * config/powerpcspe/linux.h (GNU_USER_TARGET_D_OS_VERSIONS): Define. * config/powerpcspe/linux64.h (GNU_USER_TARGET_D_OS_VERSIONS): Define. * config/powerpcspe/powerpcspe-d.c: New file. * config/powerpcspe/powerpcspe-protos.h (rs6000_d_target_versions): New prototype. * config/powerpcspe/powerpcspe.c (rs6000_output_function_epilogue): Support GNU D by using 0 as the language type. * config/powerpcspe/powerpcspe.h (TARGET_D_CPU_VERSIONS): Define. * config/powerpcspe/t-powerpcspe (powerpcspe-d.o): New rule. * config/riscv/riscv-d.c: New file. * config/riscv/riscv-protos.h (riscv_d_target_versions): New prototype. * config/riscv/riscv.h (TARGET_D_CPU_VERSIONS): Define. * config/riscv/t-riscv (riscv-d.o): New rule. * config/rs6000/linux.h (GNU_USER_TARGET_D_OS_VERSIONS): Define. * config/rs6000/linux64.h (GNU_USER_TARGET_D_OS_VERSIONS): Define. * config/rs6000/rs6000-d.c: New file. * config/rs6000/rs6000-protos.h (rs6000_d_target_versions): New prototype. * config/rs6000/rs6000.c (rs6000_output_function_epilogue): Support GNU D by using 0 as the language type. * config/rs6000/rs6000.h (TARGET_D_CPU_VERSIONS): Define. * config/rs6000/t-rs6000 (rs6000-d.o): New rule. * config/s390/s390-d.c: New file. * config/s390/s390-protos.h (s390_d_target_versions): New prototype. * config/s390/s390.h (TARGET_D_CPU_VERSIONS): Define. * config/s390/t-s390 (s390-d.o): New rule. * config/sparc/sparc-d.c: New file. * config/sparc/sparc-protos.h (sparc_d_target_versions): New prototype. * config/sparc/sparc.h (TARGET_D_CPU_VERSIONS): Define. * config/sparc/t-sparc (sparc-d.o): New rule. * config/t-glibc (glibc-d.o): New rule. * configure: Regenerated. * configure.ac (tm_d_file): New variable. (tm_d_file_list, tm_d_include_list, d_target_objs): Add substitutes. * doc/contrib.texi (Contributors): Add self for the D frontend. * doc/frontends.texi (G++ and GCC): Mention D as a supported language. * doc/install.texi (Configuration): Mention libphobos as an option for --enable-shared. Mention d as an option for --enable-languages. (Testing): Mention check-d as a target. * doc/invoke.texi (Overall Options): Mention .d, .dd, and .di as file name suffixes. Mention d as a -x option. * doc/sourcebuild.texi (Top Level): Mention libphobos. * doc/standards.texi (Standards): Add section on D language. * doc/tm.texi: Regenerated. * doc/tm.texi.in: Add @node for D language and ABI, and @hook for TARGET_CPU_VERSIONS, TARGET_D_OS_VERSIONS, and TARGET_D_CRITSEC_SIZE. * dwarf2out.c (is_dlang): New function. (gen_compile_unit_die): Use DW_LANG_D for D. (declare_in_namespace): Return module die for D, instead of adding extra declarations into the namespace. (gen_namespace_die): Generate DW_TAG_module for D. (gen_decl_die): Handle CONST_DECLSs for D. (dwarf2out_decl): Likewise. (prune_unused_types_walk_local_classes): Handle DW_tag_interface_type. (prune_unused_types_walk): Handle DW_tag_interface_type same as other kinds of aggregates. * gcc.c (default_compilers): Add entries for .d, .dd and .di. * genhooks.c: Include d/d-target.def. gcc/po/ChangeLog: * EXCLUDES: Add sources from d/dmd. gcc/testsuite/ChangeLog: * gcc.misc-tests/help.exp: Add D to option descriptions check. * gdc.dg/asan/asan.exp: New file. * gdc.dg/asan/gdc272.d: New test. * gdc.dg/compilable.d: New test. * gdc.dg/dg.exp: New file. * gdc.dg/gdc254.d: New test. * gdc.dg/gdc260.d: New test. * gdc.dg/gdc270a.d: New test. * gdc.dg/gdc270b.d: New test. * gdc.dg/gdc282.d: New test. * gdc.dg/gdc283.d: New test. * gdc.dg/imports/gdc170.d: New test. * gdc.dg/imports/gdc231.d: New test. * gdc.dg/imports/gdc239.d: New test. * gdc.dg/imports/gdc241a.d: New test. * gdc.dg/imports/gdc241b.d: New test. * gdc.dg/imports/gdc251a.d: New test. * gdc.dg/imports/gdc251b.d: New test. * gdc.dg/imports/gdc253.d: New test. * gdc.dg/imports/gdc254a.d: New test. * gdc.dg/imports/gdc256.d: New test. * gdc.dg/imports/gdc27.d: New test. * gdc.dg/imports/gdcpkg256/package.d: New test. * gdc.dg/imports/runnable.d: New test. * gdc.dg/link.d: New test. * gdc.dg/lto/lto.exp: New file. * gdc.dg/lto/ltotests_0.d: New test. * gdc.dg/lto/ltotests_1.d: New test. * gdc.dg/runnable.d: New test. * gdc.dg/simd.d: New test. * gdc.test/gdc-test.exp: New file. * lib/gdc-dg.exp: New file. * lib/gdc.exp: New file. libphobos/ChangeLog: * Makefile.am: New file. * Makefile.in: New file. * acinclude.m4: New file. * aclocal.m4: New file. * config.h.in: New file. * configure: New file. * configure.ac: New file. * d_rules.am: New file. * libdruntime/Makefile.am: New file. * libdruntime/Makefile.in: New file. * libdruntime/__entrypoint.di: New file. * libdruntime/__main.di: New file. * libdruntime/gcc/attribute.d: New file. * libdruntime/gcc/backtrace.d: New file. * libdruntime/gcc/builtins.d: New file. * libdruntime/gcc/config.d.in: New file. * libdruntime/gcc/deh.d: New file. * libdruntime/gcc/libbacktrace.d.in: New file. * libdruntime/gcc/unwind/arm.d: New file. * libdruntime/gcc/unwind/arm_common.d: New file. * libdruntime/gcc/unwind/c6x.d: New file. * libdruntime/gcc/unwind/generic.d: New file. * libdruntime/gcc/unwind/package.d: New file. * libdruntime/gcc/unwind/pe.d: New file. * m4/autoconf.m4: New file. * m4/druntime.m4: New file. * m4/druntime/cpu.m4: New file. * m4/druntime/libraries.m4: New file. * m4/druntime/os.m4: New file. * m4/gcc_support.m4: New file. * m4/gdc.m4: New file. * m4/libtool.m4: New file. * src/Makefile.am: New file. * src/Makefile.in: New file. * src/libgphobos.spec.in: New file. * testsuite/Makefile.am: New file. * testsuite/Makefile.in: New file. * testsuite/config/default.exp: New file. * testsuite/lib/libphobos-dg.exp: New file. * testsuite/lib/libphobos.exp: New file. * testsuite/testsuite_flags.in: New file. From-SVN: r265573
This commit is contained in:
parent
01ce9e31a0
commit
b4c522fabd
24
ChangeLog
24
ChangeLog
@ -1,3 +1,27 @@
|
||||
2018-10-28 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* Makefile.def (target_modules): Add libphobos.
|
||||
(flags_to_pass): Add GDC, GDCFLAGS, GDC_FOR_TARGET and
|
||||
GDCFLAGS_FOR_TARGET.
|
||||
(dependencies): Make libphobos depend on libatomic, libbacktrace
|
||||
configure, and zlib configure.
|
||||
(language): Add language d.
|
||||
* Makefile.in: Rebuild.
|
||||
* Makefile.tpl (BUILD_EXPORTS): Add GDC and GDCFLAGS.
|
||||
(HOST_EXPORTS): Add GDC.
|
||||
(POSTSTAGE1_HOST_EXPORTS): Add GDC and GDC_FOR_BUILD.
|
||||
(BASE_TARGET_EXPORTS): Add GDC.
|
||||
(GDC_FOR_BUILD, GDC, GDCFLAGS): New variables.
|
||||
(GDC_FOR_TARGET, GDC_FLAGS_FOR_TARGET): New variables.
|
||||
(EXTRA_HOST_FLAGS): Add GDC.
|
||||
(STAGE1_FLAGS_TO_PASS): Add GDC.
|
||||
(EXTRA_TARGET_FLAGS): Add GDC and GDCFLAGS.
|
||||
* config-ml.in: Treat GDC and GDCFLAGS like other compiler/flag
|
||||
environment variables.
|
||||
* configure: Rebuild.
|
||||
* configure.ac: Add target-libphobos to target_libraries. Set and
|
||||
substitute GDC_FOR_BUILD and GDC_FOR_TARGET.
|
||||
|
||||
2018-10-24 Ilya Leoshkevich <iii@linux.ibm.com>
|
||||
|
||||
* MAINTAINERS (Write After Approval): Add myself.
|
||||
|
14
Makefile.def
14
Makefile.def
@ -153,6 +153,8 @@ target_modules = { module= libgfortran; };
|
||||
target_modules = { module= libobjc; };
|
||||
target_modules = { module= libgo; };
|
||||
target_modules = { module= libhsail-rt; };
|
||||
target_modules = { module= libphobos;
|
||||
lib_path=src/.libs; };
|
||||
target_modules = { module= libtermcap; no_check=true;
|
||||
missing=mostlyclean;
|
||||
missing=clean;
|
||||
@ -265,6 +267,8 @@ flags_to_pass = { flag= STAGE1_CHECKING ; };
|
||||
flags_to_pass = { flag= STAGE1_LANGUAGES ; };
|
||||
flags_to_pass = { flag= GNATBIND ; };
|
||||
flags_to_pass = { flag= GNATMAKE ; };
|
||||
flags_to_pass = { flag= GDC ; };
|
||||
flags_to_pass = { flag= GDCFLAGS ; };
|
||||
|
||||
// Target tools
|
||||
flags_to_pass = { flag= AR_FOR_TARGET ; };
|
||||
@ -278,6 +282,8 @@ flags_to_pass = { flag= FLAGS_FOR_TARGET ; };
|
||||
flags_to_pass = { flag= GFORTRAN_FOR_TARGET ; };
|
||||
flags_to_pass = { flag= GOC_FOR_TARGET ; };
|
||||
flags_to_pass = { flag= GOCFLAGS_FOR_TARGET ; };
|
||||
flags_to_pass = { flag= GDC_FOR_TARGET ; };
|
||||
flags_to_pass = { flag= GDCFLAGS_FOR_TARGET ; };
|
||||
flags_to_pass = { flag= LD_FOR_TARGET ; };
|
||||
flags_to_pass = { flag= LIPO_FOR_TARGET ; };
|
||||
flags_to_pass = { flag= LDFLAGS_FOR_TARGET ; };
|
||||
@ -544,6 +550,11 @@ dependencies = { module=configure-target-libgo; on=all-target-libstdc++-v3; };
|
||||
dependencies = { module=all-target-libgo; on=all-target-libbacktrace; };
|
||||
dependencies = { module=all-target-libgo; on=all-target-libffi; };
|
||||
dependencies = { module=all-target-libgo; on=all-target-libatomic; };
|
||||
dependencies = { module=configure-target-libphobos; on=configure-target-libbacktrace; };
|
||||
dependencies = { module=configure-target-libphobos; on=configure-target-zlib; };
|
||||
dependencies = { module=all-target-libphobos; on=all-target-libbacktrace; };
|
||||
dependencies = { module=all-target-libphobos; on=all-target-zlib; };
|
||||
dependencies = { module=all-target-libphobos; on=all-target-libatomic; };
|
||||
dependencies = { module=configure-target-libstdc++-v3; on=configure-target-libgomp; };
|
||||
dependencies = { module=configure-target-liboffloadmic; on=configure-target-libgomp; };
|
||||
dependencies = { module=configure-target-libsanitizer; on=all-target-libstdc++-v3; };
|
||||
@ -557,6 +568,7 @@ dependencies = { module=all-target-liboffloadmic; on=all-target-libgomp; };
|
||||
dependencies = { module=install-target-libgo; on=install-target-libatomic; };
|
||||
dependencies = { module=install-target-libgfortran; on=install-target-libquadmath; };
|
||||
dependencies = { module=install-target-libgfortran; on=install-target-libgcc; };
|
||||
dependencies = { module=install-target-libphobos; on=install-target-libatomic; };
|
||||
dependencies = { module=install-target-libsanitizer; on=install-target-libstdc++-v3; };
|
||||
dependencies = { module=install-target-libsanitizer; on=install-target-libgcc; };
|
||||
dependencies = { module=install-target-libvtv; on=install-target-libstdc++-v3; };
|
||||
@ -598,6 +610,8 @@ languages = { language=go; gcc-check-target=check-go;
|
||||
lib-check-target=check-gotools; };
|
||||
languages = { language=brig; gcc-check-target=check-brig;
|
||||
lib-check-target=check-target-libhsail-rt; };
|
||||
languages = { language=d; gcc-check-target=check-d;
|
||||
lib-check-target=check-target-libphobos; };
|
||||
|
||||
// Toplevel bootstrap
|
||||
bootstrap_stage = { id=1 ; };
|
||||
|
526
Makefile.in
526
Makefile.in
@ -156,6 +156,8 @@ BUILD_EXPORTS = \
|
||||
GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
|
||||
GOC="$(GOC_FOR_BUILD)"; export GOC; \
|
||||
GOCFLAGS="$(GOCFLAGS_FOR_BUILD)"; export GOCFLAGS; \
|
||||
GDC="$(GDC_FOR_BUILD)"; export GDC; \
|
||||
GDCFLAGS="$(GDCFLAGS_FOR_BUILD)"; export GDCFLAGS; \
|
||||
DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
|
||||
LD="$(LD_FOR_BUILD)"; export LD; \
|
||||
LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
|
||||
@ -192,6 +194,7 @@ HOST_EXPORTS = \
|
||||
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
|
||||
GFORTRAN="$(GFORTRAN)"; export GFORTRAN; \
|
||||
GOC="$(GOC)"; export GOC; \
|
||||
GDC="$(GDC)"; export GDC; \
|
||||
AR="$(AR)"; export AR; \
|
||||
AS="$(AS)"; export AS; \
|
||||
CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
|
||||
@ -256,6 +259,14 @@ POSTSTAGE1_HOST_EXPORTS = \
|
||||
CC_FOR_BUILD="$$CC"; export CC_FOR_BUILD; \
|
||||
$(POSTSTAGE1_CXX_EXPORT) \
|
||||
$(LTO_EXPORTS) \
|
||||
GDC="$$r/$(HOST_SUBDIR)/prev-gcc/gdc$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/ \
|
||||
-B$(build_tooldir)/bin/ $(GDC_FLAGS_FOR_TARGET) \
|
||||
-B$$r/prev-$(TARGET_SUBDIR)/libphobos/src \
|
||||
-I$$r/prev-$(TARGET_SUBDIR)/libphobos/libdruntime -I$$s/libphobos/libdruntime \
|
||||
-L$$r/prev-$(TARGET_SUBDIR)/libphobos/src/.libs \
|
||||
-L$$r/prev-$(TARGET_SUBDIR)/libphobos/libdruntime/.libs"; \
|
||||
export GDC; \
|
||||
GDC_FOR_BUILD="$$GDC"; export GDC_FOR_BUILD; \
|
||||
GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind"; export GNATBIND; \
|
||||
LDFLAGS="$(POSTSTAGE1_LDFLAGS) $(BOOT_LDFLAGS)"; export LDFLAGS; \
|
||||
HOST_LIBS="$(POSTSTAGE1_LIBS)"; export HOST_LIBS;
|
||||
@ -278,6 +289,7 @@ BASE_TARGET_EXPORTS = \
|
||||
CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
|
||||
GFORTRAN="$(GFORTRAN_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GFORTRAN; \
|
||||
GOC="$(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GOC; \
|
||||
GDC="$(GDC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GDC; \
|
||||
DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
|
||||
LD="$(COMPILER_LD_FOR_TARGET)"; export LD; \
|
||||
LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
|
||||
@ -342,6 +354,7 @@ CXX_FOR_BUILD = @CXX_FOR_BUILD@
|
||||
DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@
|
||||
GFORTRAN_FOR_BUILD = @GFORTRAN_FOR_BUILD@
|
||||
GOC_FOR_BUILD = @GOC_FOR_BUILD@
|
||||
GDC_FOR_BUILD = @GDC_FOR_BUILD@
|
||||
LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
|
||||
LD_FOR_BUILD = @LD_FOR_BUILD@
|
||||
NM_FOR_BUILD = @NM_FOR_BUILD@
|
||||
@ -399,6 +412,7 @@ STRIP = @STRIP@
|
||||
WINDRES = @WINDRES@
|
||||
WINDMC = @WINDMC@
|
||||
|
||||
GDC = @GDC@
|
||||
GNATBIND = @GNATBIND@
|
||||
GNATMAKE = @GNATMAKE@
|
||||
|
||||
@ -408,6 +422,7 @@ LIBCFLAGS = $(CFLAGS)
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
|
||||
GOCFLAGS = $(CFLAGS)
|
||||
GDCFLAGS = $(CFLAGS)
|
||||
|
||||
CREATE_GCOV = create_gcov
|
||||
|
||||
@ -574,6 +589,7 @@ CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @CXX_FOR_TARGET@
|
||||
RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@
|
||||
GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@
|
||||
GOC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GOC_FOR_TARGET@
|
||||
GDC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GDC_FOR_TARGET@
|
||||
DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
|
||||
LD_FOR_TARGET=@LD_FOR_TARGET@
|
||||
|
||||
@ -598,6 +614,7 @@ LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
|
||||
LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
|
||||
LDFLAGS_FOR_TARGET = @LDFLAGS_FOR_TARGET@
|
||||
GOCFLAGS_FOR_TARGET = -O2 -g
|
||||
GDCFLAGS_FOR_TARGET = -O2 -g
|
||||
|
||||
FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
|
||||
SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
|
||||
@ -622,7 +639,7 @@ all:
|
||||
|
||||
# This is the list of directories that may be needed in RPATH_ENVVAR
|
||||
# so that programs built for the target machine work.
|
||||
TARGET_LIB_PATH = $(TARGET_LIB_PATH_libstdc++-v3)$(TARGET_LIB_PATH_libsanitizer)$(TARGET_LIB_PATH_libvtv)$(TARGET_LIB_PATH_liboffloadmic)$(TARGET_LIB_PATH_libssp)$(TARGET_LIB_PATH_libgomp)$(TARGET_LIB_PATH_libitm)$(TARGET_LIB_PATH_libatomic)$(HOST_LIB_PATH_gcc)
|
||||
TARGET_LIB_PATH = $(TARGET_LIB_PATH_libstdc++-v3)$(TARGET_LIB_PATH_libsanitizer)$(TARGET_LIB_PATH_libvtv)$(TARGET_LIB_PATH_liboffloadmic)$(TARGET_LIB_PATH_libssp)$(TARGET_LIB_PATH_libphobos)$(TARGET_LIB_PATH_libgomp)$(TARGET_LIB_PATH_libitm)$(TARGET_LIB_PATH_libatomic)$(HOST_LIB_PATH_gcc)
|
||||
|
||||
@if target-libstdc++-v3
|
||||
TARGET_LIB_PATH_libstdc++-v3 = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:
|
||||
@ -644,6 +661,10 @@ TARGET_LIB_PATH_liboffloadmic = $$r/$(TARGET_SUBDIR)/liboffloadmic/.libs:
|
||||
TARGET_LIB_PATH_libssp = $$r/$(TARGET_SUBDIR)/libssp/.libs:
|
||||
@endif target-libssp
|
||||
|
||||
@if target-libphobos
|
||||
TARGET_LIB_PATH_libphobos = $$r/$(TARGET_SUBDIR)/libphobos/src/.libs:
|
||||
@endif target-libphobos
|
||||
|
||||
@if target-libgomp
|
||||
TARGET_LIB_PATH_libgomp = $$r/$(TARGET_SUBDIR)/libgomp/.libs:
|
||||
@endif target-libgomp
|
||||
@ -778,6 +799,8 @@ BASE_FLAGS_TO_PASS = \
|
||||
"STAGE1_LANGUAGES=$(STAGE1_LANGUAGES)" \
|
||||
"GNATBIND=$(GNATBIND)" \
|
||||
"GNATMAKE=$(GNATMAKE)" \
|
||||
"GDC=$(GDC)" \
|
||||
"GDCFLAGS=$(GDCFLAGS)" \
|
||||
"AR_FOR_TARGET=$(AR_FOR_TARGET)" \
|
||||
"AS_FOR_TARGET=$(AS_FOR_TARGET)" \
|
||||
"CC_FOR_TARGET=$(CC_FOR_TARGET)" \
|
||||
@ -789,6 +812,8 @@ BASE_FLAGS_TO_PASS = \
|
||||
"GFORTRAN_FOR_TARGET=$(GFORTRAN_FOR_TARGET)" \
|
||||
"GOC_FOR_TARGET=$(GOC_FOR_TARGET)" \
|
||||
"GOCFLAGS_FOR_TARGET=$(GOCFLAGS_FOR_TARGET)" \
|
||||
"GDC_FOR_TARGET=$(GDC_FOR_TARGET)" \
|
||||
"GDCFLAGS_FOR_TARGET=$(GDCFLAGS_FOR_TARGET)" \
|
||||
"LD_FOR_TARGET=$(LD_FOR_TARGET)" \
|
||||
"LIPO_FOR_TARGET=$(LIPO_FOR_TARGET)" \
|
||||
"LDFLAGS_FOR_TARGET=$(LDFLAGS_FOR_TARGET)" \
|
||||
@ -851,6 +876,7 @@ EXTRA_HOST_FLAGS = \
|
||||
'DLLTOOL=$(DLLTOOL)' \
|
||||
'GFORTRAN=$(GFORTRAN)' \
|
||||
'GOC=$(GOC)' \
|
||||
'GDC=$(GDC)' \
|
||||
'LD=$(LD)' \
|
||||
'LIPO=$(LIPO)' \
|
||||
'NM=$(NM)' \
|
||||
@ -875,6 +901,7 @@ STAGE1_FLAGS_TO_PASS = \
|
||||
POSTSTAGE1_FLAGS_TO_PASS = \
|
||||
CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
|
||||
CXX="$${CXX}" CXX_FOR_BUILD="$${CXX_FOR_BUILD}" \
|
||||
GDC="$${GDC}" GDC_FOR_BUILD="$${GDC_FOR_BUILD}" \
|
||||
GNATBIND="$${GNATBIND}" \
|
||||
LDFLAGS="$${LDFLAGS}" \
|
||||
HOST_LIBS="$${HOST_LIBS}" \
|
||||
@ -907,6 +934,8 @@ EXTRA_TARGET_FLAGS = \
|
||||
'GFORTRAN=$$(GFORTRAN_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
|
||||
'GOC=$$(GOC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
|
||||
'GOCFLAGS=$$(GOCFLAGS_FOR_TARGET)' \
|
||||
'GDC=$$(GDC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
|
||||
'GDCFLAGS=$$(GDCFLAGS_FOR_TARGET)' \
|
||||
'LD=$(COMPILER_LD_FOR_TARGET)' \
|
||||
'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \
|
||||
'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
|
||||
@ -1008,6 +1037,7 @@ configure-target: \
|
||||
maybe-configure-target-libobjc \
|
||||
maybe-configure-target-libgo \
|
||||
maybe-configure-target-libhsail-rt \
|
||||
maybe-configure-target-libphobos \
|
||||
maybe-configure-target-libtermcap \
|
||||
maybe-configure-target-winsup \
|
||||
maybe-configure-target-libgloss \
|
||||
@ -1170,6 +1200,7 @@ all-target: maybe-all-target-libgfortran
|
||||
all-target: maybe-all-target-libobjc
|
||||
all-target: maybe-all-target-libgo
|
||||
all-target: maybe-all-target-libhsail-rt
|
||||
all-target: maybe-all-target-libphobos
|
||||
all-target: maybe-all-target-libtermcap
|
||||
all-target: maybe-all-target-winsup
|
||||
all-target: maybe-all-target-libgloss
|
||||
@ -1261,6 +1292,7 @@ info-target: maybe-info-target-libgfortran
|
||||
info-target: maybe-info-target-libobjc
|
||||
info-target: maybe-info-target-libgo
|
||||
info-target: maybe-info-target-libhsail-rt
|
||||
info-target: maybe-info-target-libphobos
|
||||
info-target: maybe-info-target-libtermcap
|
||||
info-target: maybe-info-target-winsup
|
||||
info-target: maybe-info-target-libgloss
|
||||
@ -1345,6 +1377,7 @@ dvi-target: maybe-dvi-target-libgfortran
|
||||
dvi-target: maybe-dvi-target-libobjc
|
||||
dvi-target: maybe-dvi-target-libgo
|
||||
dvi-target: maybe-dvi-target-libhsail-rt
|
||||
dvi-target: maybe-dvi-target-libphobos
|
||||
dvi-target: maybe-dvi-target-libtermcap
|
||||
dvi-target: maybe-dvi-target-winsup
|
||||
dvi-target: maybe-dvi-target-libgloss
|
||||
@ -1429,6 +1462,7 @@ pdf-target: maybe-pdf-target-libgfortran
|
||||
pdf-target: maybe-pdf-target-libobjc
|
||||
pdf-target: maybe-pdf-target-libgo
|
||||
pdf-target: maybe-pdf-target-libhsail-rt
|
||||
pdf-target: maybe-pdf-target-libphobos
|
||||
pdf-target: maybe-pdf-target-libtermcap
|
||||
pdf-target: maybe-pdf-target-winsup
|
||||
pdf-target: maybe-pdf-target-libgloss
|
||||
@ -1513,6 +1547,7 @@ html-target: maybe-html-target-libgfortran
|
||||
html-target: maybe-html-target-libobjc
|
||||
html-target: maybe-html-target-libgo
|
||||
html-target: maybe-html-target-libhsail-rt
|
||||
html-target: maybe-html-target-libphobos
|
||||
html-target: maybe-html-target-libtermcap
|
||||
html-target: maybe-html-target-winsup
|
||||
html-target: maybe-html-target-libgloss
|
||||
@ -1597,6 +1632,7 @@ TAGS-target: maybe-TAGS-target-libgfortran
|
||||
TAGS-target: maybe-TAGS-target-libobjc
|
||||
TAGS-target: maybe-TAGS-target-libgo
|
||||
TAGS-target: maybe-TAGS-target-libhsail-rt
|
||||
TAGS-target: maybe-TAGS-target-libphobos
|
||||
TAGS-target: maybe-TAGS-target-libtermcap
|
||||
TAGS-target: maybe-TAGS-target-winsup
|
||||
TAGS-target: maybe-TAGS-target-libgloss
|
||||
@ -1681,6 +1717,7 @@ install-info-target: maybe-install-info-target-libgfortran
|
||||
install-info-target: maybe-install-info-target-libobjc
|
||||
install-info-target: maybe-install-info-target-libgo
|
||||
install-info-target: maybe-install-info-target-libhsail-rt
|
||||
install-info-target: maybe-install-info-target-libphobos
|
||||
install-info-target: maybe-install-info-target-libtermcap
|
||||
install-info-target: maybe-install-info-target-winsup
|
||||
install-info-target: maybe-install-info-target-libgloss
|
||||
@ -1765,6 +1802,7 @@ install-pdf-target: maybe-install-pdf-target-libgfortran
|
||||
install-pdf-target: maybe-install-pdf-target-libobjc
|
||||
install-pdf-target: maybe-install-pdf-target-libgo
|
||||
install-pdf-target: maybe-install-pdf-target-libhsail-rt
|
||||
install-pdf-target: maybe-install-pdf-target-libphobos
|
||||
install-pdf-target: maybe-install-pdf-target-libtermcap
|
||||
install-pdf-target: maybe-install-pdf-target-winsup
|
||||
install-pdf-target: maybe-install-pdf-target-libgloss
|
||||
@ -1849,6 +1887,7 @@ install-html-target: maybe-install-html-target-libgfortran
|
||||
install-html-target: maybe-install-html-target-libobjc
|
||||
install-html-target: maybe-install-html-target-libgo
|
||||
install-html-target: maybe-install-html-target-libhsail-rt
|
||||
install-html-target: maybe-install-html-target-libphobos
|
||||
install-html-target: maybe-install-html-target-libtermcap
|
||||
install-html-target: maybe-install-html-target-winsup
|
||||
install-html-target: maybe-install-html-target-libgloss
|
||||
@ -1933,6 +1972,7 @@ installcheck-target: maybe-installcheck-target-libgfortran
|
||||
installcheck-target: maybe-installcheck-target-libobjc
|
||||
installcheck-target: maybe-installcheck-target-libgo
|
||||
installcheck-target: maybe-installcheck-target-libhsail-rt
|
||||
installcheck-target: maybe-installcheck-target-libphobos
|
||||
installcheck-target: maybe-installcheck-target-libtermcap
|
||||
installcheck-target: maybe-installcheck-target-winsup
|
||||
installcheck-target: maybe-installcheck-target-libgloss
|
||||
@ -2017,6 +2057,7 @@ mostlyclean-target: maybe-mostlyclean-target-libgfortran
|
||||
mostlyclean-target: maybe-mostlyclean-target-libobjc
|
||||
mostlyclean-target: maybe-mostlyclean-target-libgo
|
||||
mostlyclean-target: maybe-mostlyclean-target-libhsail-rt
|
||||
mostlyclean-target: maybe-mostlyclean-target-libphobos
|
||||
mostlyclean-target: maybe-mostlyclean-target-libtermcap
|
||||
mostlyclean-target: maybe-mostlyclean-target-winsup
|
||||
mostlyclean-target: maybe-mostlyclean-target-libgloss
|
||||
@ -2101,6 +2142,7 @@ clean-target: maybe-clean-target-libgfortran
|
||||
clean-target: maybe-clean-target-libobjc
|
||||
clean-target: maybe-clean-target-libgo
|
||||
clean-target: maybe-clean-target-libhsail-rt
|
||||
clean-target: maybe-clean-target-libphobos
|
||||
clean-target: maybe-clean-target-libtermcap
|
||||
clean-target: maybe-clean-target-winsup
|
||||
clean-target: maybe-clean-target-libgloss
|
||||
@ -2185,6 +2227,7 @@ distclean-target: maybe-distclean-target-libgfortran
|
||||
distclean-target: maybe-distclean-target-libobjc
|
||||
distclean-target: maybe-distclean-target-libgo
|
||||
distclean-target: maybe-distclean-target-libhsail-rt
|
||||
distclean-target: maybe-distclean-target-libphobos
|
||||
distclean-target: maybe-distclean-target-libtermcap
|
||||
distclean-target: maybe-distclean-target-winsup
|
||||
distclean-target: maybe-distclean-target-libgloss
|
||||
@ -2269,6 +2312,7 @@ maintainer-clean-target: maybe-maintainer-clean-target-libgfortran
|
||||
maintainer-clean-target: maybe-maintainer-clean-target-libobjc
|
||||
maintainer-clean-target: maybe-maintainer-clean-target-libgo
|
||||
maintainer-clean-target: maybe-maintainer-clean-target-libhsail-rt
|
||||
maintainer-clean-target: maybe-maintainer-clean-target-libphobos
|
||||
maintainer-clean-target: maybe-maintainer-clean-target-libtermcap
|
||||
maintainer-clean-target: maybe-maintainer-clean-target-winsup
|
||||
maintainer-clean-target: maybe-maintainer-clean-target-libgloss
|
||||
@ -2409,6 +2453,7 @@ check-target: \
|
||||
maybe-check-target-libobjc \
|
||||
maybe-check-target-libgo \
|
||||
maybe-check-target-libhsail-rt \
|
||||
maybe-check-target-libphobos \
|
||||
maybe-check-target-libtermcap \
|
||||
maybe-check-target-winsup \
|
||||
maybe-check-target-libgloss \
|
||||
@ -2589,6 +2634,7 @@ install-target: \
|
||||
maybe-install-target-libobjc \
|
||||
maybe-install-target-libgo \
|
||||
maybe-install-target-libhsail-rt \
|
||||
maybe-install-target-libphobos \
|
||||
maybe-install-target-libtermcap \
|
||||
maybe-install-target-winsup \
|
||||
maybe-install-target-libgloss \
|
||||
@ -2693,6 +2739,7 @@ install-strip-target: \
|
||||
maybe-install-strip-target-libobjc \
|
||||
maybe-install-strip-target-libgo \
|
||||
maybe-install-strip-target-libhsail-rt \
|
||||
maybe-install-strip-target-libphobos \
|
||||
maybe-install-strip-target-libtermcap \
|
||||
maybe-install-strip-target-winsup \
|
||||
maybe-install-strip-target-libgloss \
|
||||
@ -46944,6 +46991,464 @@ maintainer-clean-target-libhsail-rt:
|
||||
|
||||
|
||||
|
||||
.PHONY: configure-target-libphobos maybe-configure-target-libphobos
|
||||
maybe-configure-target-libphobos:
|
||||
@if gcc-bootstrap
|
||||
configure-target-libphobos: stage_current
|
||||
@endif gcc-bootstrap
|
||||
@if target-libphobos
|
||||
maybe-configure-target-libphobos: configure-target-libphobos
|
||||
configure-target-libphobos:
|
||||
@: $(MAKE); $(unstage)
|
||||
@r=`${PWD_COMMAND}`; export r; \
|
||||
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
|
||||
echo "Checking multilib configuration for libphobos..."; \
|
||||
$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libphobos; \
|
||||
$(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libphobos/multilib.tmp 2> /dev/null; \
|
||||
if test -r $(TARGET_SUBDIR)/libphobos/multilib.out; then \
|
||||
if cmp -s $(TARGET_SUBDIR)/libphobos/multilib.tmp $(TARGET_SUBDIR)/libphobos/multilib.out; then \
|
||||
rm -f $(TARGET_SUBDIR)/libphobos/multilib.tmp; \
|
||||
else \
|
||||
rm -f $(TARGET_SUBDIR)/libphobos/Makefile; \
|
||||
mv $(TARGET_SUBDIR)/libphobos/multilib.tmp $(TARGET_SUBDIR)/libphobos/multilib.out; \
|
||||
fi; \
|
||||
else \
|
||||
mv $(TARGET_SUBDIR)/libphobos/multilib.tmp $(TARGET_SUBDIR)/libphobos/multilib.out; \
|
||||
fi; \
|
||||
test ! -f $(TARGET_SUBDIR)/libphobos/Makefile || exit 0; \
|
||||
$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libphobos; \
|
||||
$(NORMAL_TARGET_EXPORTS) \
|
||||
echo Configuring in $(TARGET_SUBDIR)/libphobos; \
|
||||
cd "$(TARGET_SUBDIR)/libphobos" || exit 1; \
|
||||
case $(srcdir) in \
|
||||
/* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
|
||||
*) topdir=`echo $(TARGET_SUBDIR)/libphobos/ | \
|
||||
sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
|
||||
esac; \
|
||||
module_srcdir=libphobos; \
|
||||
rm -f no-such-file || : ; \
|
||||
CONFIG_SITE=no-such-file $(SHELL) \
|
||||
$$s/$$module_srcdir/configure \
|
||||
--srcdir=$${topdir}/$$module_srcdir \
|
||||
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
|
||||
--target=${target_alias} \
|
||||
|| exit 1
|
||||
@endif target-libphobos
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.PHONY: all-target-libphobos maybe-all-target-libphobos
|
||||
maybe-all-target-libphobos:
|
||||
@if gcc-bootstrap
|
||||
all-target-libphobos: stage_current
|
||||
@endif gcc-bootstrap
|
||||
@if target-libphobos
|
||||
TARGET-target-libphobos=all
|
||||
maybe-all-target-libphobos: all-target-libphobos
|
||||
all-target-libphobos: configure-target-libphobos
|
||||
@: $(MAKE); $(unstage)
|
||||
@r=`${PWD_COMMAND}`; export r; \
|
||||
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
|
||||
$(NORMAL_TARGET_EXPORTS) \
|
||||
(cd $(TARGET_SUBDIR)/libphobos && \
|
||||
$(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \
|
||||
$(TARGET-target-libphobos))
|
||||
@endif target-libphobos
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.PHONY: check-target-libphobos maybe-check-target-libphobos
|
||||
maybe-check-target-libphobos:
|
||||
@if target-libphobos
|
||||
maybe-check-target-libphobos: check-target-libphobos
|
||||
|
||||
check-target-libphobos:
|
||||
@: $(MAKE); $(unstage)
|
||||
@r=`${PWD_COMMAND}`; export r; \
|
||||
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
|
||||
$(NORMAL_TARGET_EXPORTS) \
|
||||
(cd $(TARGET_SUBDIR)/libphobos && \
|
||||
$(MAKE) $(TARGET_FLAGS_TO_PASS) check)
|
||||
|
||||
@endif target-libphobos
|
||||
|
||||
.PHONY: install-target-libphobos maybe-install-target-libphobos
|
||||
maybe-install-target-libphobos:
|
||||
@if target-libphobos
|
||||
maybe-install-target-libphobos: install-target-libphobos
|
||||
|
||||
install-target-libphobos: installdirs
|
||||
@: $(MAKE); $(unstage)
|
||||
@r=`${PWD_COMMAND}`; export r; \
|
||||
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
|
||||
$(NORMAL_TARGET_EXPORTS) \
|
||||
(cd $(TARGET_SUBDIR)/libphobos && \
|
||||
$(MAKE) $(TARGET_FLAGS_TO_PASS) install)
|
||||
|
||||
@endif target-libphobos
|
||||
|
||||
.PHONY: install-strip-target-libphobos maybe-install-strip-target-libphobos
|
||||
maybe-install-strip-target-libphobos:
|
||||
@if target-libphobos
|
||||
maybe-install-strip-target-libphobos: install-strip-target-libphobos
|
||||
|
||||
install-strip-target-libphobos: installdirs
|
||||
@: $(MAKE); $(unstage)
|
||||
@r=`${PWD_COMMAND}`; export r; \
|
||||
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
|
||||
$(NORMAL_TARGET_EXPORTS) \
|
||||
(cd $(TARGET_SUBDIR)/libphobos && \
|
||||
$(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip)
|
||||
|
||||
@endif target-libphobos
|
||||
|
||||
# Other targets (info, dvi, pdf, etc.)
|
||||
|
||||
.PHONY: maybe-info-target-libphobos info-target-libphobos
|
||||
maybe-info-target-libphobos:
|
||||
@if target-libphobos
|
||||
maybe-info-target-libphobos: info-target-libphobos
|
||||
|
||||
info-target-libphobos: \
|
||||
configure-target-libphobos
|
||||
@: $(MAKE); $(unstage)
|
||||
@[ -f $(TARGET_SUBDIR)/libphobos/Makefile ] || exit 0; \
|
||||
r=`${PWD_COMMAND}`; export r; \
|
||||
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
|
||||
$(NORMAL_TARGET_EXPORTS) \
|
||||
echo "Doing info in $(TARGET_SUBDIR)/libphobos"; \
|
||||
for flag in $(EXTRA_TARGET_FLAGS); do \
|
||||
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
|
||||
done; \
|
||||
(cd $(TARGET_SUBDIR)/libphobos && \
|
||||
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
|
||||
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
|
||||
"RANLIB=$${RANLIB}" \
|
||||
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
|
||||
info) \
|
||||
|| exit 1
|
||||
|
||||
@endif target-libphobos
|
||||
|
||||
.PHONY: maybe-dvi-target-libphobos dvi-target-libphobos
|
||||
maybe-dvi-target-libphobos:
|
||||
@if target-libphobos
|
||||
maybe-dvi-target-libphobos: dvi-target-libphobos
|
||||
|
||||
dvi-target-libphobos: \
|
||||
configure-target-libphobos
|
||||
@: $(MAKE); $(unstage)
|
||||
@[ -f $(TARGET_SUBDIR)/libphobos/Makefile ] || exit 0; \
|
||||
r=`${PWD_COMMAND}`; export r; \
|
||||
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
|
||||
$(NORMAL_TARGET_EXPORTS) \
|
||||
echo "Doing dvi in $(TARGET_SUBDIR)/libphobos"; \
|
||||
for flag in $(EXTRA_TARGET_FLAGS); do \
|
||||
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
|
||||
done; \
|
||||
(cd $(TARGET_SUBDIR)/libphobos && \
|
||||
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
|
||||
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
|
||||
"RANLIB=$${RANLIB}" \
|
||||
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
|
||||
dvi) \
|
||||
|| exit 1
|
||||
|
||||
@endif target-libphobos
|
||||
|
||||
.PHONY: maybe-pdf-target-libphobos pdf-target-libphobos
|
||||
maybe-pdf-target-libphobos:
|
||||
@if target-libphobos
|
||||
maybe-pdf-target-libphobos: pdf-target-libphobos
|
||||
|
||||
pdf-target-libphobos: \
|
||||
configure-target-libphobos
|
||||
@: $(MAKE); $(unstage)
|
||||
@[ -f $(TARGET_SUBDIR)/libphobos/Makefile ] || exit 0; \
|
||||
r=`${PWD_COMMAND}`; export r; \
|
||||
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
|
||||
$(NORMAL_TARGET_EXPORTS) \
|
||||
echo "Doing pdf in $(TARGET_SUBDIR)/libphobos"; \
|
||||
for flag in $(EXTRA_TARGET_FLAGS); do \
|
||||
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
|
||||
done; \
|
||||
(cd $(TARGET_SUBDIR)/libphobos && \
|
||||
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
|
||||
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
|
||||
"RANLIB=$${RANLIB}" \
|
||||
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
|
||||
pdf) \
|
||||
|| exit 1
|
||||
|
||||
@endif target-libphobos
|
||||
|
||||
.PHONY: maybe-html-target-libphobos html-target-libphobos
|
||||
maybe-html-target-libphobos:
|
||||
@if target-libphobos
|
||||
maybe-html-target-libphobos: html-target-libphobos
|
||||
|
||||
html-target-libphobos: \
|
||||
configure-target-libphobos
|
||||
@: $(MAKE); $(unstage)
|
||||
@[ -f $(TARGET_SUBDIR)/libphobos/Makefile ] || exit 0; \
|
||||
r=`${PWD_COMMAND}`; export r; \
|
||||
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
|
||||
$(NORMAL_TARGET_EXPORTS) \
|
||||
echo "Doing html in $(TARGET_SUBDIR)/libphobos"; \
|
||||
for flag in $(EXTRA_TARGET_FLAGS); do \
|
||||
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
|
||||
done; \
|
||||
(cd $(TARGET_SUBDIR)/libphobos && \
|
||||
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
|
||||
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
|
||||
"RANLIB=$${RANLIB}" \
|
||||
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
|
||||
html) \
|
||||
|| exit 1
|
||||
|
||||
@endif target-libphobos
|
||||
|
||||
.PHONY: maybe-TAGS-target-libphobos TAGS-target-libphobos
|
||||
maybe-TAGS-target-libphobos:
|
||||
@if target-libphobos
|
||||
maybe-TAGS-target-libphobos: TAGS-target-libphobos
|
||||
|
||||
TAGS-target-libphobos: \
|
||||
configure-target-libphobos
|
||||
@: $(MAKE); $(unstage)
|
||||
@[ -f $(TARGET_SUBDIR)/libphobos/Makefile ] || exit 0; \
|
||||
r=`${PWD_COMMAND}`; export r; \
|
||||
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
|
||||
$(NORMAL_TARGET_EXPORTS) \
|
||||
echo "Doing TAGS in $(TARGET_SUBDIR)/libphobos"; \
|
||||
for flag in $(EXTRA_TARGET_FLAGS); do \
|
||||
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
|
||||
done; \
|
||||
(cd $(TARGET_SUBDIR)/libphobos && \
|
||||
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
|
||||
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
|
||||
"RANLIB=$${RANLIB}" \
|
||||
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
|
||||
TAGS) \
|
||||
|| exit 1
|
||||
|
||||
@endif target-libphobos
|
||||
|
||||
.PHONY: maybe-install-info-target-libphobos install-info-target-libphobos
|
||||
maybe-install-info-target-libphobos:
|
||||
@if target-libphobos
|
||||
maybe-install-info-target-libphobos: install-info-target-libphobos
|
||||
|
||||
install-info-target-libphobos: \
|
||||
configure-target-libphobos \
|
||||
info-target-libphobos
|
||||
@: $(MAKE); $(unstage)
|
||||
@[ -f $(TARGET_SUBDIR)/libphobos/Makefile ] || exit 0; \
|
||||
r=`${PWD_COMMAND}`; export r; \
|
||||
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
|
||||
$(NORMAL_TARGET_EXPORTS) \
|
||||
echo "Doing install-info in $(TARGET_SUBDIR)/libphobos"; \
|
||||
for flag in $(EXTRA_TARGET_FLAGS); do \
|
||||
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
|
||||
done; \
|
||||
(cd $(TARGET_SUBDIR)/libphobos && \
|
||||
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
|
||||
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
|
||||
"RANLIB=$${RANLIB}" \
|
||||
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
|
||||
install-info) \
|
||||
|| exit 1
|
||||
|
||||
@endif target-libphobos
|
||||
|
||||
.PHONY: maybe-install-pdf-target-libphobos install-pdf-target-libphobos
|
||||
maybe-install-pdf-target-libphobos:
|
||||
@if target-libphobos
|
||||
maybe-install-pdf-target-libphobos: install-pdf-target-libphobos
|
||||
|
||||
install-pdf-target-libphobos: \
|
||||
configure-target-libphobos \
|
||||
pdf-target-libphobos
|
||||
@: $(MAKE); $(unstage)
|
||||
@[ -f $(TARGET_SUBDIR)/libphobos/Makefile ] || exit 0; \
|
||||
r=`${PWD_COMMAND}`; export r; \
|
||||
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
|
||||
$(NORMAL_TARGET_EXPORTS) \
|
||||
echo "Doing install-pdf in $(TARGET_SUBDIR)/libphobos"; \
|
||||
for flag in $(EXTRA_TARGET_FLAGS); do \
|
||||
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
|
||||
done; \
|
||||
(cd $(TARGET_SUBDIR)/libphobos && \
|
||||
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
|
||||
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
|
||||
"RANLIB=$${RANLIB}" \
|
||||
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
|
||||
install-pdf) \
|
||||
|| exit 1
|
||||
|
||||
@endif target-libphobos
|
||||
|
||||
.PHONY: maybe-install-html-target-libphobos install-html-target-libphobos
|
||||
maybe-install-html-target-libphobos:
|
||||
@if target-libphobos
|
||||
maybe-install-html-target-libphobos: install-html-target-libphobos
|
||||
|
||||
install-html-target-libphobos: \
|
||||
configure-target-libphobos \
|
||||
html-target-libphobos
|
||||
@: $(MAKE); $(unstage)
|
||||
@[ -f $(TARGET_SUBDIR)/libphobos/Makefile ] || exit 0; \
|
||||
r=`${PWD_COMMAND}`; export r; \
|
||||
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
|
||||
$(NORMAL_TARGET_EXPORTS) \
|
||||
echo "Doing install-html in $(TARGET_SUBDIR)/libphobos"; \
|
||||
for flag in $(EXTRA_TARGET_FLAGS); do \
|
||||
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
|
||||
done; \
|
||||
(cd $(TARGET_SUBDIR)/libphobos && \
|
||||
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
|
||||
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
|
||||
"RANLIB=$${RANLIB}" \
|
||||
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
|
||||
install-html) \
|
||||
|| exit 1
|
||||
|
||||
@endif target-libphobos
|
||||
|
||||
.PHONY: maybe-installcheck-target-libphobos installcheck-target-libphobos
|
||||
maybe-installcheck-target-libphobos:
|
||||
@if target-libphobos
|
||||
maybe-installcheck-target-libphobos: installcheck-target-libphobos
|
||||
|
||||
installcheck-target-libphobos: \
|
||||
configure-target-libphobos
|
||||
@: $(MAKE); $(unstage)
|
||||
@[ -f $(TARGET_SUBDIR)/libphobos/Makefile ] || exit 0; \
|
||||
r=`${PWD_COMMAND}`; export r; \
|
||||
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
|
||||
$(NORMAL_TARGET_EXPORTS) \
|
||||
echo "Doing installcheck in $(TARGET_SUBDIR)/libphobos"; \
|
||||
for flag in $(EXTRA_TARGET_FLAGS); do \
|
||||
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
|
||||
done; \
|
||||
(cd $(TARGET_SUBDIR)/libphobos && \
|
||||
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
|
||||
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
|
||||
"RANLIB=$${RANLIB}" \
|
||||
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
|
||||
installcheck) \
|
||||
|| exit 1
|
||||
|
||||
@endif target-libphobos
|
||||
|
||||
.PHONY: maybe-mostlyclean-target-libphobos mostlyclean-target-libphobos
|
||||
maybe-mostlyclean-target-libphobos:
|
||||
@if target-libphobos
|
||||
maybe-mostlyclean-target-libphobos: mostlyclean-target-libphobos
|
||||
|
||||
mostlyclean-target-libphobos:
|
||||
@: $(MAKE); $(unstage)
|
||||
@[ -f $(TARGET_SUBDIR)/libphobos/Makefile ] || exit 0; \
|
||||
r=`${PWD_COMMAND}`; export r; \
|
||||
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
|
||||
$(NORMAL_TARGET_EXPORTS) \
|
||||
echo "Doing mostlyclean in $(TARGET_SUBDIR)/libphobos"; \
|
||||
for flag in $(EXTRA_TARGET_FLAGS); do \
|
||||
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
|
||||
done; \
|
||||
(cd $(TARGET_SUBDIR)/libphobos && \
|
||||
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
|
||||
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
|
||||
"RANLIB=$${RANLIB}" \
|
||||
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
|
||||
mostlyclean) \
|
||||
|| exit 1
|
||||
|
||||
@endif target-libphobos
|
||||
|
||||
.PHONY: maybe-clean-target-libphobos clean-target-libphobos
|
||||
maybe-clean-target-libphobos:
|
||||
@if target-libphobos
|
||||
maybe-clean-target-libphobos: clean-target-libphobos
|
||||
|
||||
clean-target-libphobos:
|
||||
@: $(MAKE); $(unstage)
|
||||
@[ -f $(TARGET_SUBDIR)/libphobos/Makefile ] || exit 0; \
|
||||
r=`${PWD_COMMAND}`; export r; \
|
||||
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
|
||||
$(NORMAL_TARGET_EXPORTS) \
|
||||
echo "Doing clean in $(TARGET_SUBDIR)/libphobos"; \
|
||||
for flag in $(EXTRA_TARGET_FLAGS); do \
|
||||
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
|
||||
done; \
|
||||
(cd $(TARGET_SUBDIR)/libphobos && \
|
||||
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
|
||||
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
|
||||
"RANLIB=$${RANLIB}" \
|
||||
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
|
||||
clean) \
|
||||
|| exit 1
|
||||
|
||||
@endif target-libphobos
|
||||
|
||||
.PHONY: maybe-distclean-target-libphobos distclean-target-libphobos
|
||||
maybe-distclean-target-libphobos:
|
||||
@if target-libphobos
|
||||
maybe-distclean-target-libphobos: distclean-target-libphobos
|
||||
|
||||
distclean-target-libphobos:
|
||||
@: $(MAKE); $(unstage)
|
||||
@[ -f $(TARGET_SUBDIR)/libphobos/Makefile ] || exit 0; \
|
||||
r=`${PWD_COMMAND}`; export r; \
|
||||
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
|
||||
$(NORMAL_TARGET_EXPORTS) \
|
||||
echo "Doing distclean in $(TARGET_SUBDIR)/libphobos"; \
|
||||
for flag in $(EXTRA_TARGET_FLAGS); do \
|
||||
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
|
||||
done; \
|
||||
(cd $(TARGET_SUBDIR)/libphobos && \
|
||||
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
|
||||
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
|
||||
"RANLIB=$${RANLIB}" \
|
||||
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
|
||||
distclean) \
|
||||
|| exit 1
|
||||
|
||||
@endif target-libphobos
|
||||
|
||||
.PHONY: maybe-maintainer-clean-target-libphobos maintainer-clean-target-libphobos
|
||||
maybe-maintainer-clean-target-libphobos:
|
||||
@if target-libphobos
|
||||
maybe-maintainer-clean-target-libphobos: maintainer-clean-target-libphobos
|
||||
|
||||
maintainer-clean-target-libphobos:
|
||||
@: $(MAKE); $(unstage)
|
||||
@[ -f $(TARGET_SUBDIR)/libphobos/Makefile ] || exit 0; \
|
||||
r=`${PWD_COMMAND}`; export r; \
|
||||
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
|
||||
$(NORMAL_TARGET_EXPORTS) \
|
||||
echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libphobos"; \
|
||||
for flag in $(EXTRA_TARGET_FLAGS); do \
|
||||
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
|
||||
done; \
|
||||
(cd $(TARGET_SUBDIR)/libphobos && \
|
||||
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
|
||||
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
|
||||
"RANLIB=$${RANLIB}" \
|
||||
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
|
||||
maintainer-clean) \
|
||||
|| exit 1
|
||||
|
||||
@endif target-libphobos
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.PHONY: configure-target-libtermcap maybe-configure-target-libtermcap
|
||||
maybe-configure-target-libtermcap:
|
||||
@if gcc-bootstrap
|
||||
@ -52329,6 +52834,14 @@ check-gcc-brig:
|
||||
(cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-brig);
|
||||
check-brig: check-gcc-brig check-target-libhsail-rt
|
||||
|
||||
.PHONY: check-gcc-d check-d
|
||||
check-gcc-d:
|
||||
r=`${PWD_COMMAND}`; export r; \
|
||||
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
|
||||
$(HOST_EXPORTS) \
|
||||
(cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-d);
|
||||
check-d: check-gcc-d check-target-libphobos
|
||||
|
||||
|
||||
# The gcc part of install-no-fixedincludes, which relies on an intimate
|
||||
# knowledge of how a number of gcc internal targets (inter)operate. Delegate.
|
||||
@ -55521,6 +56034,7 @@ configure-target-libgfortran: stage_last
|
||||
configure-target-libobjc: stage_last
|
||||
configure-target-libgo: stage_last
|
||||
configure-target-libhsail-rt: stage_last
|
||||
configure-target-libphobos: stage_last
|
||||
configure-target-libtermcap: stage_last
|
||||
configure-target-winsup: stage_last
|
||||
configure-target-libgloss: stage_last
|
||||
@ -55555,6 +56069,7 @@ configure-target-libgfortran: maybe-all-gcc
|
||||
configure-target-libobjc: maybe-all-gcc
|
||||
configure-target-libgo: maybe-all-gcc
|
||||
configure-target-libhsail-rt: maybe-all-gcc
|
||||
configure-target-libphobos: maybe-all-gcc
|
||||
configure-target-libtermcap: maybe-all-gcc
|
||||
configure-target-winsup: maybe-all-gcc
|
||||
configure-target-libgloss: maybe-all-gcc
|
||||
@ -56550,6 +57065,11 @@ configure-target-libgo: maybe-configure-target-libffi
|
||||
all-target-libgo: maybe-all-target-libbacktrace
|
||||
all-target-libgo: maybe-all-target-libffi
|
||||
all-target-libgo: maybe-all-target-libatomic
|
||||
configure-target-libphobos: maybe-configure-target-libbacktrace
|
||||
configure-target-libphobos: maybe-configure-target-zlib
|
||||
all-target-libphobos: maybe-all-target-libbacktrace
|
||||
all-target-libphobos: maybe-all-target-zlib
|
||||
all-target-libphobos: maybe-all-target-libatomic
|
||||
configure-target-libstdc++-v3: maybe-configure-target-libgomp
|
||||
configure-stage1-target-libstdc++-v3: maybe-configure-stage1-target-libgomp
|
||||
configure-stage2-target-libstdc++-v3: maybe-configure-stage2-target-libgomp
|
||||
@ -56593,6 +57113,7 @@ all-stageautofeedback-target-libstdc++-v3: maybe-configure-stageautofeedback-tar
|
||||
install-target-libgo: maybe-install-target-libatomic
|
||||
install-target-libgfortran: maybe-install-target-libquadmath
|
||||
install-target-libgfortran: maybe-install-target-libgcc
|
||||
install-target-libphobos: maybe-install-target-libatomic
|
||||
install-target-libsanitizer: maybe-install-target-libstdc++-v3
|
||||
install-target-libsanitizer: maybe-install-target-libgcc
|
||||
install-target-libvtv: maybe-install-target-libstdc++-v3
|
||||
@ -56717,6 +57238,7 @@ configure-target-libgfortran: maybe-all-target-libgcc
|
||||
configure-target-libobjc: maybe-all-target-libgcc
|
||||
configure-target-libgo: maybe-all-target-libgcc
|
||||
configure-target-libhsail-rt: maybe-all-target-libgcc
|
||||
configure-target-libphobos: maybe-all-target-libgcc
|
||||
configure-target-libtermcap: maybe-all-target-libgcc
|
||||
configure-target-winsup: maybe-all-target-libgcc
|
||||
configure-target-libgloss: maybe-all-target-libgcc
|
||||
@ -56755,6 +57277,8 @@ configure-target-libgo: maybe-all-target-newlib maybe-all-target-libgloss
|
||||
|
||||
configure-target-libhsail-rt: maybe-all-target-newlib maybe-all-target-libgloss
|
||||
|
||||
configure-target-libphobos: maybe-all-target-newlib maybe-all-target-libgloss
|
||||
|
||||
configure-target-libtermcap: maybe-all-target-newlib maybe-all-target-libgloss
|
||||
|
||||
configure-target-winsup: maybe-all-target-newlib maybe-all-target-libgloss
|
||||
|
21
Makefile.tpl
21
Makefile.tpl
@ -159,6 +159,8 @@ BUILD_EXPORTS = \
|
||||
GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
|
||||
GOC="$(GOC_FOR_BUILD)"; export GOC; \
|
||||
GOCFLAGS="$(GOCFLAGS_FOR_BUILD)"; export GOCFLAGS; \
|
||||
GDC="$(GDC_FOR_BUILD)"; export GDC; \
|
||||
GDCFLAGS="$(GDCFLAGS_FOR_BUILD)"; export GDCFLAGS; \
|
||||
DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
|
||||
LD="$(LD_FOR_BUILD)"; export LD; \
|
||||
LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
|
||||
@ -195,6 +197,7 @@ HOST_EXPORTS = \
|
||||
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
|
||||
GFORTRAN="$(GFORTRAN)"; export GFORTRAN; \
|
||||
GOC="$(GOC)"; export GOC; \
|
||||
GDC="$(GDC)"; export GDC; \
|
||||
AR="$(AR)"; export AR; \
|
||||
AS="$(AS)"; export AS; \
|
||||
CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
|
||||
@ -259,6 +262,14 @@ POSTSTAGE1_HOST_EXPORTS = \
|
||||
CC_FOR_BUILD="$$CC"; export CC_FOR_BUILD; \
|
||||
$(POSTSTAGE1_CXX_EXPORT) \
|
||||
$(LTO_EXPORTS) \
|
||||
GDC="$$r/$(HOST_SUBDIR)/prev-gcc/gdc$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/ \
|
||||
-B$(build_tooldir)/bin/ $(GDC_FLAGS_FOR_TARGET) \
|
||||
-B$$r/prev-$(TARGET_SUBDIR)/libphobos/src \
|
||||
-I$$r/prev-$(TARGET_SUBDIR)/libphobos/libdruntime -I$$s/libphobos/libdruntime \
|
||||
-L$$r/prev-$(TARGET_SUBDIR)/libphobos/src/.libs \
|
||||
-L$$r/prev-$(TARGET_SUBDIR)/libphobos/libdruntime/.libs"; \
|
||||
export GDC; \
|
||||
GDC_FOR_BUILD="$$GDC"; export GDC_FOR_BUILD; \
|
||||
GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind"; export GNATBIND; \
|
||||
LDFLAGS="$(POSTSTAGE1_LDFLAGS) $(BOOT_LDFLAGS)"; export LDFLAGS; \
|
||||
HOST_LIBS="$(POSTSTAGE1_LIBS)"; export HOST_LIBS;
|
||||
@ -281,6 +292,7 @@ BASE_TARGET_EXPORTS = \
|
||||
CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
|
||||
GFORTRAN="$(GFORTRAN_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GFORTRAN; \
|
||||
GOC="$(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GOC; \
|
||||
GDC="$(GDC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GDC; \
|
||||
DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
|
||||
LD="$(COMPILER_LD_FOR_TARGET)"; export LD; \
|
||||
LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
|
||||
@ -345,6 +357,7 @@ CXX_FOR_BUILD = @CXX_FOR_BUILD@
|
||||
DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@
|
||||
GFORTRAN_FOR_BUILD = @GFORTRAN_FOR_BUILD@
|
||||
GOC_FOR_BUILD = @GOC_FOR_BUILD@
|
||||
GDC_FOR_BUILD = @GDC_FOR_BUILD@
|
||||
LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
|
||||
LD_FOR_BUILD = @LD_FOR_BUILD@
|
||||
NM_FOR_BUILD = @NM_FOR_BUILD@
|
||||
@ -402,6 +415,7 @@ STRIP = @STRIP@
|
||||
WINDRES = @WINDRES@
|
||||
WINDMC = @WINDMC@
|
||||
|
||||
GDC = @GDC@
|
||||
GNATBIND = @GNATBIND@
|
||||
GNATMAKE = @GNATMAKE@
|
||||
|
||||
@ -411,6 +425,7 @@ LIBCFLAGS = $(CFLAGS)
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
|
||||
GOCFLAGS = $(CFLAGS)
|
||||
GDCFLAGS = $(CFLAGS)
|
||||
|
||||
CREATE_GCOV = create_gcov
|
||||
|
||||
@ -497,6 +512,7 @@ CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @CXX_FOR_TARGET@
|
||||
RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@
|
||||
GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@
|
||||
GOC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GOC_FOR_TARGET@
|
||||
GDC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GDC_FOR_TARGET@
|
||||
DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
|
||||
LD_FOR_TARGET=@LD_FOR_TARGET@
|
||||
|
||||
@ -521,6 +537,7 @@ LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
|
||||
LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
|
||||
LDFLAGS_FOR_TARGET = @LDFLAGS_FOR_TARGET@
|
||||
GOCFLAGS_FOR_TARGET = -O2 -g
|
||||
GDCFLAGS_FOR_TARGET = -O2 -g
|
||||
|
||||
FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
|
||||
SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
|
||||
@ -622,6 +639,7 @@ EXTRA_HOST_FLAGS = \
|
||||
'DLLTOOL=$(DLLTOOL)' \
|
||||
'GFORTRAN=$(GFORTRAN)' \
|
||||
'GOC=$(GOC)' \
|
||||
'GDC=$(GDC)' \
|
||||
'LD=$(LD)' \
|
||||
'LIPO=$(LIPO)' \
|
||||
'NM=$(NM)' \
|
||||
@ -646,6 +664,7 @@ STAGE1_FLAGS_TO_PASS = \
|
||||
POSTSTAGE1_FLAGS_TO_PASS = \
|
||||
CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
|
||||
CXX="$${CXX}" CXX_FOR_BUILD="$${CXX_FOR_BUILD}" \
|
||||
GDC="$${GDC}" GDC_FOR_BUILD="$${GDC_FOR_BUILD}" \
|
||||
GNATBIND="$${GNATBIND}" \
|
||||
LDFLAGS="$${LDFLAGS}" \
|
||||
HOST_LIBS="$${HOST_LIBS}" \
|
||||
@ -678,6 +697,8 @@ EXTRA_TARGET_FLAGS = \
|
||||
'GFORTRAN=$$(GFORTRAN_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
|
||||
'GOC=$$(GOC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
|
||||
'GOCFLAGS=$$(GOCFLAGS_FOR_TARGET)' \
|
||||
'GDC=$$(GDC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
|
||||
'GDCFLAGS=$$(GDCFLAGS_FOR_TARGET)' \
|
||||
'LD=$(COMPILER_LD_FOR_TARGET)' \
|
||||
'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \
|
||||
'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
|
||||
|
16
config-ml.in
16
config-ml.in
@ -512,6 +512,7 @@ multi-do:
|
||||
prefix="$(prefix)" \
|
||||
exec_prefix="$(exec_prefix)" \
|
||||
GOCFLAGS="$(GOCFLAGS) $${flags}" \
|
||||
GDCFLAGS="$(GDCFLAGS) $${flags}" \
|
||||
CXXFLAGS="$(CXXFLAGS) $${flags}" \
|
||||
LIBCFLAGS="$(LIBCFLAGS) $${flags}" \
|
||||
LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \
|
||||
@ -745,7 +746,7 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" F77="${F77_}$flags" GFORTRAN="${GFORTRAN_}$flags" GOC="${GOC_}$flags"'
|
||||
ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" F77="${F77_}$flags" GFORTRAN="${GFORTRAN_}$flags" GOC="${GOC_}$flags" GDC="${GDC_}$flags"'
|
||||
|
||||
if [ "${with_target_subdir}" = "." ]; then
|
||||
CC_=$CC' '
|
||||
@ -753,6 +754,7 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
|
||||
F77_=$F77' '
|
||||
GFORTRAN_=$GFORTRAN' '
|
||||
GOC_=$GOC' '
|
||||
GDC_=$GDC' '
|
||||
else
|
||||
# Create a regular expression that matches any string as long
|
||||
# as ML_POPDIR.
|
||||
@ -817,6 +819,18 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
|
||||
esac
|
||||
done
|
||||
|
||||
GDC_=
|
||||
for arg in ${GDC}; do
|
||||
case $arg in
|
||||
-[BIL]"${ML_POPDIR}"/*)
|
||||
GDC_="${GDC_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
|
||||
"${ML_POPDIR}"/*)
|
||||
GDC_="${GDC_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
|
||||
*)
|
||||
GDC_="${GDC_}${arg} " ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test "x${LD_LIBRARY_PATH+set}" = xset; then
|
||||
LD_LIBRARY_PATH_=
|
||||
for arg in `echo "$LD_LIBRARY_PATH" | tr ':' ' '`; do
|
||||
|
@ -1,3 +1,7 @@
|
||||
2018-10-28 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* multi.m4: Set GDC.
|
||||
|
||||
2018-07-05 James Clarke <jrtc27@jrtc27.com>
|
||||
|
||||
* dfp.m4 (enable_decimal_float): Enable for x86_64*-*-gnu* to
|
||||
|
@ -64,4 +64,5 @@ multi_basedir="$multi_basedir"
|
||||
CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
|
||||
CC="$CC"
|
||||
CXX="$CXX"
|
||||
GFORTRAN="$GFORTRAN"])])dnl
|
||||
GFORTRAN="$GFORTRAN"
|
||||
GDC="$GDC"])])dnl
|
||||
|
217
configure
vendored
217
configure
vendored
@ -580,6 +580,7 @@ LD_FOR_TARGET
|
||||
DLLTOOL_FOR_TARGET
|
||||
AS_FOR_TARGET
|
||||
AR_FOR_TARGET
|
||||
GDC_FOR_TARGET
|
||||
GOC_FOR_TARGET
|
||||
GFORTRAN_FOR_TARGET
|
||||
GCC_FOR_TARGET
|
||||
@ -612,6 +613,7 @@ RANLIB_FOR_BUILD
|
||||
NM_FOR_BUILD
|
||||
LD_FOR_BUILD
|
||||
LDFLAGS_FOR_BUILD
|
||||
GDC_FOR_BUILD
|
||||
GOC_FOR_BUILD
|
||||
GFORTRAN_FOR_BUILD
|
||||
DLLTOOL_FOR_BUILD
|
||||
@ -830,6 +832,7 @@ CXX_FOR_TARGET
|
||||
GCC_FOR_TARGET
|
||||
GFORTRAN_FOR_TARGET
|
||||
GOC_FOR_TARGET
|
||||
GDC_FOR_TARGET
|
||||
AR_FOR_TARGET
|
||||
AS_FOR_TARGET
|
||||
DLLTOOL_FOR_TARGET
|
||||
@ -1613,6 +1616,8 @@ Some influential environment variables:
|
||||
GFORTRAN for the target
|
||||
GOC_FOR_TARGET
|
||||
GOC for the target
|
||||
GDC_FOR_TARGET
|
||||
GDC for the target
|
||||
AR_FOR_TARGET
|
||||
AR for the target
|
||||
AS_FOR_TARGET
|
||||
@ -2764,7 +2769,8 @@ target_libraries="target-libgcc \
|
||||
target-libffi \
|
||||
target-libobjc \
|
||||
target-libada \
|
||||
target-libgo"
|
||||
target-libgo \
|
||||
target-libphobos"
|
||||
|
||||
# these tools are built using the target libraries, and are intended to
|
||||
# run only in the target environment
|
||||
@ -3920,6 +3926,7 @@ if test "${build}" != "${host}" ; then
|
||||
CXX_FOR_BUILD=${CXX_FOR_BUILD-g++}
|
||||
GFORTRAN_FOR_BUILD=${GFORTRAN_FOR_BUILD-gfortran}
|
||||
GOC_FOR_BUILD=${GOC_FOR_BUILD-gccgo}
|
||||
GDC_FOR_BUILD=${GDC_FOR_BUILD-gdc}
|
||||
DLLTOOL_FOR_BUILD=${DLLTOOL_FOR_BUILD-dlltool}
|
||||
LD_FOR_BUILD=${LD_FOR_BUILD-ld}
|
||||
NM_FOR_BUILD=${NM_FOR_BUILD-nm}
|
||||
@ -3933,6 +3940,7 @@ else
|
||||
CXX_FOR_BUILD="\$(CXX)"
|
||||
GFORTRAN_FOR_BUILD="\$(GFORTRAN)"
|
||||
GOC_FOR_BUILD="\$(GOC)"
|
||||
GDC_FOR_BUILD="\$(GDC)"
|
||||
DLLTOOL_FOR_BUILD="\$(DLLTOOL)"
|
||||
LD_FOR_BUILD="\$(LD)"
|
||||
NM_FOR_BUILD="\$(NM)"
|
||||
@ -7650,6 +7658,7 @@ done
|
||||
|
||||
|
||||
|
||||
|
||||
# Generate default definitions for YACC, M4, LEX and other programs that run
|
||||
# on the build machine. These are used if the Makefile can't locate these
|
||||
# programs in objdir.
|
||||
@ -10704,6 +10713,167 @@ fi
|
||||
|
||||
|
||||
|
||||
if test -n "$GDC_FOR_TARGET"; then
|
||||
ac_cv_prog_GDC_FOR_TARGET=$GDC_FOR_TARGET
|
||||
elif test -n "$ac_cv_prog_GDC_FOR_TARGET"; then
|
||||
GDC_FOR_TARGET=$ac_cv_prog_GDC_FOR_TARGET
|
||||
fi
|
||||
|
||||
if test -n "$ac_cv_prog_GDC_FOR_TARGET"; then
|
||||
for ncn_progname in gdc; do
|
||||
# Extract the first word of "${ncn_progname}", so it can be a program name with args.
|
||||
set dummy ${ncn_progname}; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
$as_echo_n "checking for $ac_word... " >&6; }
|
||||
if test "${ac_cv_prog_GDC_FOR_TARGET+set}" = set; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
if test -n "$GDC_FOR_TARGET"; then
|
||||
ac_cv_prog_GDC_FOR_TARGET="$GDC_FOR_TARGET" # Let the user override the test.
|
||||
else
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
ac_cv_prog_GDC_FOR_TARGET="${ncn_progname}"
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS=$as_save_IFS
|
||||
|
||||
fi
|
||||
fi
|
||||
GDC_FOR_TARGET=$ac_cv_prog_GDC_FOR_TARGET
|
||||
if test -n "$GDC_FOR_TARGET"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GDC_FOR_TARGET" >&5
|
||||
$as_echo "$GDC_FOR_TARGET" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
done
|
||||
fi
|
||||
|
||||
if test -z "$ac_cv_prog_GDC_FOR_TARGET" && test -n "$with_build_time_tools"; then
|
||||
for ncn_progname in gdc; do
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ncn_progname} in $with_build_time_tools" >&5
|
||||
$as_echo_n "checking for ${ncn_progname} in $with_build_time_tools... " >&6; }
|
||||
if test -x $with_build_time_tools/${ncn_progname}; then
|
||||
ac_cv_prog_GDC_FOR_TARGET=$with_build_time_tools/${ncn_progname}
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
break
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if test -z "$ac_cv_prog_GDC_FOR_TARGET"; then
|
||||
for ncn_progname in gdc; do
|
||||
if test -n "$ncn_target_tool_prefix"; then
|
||||
# Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
|
||||
set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
$as_echo_n "checking for $ac_word... " >&6; }
|
||||
if test "${ac_cv_prog_GDC_FOR_TARGET+set}" = set; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
if test -n "$GDC_FOR_TARGET"; then
|
||||
ac_cv_prog_GDC_FOR_TARGET="$GDC_FOR_TARGET" # Let the user override the test.
|
||||
else
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
ac_cv_prog_GDC_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}"
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS=$as_save_IFS
|
||||
|
||||
fi
|
||||
fi
|
||||
GDC_FOR_TARGET=$ac_cv_prog_GDC_FOR_TARGET
|
||||
if test -n "$GDC_FOR_TARGET"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GDC_FOR_TARGET" >&5
|
||||
$as_echo "$GDC_FOR_TARGET" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
if test -z "$ac_cv_prog_GDC_FOR_TARGET" && test $build = $target ; then
|
||||
# Extract the first word of "${ncn_progname}", so it can be a program name with args.
|
||||
set dummy ${ncn_progname}; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
$as_echo_n "checking for $ac_word... " >&6; }
|
||||
if test "${ac_cv_prog_GDC_FOR_TARGET+set}" = set; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
if test -n "$GDC_FOR_TARGET"; then
|
||||
ac_cv_prog_GDC_FOR_TARGET="$GDC_FOR_TARGET" # Let the user override the test.
|
||||
else
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
ac_cv_prog_GDC_FOR_TARGET="${ncn_progname}"
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS=$as_save_IFS
|
||||
|
||||
fi
|
||||
fi
|
||||
GDC_FOR_TARGET=$ac_cv_prog_GDC_FOR_TARGET
|
||||
if test -n "$GDC_FOR_TARGET"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GDC_FOR_TARGET" >&5
|
||||
$as_echo "$GDC_FOR_TARGET" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
test -n "$ac_cv_prog_GDC_FOR_TARGET" && break
|
||||
done
|
||||
fi
|
||||
|
||||
if test -z "$ac_cv_prog_GDC_FOR_TARGET" ; then
|
||||
set dummy gdc
|
||||
if test $build = $target ; then
|
||||
GDC_FOR_TARGET="$2"
|
||||
else
|
||||
GDC_FOR_TARGET="${ncn_target_tool_prefix}$2"
|
||||
fi
|
||||
else
|
||||
GDC_FOR_TARGET="$ac_cv_prog_GDC_FOR_TARGET"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
cat > conftest.c << \EOF
|
||||
#ifdef __GNUC__
|
||||
gcc_yay;
|
||||
@ -14100,6 +14270,51 @@ $as_echo "pre-installed" >&6; }
|
||||
fi
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target gdc" >&5
|
||||
$as_echo_n "checking where to find the target gdc... " >&6; }
|
||||
if test "x${build}" != "x${host}" ; then
|
||||
if expr "x$GDC_FOR_TARGET" : "x/" > /dev/null; then
|
||||
# We already found the complete path
|
||||
ac_dir=`dirname $GDC_FOR_TARGET`
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed in $ac_dir" >&5
|
||||
$as_echo "pre-installed in $ac_dir" >&6; }
|
||||
else
|
||||
# Canadian cross, just use what we found
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed" >&5
|
||||
$as_echo "pre-installed" >&6; }
|
||||
fi
|
||||
else
|
||||
ok=yes
|
||||
case " ${configdirs} " in
|
||||
*" gcc "*) ;;
|
||||
*) ok=no ;;
|
||||
esac
|
||||
case ,${enable_languages}, in
|
||||
*,d,*) ;;
|
||||
*) ok=no ;;
|
||||
esac
|
||||
if test $ok = yes; then
|
||||
# An in-tree tool is available and we can use it
|
||||
GDC_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/gdc -B$$r/$(HOST_SUBDIR)/gcc/'
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: just compiled" >&5
|
||||
$as_echo "just compiled" >&6; }
|
||||
elif expr "x$GDC_FOR_TARGET" : "x/" > /dev/null; then
|
||||
# We already found the complete path
|
||||
ac_dir=`dirname $GDC_FOR_TARGET`
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed in $ac_dir" >&5
|
||||
$as_echo "pre-installed in $ac_dir" >&6; }
|
||||
elif test "x$target" = "x$host"; then
|
||||
# We can use an host tool
|
||||
GDC_FOR_TARGET='$(GDC)'
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: host tool" >&5
|
||||
$as_echo "host tool" >&6; }
|
||||
else
|
||||
# We need a cross tool
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed" >&5
|
||||
$as_echo "pre-installed" >&6; }
|
||||
fi
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target ld" >&5
|
||||
$as_echo_n "checking where to find the target ld... " >&6; }
|
||||
if test "x${build}" != "x${host}" ; then
|
||||
|
@ -163,7 +163,8 @@ target_libraries="target-libgcc \
|
||||
target-libffi \
|
||||
target-libobjc \
|
||||
target-libada \
|
||||
target-libgo"
|
||||
target-libgo \
|
||||
target-libphobos"
|
||||
|
||||
# these tools are built using the target libraries, and are intended to
|
||||
# run only in the target environment
|
||||
@ -1235,6 +1236,7 @@ if test "${build}" != "${host}" ; then
|
||||
CXX_FOR_BUILD=${CXX_FOR_BUILD-g++}
|
||||
GFORTRAN_FOR_BUILD=${GFORTRAN_FOR_BUILD-gfortran}
|
||||
GOC_FOR_BUILD=${GOC_FOR_BUILD-gccgo}
|
||||
GDC_FOR_BUILD=${GDC_FOR_BUILD-gdc}
|
||||
DLLTOOL_FOR_BUILD=${DLLTOOL_FOR_BUILD-dlltool}
|
||||
LD_FOR_BUILD=${LD_FOR_BUILD-ld}
|
||||
NM_FOR_BUILD=${NM_FOR_BUILD-nm}
|
||||
@ -1248,6 +1250,7 @@ else
|
||||
CXX_FOR_BUILD="\$(CXX)"
|
||||
GFORTRAN_FOR_BUILD="\$(GFORTRAN)"
|
||||
GOC_FOR_BUILD="\$(GOC)"
|
||||
GDC_FOR_BUILD="\$(GDC)"
|
||||
DLLTOOL_FOR_BUILD="\$(DLLTOOL)"
|
||||
LD_FOR_BUILD="\$(LD)"
|
||||
NM_FOR_BUILD="\$(NM)"
|
||||
@ -3235,6 +3238,7 @@ AC_SUBST(CXX_FOR_BUILD)
|
||||
AC_SUBST(DLLTOOL_FOR_BUILD)
|
||||
AC_SUBST(GFORTRAN_FOR_BUILD)
|
||||
AC_SUBST(GOC_FOR_BUILD)
|
||||
AC_SUBST(GDC_FOR_BUILD)
|
||||
AC_SUBST(LDFLAGS_FOR_BUILD)
|
||||
AC_SUBST(LD_FOR_BUILD)
|
||||
AC_SUBST(NM_FOR_BUILD)
|
||||
@ -3344,6 +3348,7 @@ NCN_STRICT_CHECK_TARGET_TOOLS(CXX_FOR_TARGET, c++ g++ cxx gxx)
|
||||
NCN_STRICT_CHECK_TARGET_TOOLS(GCC_FOR_TARGET, gcc, ${CC_FOR_TARGET})
|
||||
NCN_STRICT_CHECK_TARGET_TOOLS(GFORTRAN_FOR_TARGET, gfortran)
|
||||
NCN_STRICT_CHECK_TARGET_TOOLS(GOC_FOR_TARGET, gccgo)
|
||||
NCN_STRICT_CHECK_TARGET_TOOLS(GDC_FOR_TARGET, gdc)
|
||||
|
||||
ACX_CHECK_INSTALLED_TARGET_TOOL(AR_FOR_TARGET, ar)
|
||||
ACX_CHECK_INSTALLED_TARGET_TOOL(AS_FOR_TARGET, as)
|
||||
@ -3377,6 +3382,8 @@ GCC_TARGET_TOOL(gfortran, GFORTRAN_FOR_TARGET, GFORTRAN,
|
||||
[gcc/gfortran -B$$r/$(HOST_SUBDIR)/gcc/], fortran)
|
||||
GCC_TARGET_TOOL(gccgo, GOC_FOR_TARGET, GOC,
|
||||
[gcc/gccgo -B$$r/$(HOST_SUBDIR)/gcc/], go)
|
||||
GCC_TARGET_TOOL(gdc, GDC_FOR_TARGET, GDC,
|
||||
[gcc/gdc -B$$r/$(HOST_SUBDIR)/gcc/], d)
|
||||
GCC_TARGET_TOOL(ld, LD_FOR_TARGET, LD, [ld/ld-new])
|
||||
GCC_TARGET_TOOL(lipo, LIPO_FOR_TARGET, LIPO)
|
||||
GCC_TARGET_TOOL(nm, NM_FOR_TARGET, NM, [binutils/nm-new])
|
||||
|
102
gcc/ChangeLog
102
gcc/ChangeLog
@ -1,3 +1,105 @@
|
||||
2018-10-28 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* Makefile.in (tm_d_file_list, tm_d_include_list): New variables.
|
||||
(TM_D_H, D_TARGET_DEF, D_TARGET_H, D_TARGET_OBJS): New variables.
|
||||
(tm_d.h, cs-tm_d.h, default-d.o): New rules.
|
||||
(d/d-target-hooks-def.h, s-d-target-hooks-def-h): New rules.
|
||||
(s-tm-texi): Also check timestamp on d-target.def.
|
||||
(generated_files): Add TM_D_H and d-target-hooks-def.h.
|
||||
(build/genhooks.o): Also depend on D_TARGET_DEF.
|
||||
* config.gcc (tm_d_file, d_target_objs, target_has_targetdm): New
|
||||
variables.
|
||||
* config/aarch64/aarch64-d.c: New file.
|
||||
* config/aarch64/aarch64-linux.h (GNU_USER_TARGET_D_CRITSEC_SIZE):
|
||||
Define.
|
||||
* config/aarch64/aarch64-protos.h (aarch64_d_target_versions): New
|
||||
prototype.
|
||||
* config/aarch64/aarch64.h (TARGET_D_CPU_VERSIONS): Define.
|
||||
* config/aarch64/t-aarch64 (aarch64-d.o): New rule.
|
||||
* config/arm/arm-d.c: New file.
|
||||
* config/arm/arm-protos.h (arm_d_target_versions): New prototype.
|
||||
* config/arm/arm.h (TARGET_D_CPU_VERSIONS): Define.
|
||||
* config/arm/linux-eabi.h (EXTRA_TARGET_D_OS_VERSIONS): Define.
|
||||
* config/arm/t-arm (arm-d.o): New rule.
|
||||
* config/default-d.c: New file.
|
||||
* config/glibc-d.c: New file.
|
||||
* config/gnu.h (GNU_USER_TARGET_D_OS_VERSIONS): Define.
|
||||
* config/i386/i386-d.c: New file.
|
||||
* config/i386/i386-protos.h (ix86_d_target_versions): New prototype.
|
||||
* config/i386/i386.h (TARGET_D_CPU_VERSIONS): Define.
|
||||
* config/i386/linux-common.h (EXTRA_TARGET_D_OS_VERSIONS): Define.
|
||||
(GNU_USER_TARGET_D_CRITSEC_SIZE): Define.
|
||||
* config/i386/t-i386 (i386-d.o): New rule.
|
||||
* config/kfreebsd-gnu.h (GNU_USER_TARGET_D_OS_VERSIONS): Define.
|
||||
* config/kopensolaris-gnu.h (GNU_USER_TARGET_D_OS_VERSIONS): Define.
|
||||
* config/linux-android.h (ANDROID_TARGET_D_OS_VERSIONS): Define.
|
||||
* config/linux.h (GNU_USER_TARGET_D_OS_VERSIONS): Define.
|
||||
* config/mips/linux-common.h (EXTRA_TARGET_D_OS_VERSIONS): Define.
|
||||
* config/mips/mips-d.c: New file.
|
||||
* config/mips/mips-protos.h (mips_d_target_versions): New prototype.
|
||||
* config/mips/mips.h (TARGET_D_CPU_VERSIONS): Define.
|
||||
* config/mips/t-mips (mips-d.o): New rule.
|
||||
* config/powerpcspe/linux.h (GNU_USER_TARGET_D_OS_VERSIONS): Define.
|
||||
* config/powerpcspe/linux64.h (GNU_USER_TARGET_D_OS_VERSIONS): Define.
|
||||
* config/powerpcspe/powerpcspe-d.c: New file.
|
||||
* config/powerpcspe/powerpcspe-protos.h (rs6000_d_target_versions):
|
||||
New prototype.
|
||||
* config/powerpcspe/powerpcspe.c (rs6000_output_function_epilogue):
|
||||
Support GNU D by using 0 as the language type.
|
||||
* config/powerpcspe/powerpcspe.h (TARGET_D_CPU_VERSIONS): Define.
|
||||
* config/powerpcspe/t-powerpcspe (powerpcspe-d.o): New rule.
|
||||
* config/riscv/riscv-d.c: New file.
|
||||
* config/riscv/riscv-protos.h (riscv_d_target_versions): New
|
||||
prototype.
|
||||
* config/riscv/riscv.h (TARGET_D_CPU_VERSIONS): Define.
|
||||
* config/riscv/t-riscv (riscv-d.o): New rule.
|
||||
* config/rs6000/linux.h (GNU_USER_TARGET_D_OS_VERSIONS): Define.
|
||||
* config/rs6000/linux64.h (GNU_USER_TARGET_D_OS_VERSIONS): Define.
|
||||
* config/rs6000/rs6000-d.c: New file.
|
||||
* config/rs6000/rs6000-protos.h (rs6000_d_target_versions): New
|
||||
prototype.
|
||||
* config/rs6000/rs6000.c (rs6000_output_function_epilogue):
|
||||
Support GNU D by using 0 as the language type.
|
||||
* config/rs6000/rs6000.h (TARGET_D_CPU_VERSIONS): Define.
|
||||
* config/rs6000/t-rs6000 (rs6000-d.o): New rule.
|
||||
* config/s390/s390-d.c: New file.
|
||||
* config/s390/s390-protos.h (s390_d_target_versions): New prototype.
|
||||
* config/s390/s390.h (TARGET_D_CPU_VERSIONS): Define.
|
||||
* config/s390/t-s390 (s390-d.o): New rule.
|
||||
* config/sparc/sparc-d.c: New file.
|
||||
* config/sparc/sparc-protos.h (sparc_d_target_versions): New
|
||||
prototype.
|
||||
* config/sparc/sparc.h (TARGET_D_CPU_VERSIONS): Define.
|
||||
* config/sparc/t-sparc (sparc-d.o): New rule.
|
||||
* config/t-glibc (glibc-d.o): New rule.
|
||||
* configure: Regenerated.
|
||||
* configure.ac (tm_d_file): New variable.
|
||||
(tm_d_file_list, tm_d_include_list, d_target_objs): Add substitutes.
|
||||
* doc/contrib.texi (Contributors): Add self for the D frontend.
|
||||
* doc/frontends.texi (G++ and GCC): Mention D as a supported language.
|
||||
* doc/install.texi (Configuration): Mention libphobos as an option for
|
||||
--enable-shared. Mention d as an option for --enable-languages.
|
||||
(Testing): Mention check-d as a target.
|
||||
* doc/invoke.texi (Overall Options): Mention .d, .dd, and .di as file
|
||||
name suffixes. Mention d as a -x option.
|
||||
* doc/sourcebuild.texi (Top Level): Mention libphobos.
|
||||
* doc/standards.texi (Standards): Add section on D language.
|
||||
* doc/tm.texi: Regenerated.
|
||||
* doc/tm.texi.in: Add @node for D language and ABI, and @hook for
|
||||
TARGET_CPU_VERSIONS, TARGET_D_OS_VERSIONS, and TARGET_D_CRITSEC_SIZE.
|
||||
* dwarf2out.c (is_dlang): New function.
|
||||
(gen_compile_unit_die): Use DW_LANG_D for D.
|
||||
(declare_in_namespace): Return module die for D, instead of adding
|
||||
extra declarations into the namespace.
|
||||
(gen_namespace_die): Generate DW_TAG_module for D.
|
||||
(gen_decl_die): Handle CONST_DECLSs for D.
|
||||
(dwarf2out_decl): Likewise.
|
||||
(prune_unused_types_walk_local_classes): Handle DW_tag_interface_type.
|
||||
(prune_unused_types_walk): Handle DW_tag_interface_type same as other
|
||||
kinds of aggregates.
|
||||
* gcc.c (default_compilers): Add entries for .d, .dd and .di.
|
||||
* genhooks.c: Include d/d-target.def.
|
||||
|
||||
2018-10-28 Iain Sandoe <iain@sandoe.co.uk>
|
||||
|
||||
PR target/85669
|
||||
|
@ -554,6 +554,8 @@ tm_include_list=@tm_include_list@
|
||||
tm_defines=@tm_defines@
|
||||
tm_p_file_list=@tm_p_file_list@
|
||||
tm_p_include_list=@tm_p_include_list@
|
||||
tm_d_file_list=@tm_d_file_list@
|
||||
tm_d_include_list=@tm_d_include_list@
|
||||
build_xm_file_list=@build_xm_file_list@
|
||||
build_xm_include_list=@build_xm_include_list@
|
||||
build_xm_defines=@build_xm_defines@
|
||||
@ -848,6 +850,7 @@ BCONFIG_H = bconfig.h $(build_xm_file_list)
|
||||
CONFIG_H = config.h $(host_xm_file_list)
|
||||
TCONFIG_H = tconfig.h $(xm_file_list)
|
||||
TM_P_H = tm_p.h $(tm_p_file_list)
|
||||
TM_D_H = tm_d.h $(tm_d_file_list)
|
||||
GTM_H = tm.h $(tm_file_list) insn-constants.h
|
||||
TM_H = $(GTM_H) insn-flags.h $(OPTIONS_H)
|
||||
|
||||
@ -905,9 +908,11 @@ EXCEPT_H = except.h $(HASHTAB_H)
|
||||
TARGET_DEF = target.def target-hooks-macros.h target-insns.def
|
||||
C_TARGET_DEF = c-family/c-target.def target-hooks-macros.h
|
||||
COMMON_TARGET_DEF = common/common-target.def target-hooks-macros.h
|
||||
D_TARGET_DEF = d/d-target.def target-hooks-macros.h
|
||||
TARGET_H = $(TM_H) target.h $(TARGET_DEF) insn-modes.h insn-codes.h
|
||||
C_TARGET_H = c-family/c-target.h $(C_TARGET_DEF)
|
||||
COMMON_TARGET_H = common/common-target.h $(INPUT_H) $(COMMON_TARGET_DEF)
|
||||
D_TARGET_H = d/d-target.h $(D_TARGET_DEF)
|
||||
MACHMODE_H = machmode.h mode-classes.def
|
||||
HOOKS_H = hooks.h
|
||||
HOSTHOOKS_DEF_H = hosthooks-def.h $(HOOKS_H)
|
||||
@ -1187,6 +1192,9 @@ C_TARGET_OBJS=@c_target_objs@
|
||||
# Target specific, C++ specific object file
|
||||
CXX_TARGET_OBJS=@cxx_target_objs@
|
||||
|
||||
# Target specific, D specific object file
|
||||
D_TARGET_OBJS=@d_target_objs@
|
||||
|
||||
# Target specific, Fortran specific object file
|
||||
FORTRAN_TARGET_OBJS=@fortran_target_objs@
|
||||
|
||||
@ -1786,6 +1794,7 @@ bconfig.h: cs-bconfig.h ; @true
|
||||
tconfig.h: cs-tconfig.h ; @true
|
||||
tm.h: cs-tm.h ; @true
|
||||
tm_p.h: cs-tm_p.h ; @true
|
||||
tm_d.h: cs-tm_d.h ; @true
|
||||
|
||||
cs-config.h: Makefile
|
||||
TARGET_CPU_DEFAULT="" \
|
||||
@ -1812,6 +1821,11 @@ cs-tm_p.h: Makefile
|
||||
HEADERS="$(tm_p_include_list)" DEFINES="" \
|
||||
$(SHELL) $(srcdir)/mkconfig.sh tm_p.h
|
||||
|
||||
cs-tm_d.h: Makefile
|
||||
TARGET_CPU_DEFAULT="" \
|
||||
HEADERS="$(tm_d_include_list)" DEFINES="" \
|
||||
$(SHELL) $(srcdir)/mkconfig.sh tm_d.h
|
||||
|
||||
# Don't automatically run autoconf, since configure.ac might be accidentally
|
||||
# newer than configure. Also, this writes into the source directory which
|
||||
# might be on a read-only file system. If configured for maintainer mode
|
||||
@ -2136,6 +2150,12 @@ default-c.o: config/default-c.c
|
||||
CFLAGS-prefix.o += -DPREFIX=\"$(prefix)\" -DBASEVER=$(BASEVER_s)
|
||||
prefix.o: $(BASEVER)
|
||||
|
||||
# Files used by the D language front end.
|
||||
|
||||
default-d.o: config/default-d.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
# Language-independent files.
|
||||
|
||||
DRIVER_DEFINES = \
|
||||
@ -2432,6 +2452,15 @@ s-common-target-hooks-def-h: build/genhooks$(build_exeext)
|
||||
common/common-target-hooks-def.h
|
||||
$(STAMP) s-common-target-hooks-def-h
|
||||
|
||||
d/d-target-hooks-def.h: s-d-target-hooks-def-h; @true
|
||||
|
||||
s-d-target-hooks-def-h: build/genhooks$(build_exeext)
|
||||
$(RUN_GEN) build/genhooks$(build_exeext) "D Target Hook" \
|
||||
> tmp-d-target-hooks-def.h
|
||||
$(SHELL) $(srcdir)/../move-if-change tmp-d-target-hooks-def.h \
|
||||
d/d-target-hooks-def.h
|
||||
$(STAMP) s-d-target-hooks-def-h
|
||||
|
||||
# check if someone mistakenly only changed tm.texi.
|
||||
# We use a different pathname here to avoid a circular dependency.
|
||||
s-tm-texi: $(srcdir)/doc/../doc/tm.texi
|
||||
@ -2455,6 +2484,7 @@ s-tm-texi: build/genhooks$(build_exeext) $(srcdir)/doc/tm.texi.in
|
||||
&& ( test $(srcdir)/doc/tm.texi -nt $(srcdir)/target.def \
|
||||
|| test $(srcdir)/doc/tm.texi -nt $(srcdir)/c-family/c-target.def \
|
||||
|| test $(srcdir)/doc/tm.texi -nt $(srcdir)/common/common-target.def \
|
||||
|| test $(srcdir)/doc/tm.texi -nt $(srcdir)/d/d-target.def \
|
||||
); then \
|
||||
echo >&2 ; \
|
||||
echo You should edit $(srcdir)/doc/tm.texi.in rather than $(srcdir)/doc/tm.texi . >&2 ; \
|
||||
@ -2592,14 +2622,15 @@ s-gtype: build/gengtype$(build_exeext) $(filter-out [%], $(GTFILES)) \
|
||||
-r gtype.state
|
||||
$(STAMP) s-gtype
|
||||
|
||||
generated_files = config.h tm.h $(TM_P_H) $(TM_H) multilib.h \
|
||||
generated_files = config.h tm.h $(TM_P_H) $(TM_D_H) $(TM_H) multilib.h \
|
||||
$(simple_generated_h) specs.h \
|
||||
tree-check.h genrtl.h insn-modes.h insn-modes-inline.h \
|
||||
tm-preds.h tm-constrs.h \
|
||||
$(ALL_GTFILES_H) gtype-desc.c gtype-desc.h gcov-iov.h \
|
||||
options.h target-hooks-def.h insn-opinit.h \
|
||||
common/common-target-hooks-def.h pass-instances.def \
|
||||
c-family/c-target-hooks-def.h params.list params.options case-cfn-macros.h \
|
||||
c-family/c-target-hooks-def.h d/d-target-hooks-def.h \
|
||||
params.list params.options case-cfn-macros.h \
|
||||
cfn-operators.pd
|
||||
|
||||
#
|
||||
@ -2743,7 +2774,7 @@ build/genrecog.o : genrecog.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
|
||||
$(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) \
|
||||
$(HASH_TABLE_H) inchash.h
|
||||
build/genhooks.o : genhooks.c $(TARGET_DEF) $(C_TARGET_DEF) \
|
||||
$(COMMON_TARGET_DEF) $(BCONFIG_H) $(SYSTEM_H) errors.h
|
||||
$(COMMON_TARGET_DEF) $(D_TARGET_DEF) $(BCONFIG_H) $(SYSTEM_H) errors.h
|
||||
build/genmddump.o : genmddump.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
|
||||
$(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H)
|
||||
build/genmatch.o : genmatch.c $(BCONFIG_H) $(SYSTEM_H) \
|
||||
|
@ -86,6 +86,9 @@
|
||||
# tm_p_file Location of file with declarations for functions
|
||||
# in $out_file.
|
||||
#
|
||||
# tm_d_file A list of headers with definitions of target hook
|
||||
# macros for the D compiler.
|
||||
#
|
||||
# out_file The name of the machine description C support
|
||||
# file, if different from "$cpu_type/$cpu_type.c".
|
||||
#
|
||||
@ -139,6 +142,9 @@
|
||||
# cxx_target_objs List of extra target-dependent objects that be
|
||||
# linked into the C++ compiler only.
|
||||
#
|
||||
# d_target_objs List of extra target-dependent objects that be
|
||||
# linked into the D compiler only.
|
||||
#
|
||||
# fortran_target_objs List of extra target-dependent objects that be
|
||||
# linked into the fortran compiler only.
|
||||
#
|
||||
@ -191,6 +197,9 @@
|
||||
#
|
||||
# target_has_targetm_common Set to yes or no depending on whether the
|
||||
# target has its own definition of targetm_common.
|
||||
#
|
||||
# target_has_targetdm Set to yes or no depending on whether the target
|
||||
# has its own definition of targetdm.
|
||||
|
||||
out_file=
|
||||
common_out_file=
|
||||
@ -206,9 +215,11 @@ extra_gcc_objs=
|
||||
extra_options=
|
||||
c_target_objs=
|
||||
cxx_target_objs=
|
||||
d_target_objs=
|
||||
fortran_target_objs=
|
||||
target_has_targetcm=no
|
||||
target_has_targetm_common=yes
|
||||
target_has_targetdm=no
|
||||
tm_defines=
|
||||
xm_defines=
|
||||
# Set this to force installation and use of collect2.
|
||||
@ -305,6 +316,7 @@ aarch64*-*-*)
|
||||
extra_headers="arm_fp16.h arm_neon.h arm_acle.h"
|
||||
c_target_objs="aarch64-c.o"
|
||||
cxx_target_objs="aarch64-c.o"
|
||||
d_target_objs="aarch64-d.o"
|
||||
extra_objs="aarch64-builtins.o aarch-common.o cortex-a57-fma-steering.o aarch64-speculation.o falkor-tag-collision-avoidance.o"
|
||||
target_gtfiles="\$(srcdir)/config/aarch64/aarch64-builtins.c"
|
||||
target_has_targetm_common=yes
|
||||
@ -330,6 +342,7 @@ arm*-*-*)
|
||||
target_type_format_char='%'
|
||||
c_target_objs="arm-c.o"
|
||||
cxx_target_objs="arm-c.o"
|
||||
d_target_objs="arm-d.o"
|
||||
extra_options="${extra_options} arm/arm-tables.opt"
|
||||
target_gtfiles="\$(srcdir)/config/arm/arm-builtins.c"
|
||||
;;
|
||||
@ -362,6 +375,7 @@ i[34567]86-*-*)
|
||||
cpu_type=i386
|
||||
c_target_objs="i386-c.o"
|
||||
cxx_target_objs="i386-c.o"
|
||||
d_target_objs="i386-d.o"
|
||||
extra_objs="x86-tune-sched.o x86-tune-sched-bd.o x86-tune-sched-atom.o x86-tune-sched-core.o"
|
||||
extra_options="${extra_options} fused-madd.opt"
|
||||
extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
|
||||
@ -392,6 +406,7 @@ x86_64-*-*)
|
||||
cpu_type=i386
|
||||
c_target_objs="i386-c.o"
|
||||
cxx_target_objs="i386-c.o"
|
||||
d_target_objs="i386-d.o"
|
||||
extra_options="${extra_options} fused-madd.opt"
|
||||
extra_objs="x86-tune-sched.o x86-tune-sched-bd.o x86-tune-sched-atom.o x86-tune-sched-core.o"
|
||||
extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
|
||||
@ -442,6 +457,7 @@ microblaze*-*-*)
|
||||
;;
|
||||
mips*-*-*)
|
||||
cpu_type=mips
|
||||
d_target_objs="mips-d.o"
|
||||
extra_headers="loongson.h msa.h"
|
||||
extra_objs="frame-header-opt.o"
|
||||
extra_options="${extra_options} g.opt fused-madd.opt mips/mips-tables.opt"
|
||||
@ -498,6 +514,7 @@ powerpc*-*-*)
|
||||
riscv*)
|
||||
cpu_type=riscv
|
||||
extra_objs="riscv-builtins.o riscv-c.o"
|
||||
d_target_objs="riscv-d.o"
|
||||
;;
|
||||
rs6000*-*-*)
|
||||
extra_options="${extra_options} g.opt fused-madd.opt rs6000/rs6000-tables.opt"
|
||||
@ -507,6 +524,7 @@ sparc*-*-*)
|
||||
cpu_type=sparc
|
||||
c_target_objs="sparc-c.o"
|
||||
cxx_target_objs="sparc-c.o"
|
||||
d_target_objs="sparc-d.o"
|
||||
extra_headers="visintrin.h"
|
||||
;;
|
||||
spu*-*-*)
|
||||
@ -514,6 +532,7 @@ spu*-*-*)
|
||||
;;
|
||||
s390*-*-*)
|
||||
cpu_type=s390
|
||||
d_target_objs="s390-d.o"
|
||||
extra_options="${extra_options} fused-madd.opt"
|
||||
extra_headers="s390intrin.h htmintrin.h htmxlintrin.h vecintrin.h"
|
||||
;;
|
||||
@ -543,10 +562,13 @@ tilepro*-*-*)
|
||||
esac
|
||||
|
||||
tm_file=${cpu_type}/${cpu_type}.h
|
||||
tm_d_file=${cpu_type}/${cpu_type}.h
|
||||
if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-protos.h
|
||||
then
|
||||
tm_p_file=${cpu_type}/${cpu_type}-protos.h
|
||||
tm_d_file="${tm_d_file} ${cpu_type}/${cpu_type}-protos.h"
|
||||
fi
|
||||
|
||||
extra_modes=
|
||||
if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-modes.def
|
||||
then
|
||||
@ -810,8 +832,10 @@ case ${target} in
|
||||
esac
|
||||
c_target_objs="${c_target_objs} glibc-c.o"
|
||||
cxx_target_objs="${cxx_target_objs} glibc-c.o"
|
||||
d_target_objs="${d_target_objs} glibc-d.o"
|
||||
tmake_file="${tmake_file} t-glibc"
|
||||
target_has_targetcm=yes
|
||||
target_has_targetdm=yes
|
||||
;;
|
||||
*-*-netbsd*)
|
||||
tm_p_file="${tm_p_file} netbsd-protos.h"
|
||||
@ -3232,6 +3256,10 @@ if [ "$common_out_file" = "" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$target_has_targetdm" = "no" ]; then
|
||||
d_target_objs="$d_target_objs default-d.o"
|
||||
fi
|
||||
|
||||
# Support for --with-cpu and related options (and a few unrelated options,
|
||||
# too).
|
||||
case ${with_cpu} in
|
||||
@ -4858,6 +4886,7 @@ case ${target} in
|
||||
out_file="${cpu_type}/${cpu_type}.c"
|
||||
c_target_objs="${c_target_objs} ${cpu_type}-c.o"
|
||||
cxx_target_objs="${cxx_target_objs} ${cpu_type}-c.o"
|
||||
d_target_objs="${d_target_objs} ${cpu_type}-d.o"
|
||||
tmake_file="${cpu_type}/t-${cpu_type} ${tmake_file}"
|
||||
;;
|
||||
|
||||
|
31
gcc/config/aarch64/aarch64-d.c
Normal file
31
gcc/config/aarch64/aarch64-d.c
Normal file
@ -0,0 +1,31 @@
|
||||
/* Subroutines for the D front end on the AArch64 architecture.
|
||||
Copyright (C) 2017-2018 Free Software Foundation, Inc.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "d/d-target.h"
|
||||
#include "d/d-target-def.h"
|
||||
|
||||
/* Implement TARGET_D_CPU_VERSIONS for AArch64 targets. */
|
||||
|
||||
void
|
||||
aarch64_d_target_versions (void)
|
||||
{
|
||||
d_add_builtin_version ("AArch64");
|
||||
d_add_builtin_version ("D_HardFloat");
|
||||
}
|
@ -81,6 +81,8 @@
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define GNU_USER_TARGET_D_CRITSEC_SIZE 48
|
||||
|
||||
#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
|
||||
|
||||
/* Uninitialized common symbols in non-PIE executables, even with
|
||||
|
@ -620,6 +620,9 @@ enum aarch64_parse_opt_result aarch64_parse_extension (const char *,
|
||||
std::string aarch64_get_extension_string_for_isa_flags (unsigned long,
|
||||
unsigned long);
|
||||
|
||||
/* Defined in aarch64-d.c */
|
||||
extern void aarch64_d_target_versions (void);
|
||||
|
||||
rtl_opt_pass *make_pass_fma_steering (gcc::context *);
|
||||
rtl_opt_pass *make_pass_track_speculation (gcc::context *);
|
||||
rtl_opt_pass *make_pass_tag_collision_avoidance (gcc::context *);
|
||||
|
@ -26,6 +26,9 @@
|
||||
#define TARGET_CPU_CPP_BUILTINS() \
|
||||
aarch64_cpu_cpp_builtins (pfile)
|
||||
|
||||
/* Target CPU versions for D. */
|
||||
#define TARGET_D_CPU_VERSIONS aarch64_d_target_versions
|
||||
|
||||
|
||||
|
||||
#define REGISTER_TARGET_PRAGMAS() aarch64_register_pragmas ()
|
||||
|
@ -56,6 +56,10 @@ aarch64-c.o: $(srcdir)/config/aarch64/aarch64-c.c $(CONFIG_H) $(SYSTEM_H) \
|
||||
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
|
||||
$(srcdir)/config/aarch64/aarch64-c.c
|
||||
|
||||
aarch64-d.o: $(srcdir)/config/aarch64/aarch64-d.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
PASSES_EXTRA += $(srcdir)/config/aarch64/aarch64-passes.def
|
||||
|
||||
cortex-a57-fma-steering.o: $(srcdir)/config/aarch64/cortex-a57-fma-steering.c \
|
||||
|
53
gcc/config/arm/arm-d.c
Normal file
53
gcc/config/arm/arm-d.c
Normal file
@ -0,0 +1,53 @@
|
||||
/* Subroutines for the D front end on the ARM architecture.
|
||||
Copyright (C) 2017-2018 Free Software Foundation, Inc.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "tm_p.h"
|
||||
#include "d/d-target.h"
|
||||
#include "d/d-target-def.h"
|
||||
|
||||
/* Implement TARGET_D_CPU_VERSIONS for ARM targets. */
|
||||
|
||||
void
|
||||
arm_d_target_versions (void)
|
||||
{
|
||||
d_add_builtin_version ("ARM");
|
||||
|
||||
if (TARGET_THUMB || TARGET_THUMB2)
|
||||
{
|
||||
d_add_builtin_version ("Thumb");
|
||||
d_add_builtin_version ("ARM_Thumb");
|
||||
}
|
||||
|
||||
if (TARGET_HARD_FLOAT_ABI)
|
||||
d_add_builtin_version ("ARM_HardFloat");
|
||||
else
|
||||
{
|
||||
if (TARGET_SOFT_FLOAT)
|
||||
d_add_builtin_version ("ARM_SoftFloat");
|
||||
else if (TARGET_HARD_FLOAT)
|
||||
d_add_builtin_version ("ARM_SoftFP");
|
||||
}
|
||||
|
||||
if (TARGET_SOFT_FLOAT)
|
||||
d_add_builtin_version ("D_SoftFloat");
|
||||
else if (TARGET_HARD_FLOAT)
|
||||
d_add_builtin_version ("D_HardFloat");
|
||||
}
|
@ -375,6 +375,9 @@ extern void arm_lang_object_attributes_init (void);
|
||||
extern void arm_register_target_pragmas (void);
|
||||
extern void arm_cpu_cpp_builtins (struct cpp_reader *);
|
||||
|
||||
/* Defined in arm-d.c */
|
||||
extern void arm_d_target_versions (void);
|
||||
|
||||
extern bool arm_is_constant_pool_ref (rtx);
|
||||
|
||||
/* The bits in this mask specify which instruction scheduling options should
|
||||
|
@ -47,6 +47,9 @@ extern char arm_arch_name[];
|
||||
/* Target CPU builtins. */
|
||||
#define TARGET_CPU_CPP_BUILTINS() arm_cpu_cpp_builtins (pfile)
|
||||
|
||||
/* Target CPU versions for D. */
|
||||
#define TARGET_D_CPU_VERSIONS arm_d_target_versions
|
||||
|
||||
#include "config/arm/arm-opts.h"
|
||||
|
||||
/* The processor for which instructions should be scheduled. */
|
||||
|
@ -30,6 +30,9 @@
|
||||
} \
|
||||
while (false)
|
||||
|
||||
#define EXTRA_TARGET_D_OS_VERSIONS() \
|
||||
ANDROID_TARGET_D_OS_VERSIONS();
|
||||
|
||||
/* We default to a soft-float ABI so that binaries can run on all
|
||||
target hardware. If you override this to use the hard-float ABI then
|
||||
change the setting of GLIBC_DYNAMIC_LINKER_DEFAULT as well. */
|
||||
|
@ -152,6 +152,10 @@ arm-c.o: $(srcdir)/config/arm/arm-c.c $(CONFIG_H) $(SYSTEM_H) \
|
||||
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
|
||||
$(srcdir)/config/arm/arm-c.c
|
||||
|
||||
arm-d.o: $(srcdir)/config/arm/arm-d.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
arm-common.o: arm-cpu-cdata.h
|
||||
|
||||
driver-arm.o: arm-native.h
|
||||
|
25
gcc/config/default-d.c
Normal file
25
gcc/config/default-d.c
Normal file
@ -0,0 +1,25 @@
|
||||
/* Default D language target hooks initializer.
|
||||
Copyright (C) 2017-2018 Free Software Foundation, Inc.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm_d.h"
|
||||
#include "d/d-target.h"
|
||||
#include "d/d-target-def.h"
|
||||
|
||||
struct gcc_targetdm targetdm = TARGETDM_INITIALIZER;
|
64
gcc/config/glibc-d.c
Normal file
64
gcc/config/glibc-d.c
Normal file
@ -0,0 +1,64 @@
|
||||
/* Glibc support needed only by D front-end.
|
||||
Copyright (C) 2017-2018 Free Software Foundation, Inc.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "memmodel.h"
|
||||
#include "tm_p.h"
|
||||
#include "d/d-target.h"
|
||||
#include "d/d-target-def.h"
|
||||
|
||||
/* Implement TARGET_D_OS_VERSIONS for Glibc targets. */
|
||||
|
||||
static void
|
||||
glibc_d_os_builtins (void)
|
||||
{
|
||||
d_add_builtin_version ("Posix");
|
||||
|
||||
#define builtin_version(TXT) d_add_builtin_version (TXT)
|
||||
|
||||
#ifdef GNU_USER_TARGET_D_OS_VERSIONS
|
||||
GNU_USER_TARGET_D_OS_VERSIONS ();
|
||||
#endif
|
||||
|
||||
#ifdef EXTRA_TARGET_D_OS_VERSIONS
|
||||
EXTRA_TARGET_D_OS_VERSIONS ();
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Implement TARGET_D_CRITSEC_SIZE for Glibc targets. */
|
||||
|
||||
static unsigned
|
||||
glibc_d_critsec_size (void)
|
||||
{
|
||||
/* This is the sizeof pthread_mutex_t. */
|
||||
#ifdef GNU_USER_TARGET_D_CRITSEC_SIZE
|
||||
return GNU_USER_TARGET_D_CRITSEC_SIZE;
|
||||
#else
|
||||
return (POINTER_SIZE == 64) ? 40 : 24;
|
||||
#endif
|
||||
}
|
||||
|
||||
#undef TARGET_D_OS_VERSIONS
|
||||
#define TARGET_D_OS_VERSIONS glibc_d_os_builtins
|
||||
|
||||
#undef TARGET_D_CRITSEC_SIZE
|
||||
#define TARGET_D_CRITSEC_SIZE glibc_d_critsec_size
|
||||
|
||||
struct gcc_targetdm targetdm = TARGETDM_INITIALIZER;
|
@ -31,3 +31,9 @@ along with GCC. If not, see <http://www.gnu.org/licenses/>.
|
||||
builtin_assert ("system=unix"); \
|
||||
builtin_assert ("system=posix"); \
|
||||
} while (0)
|
||||
|
||||
#define GNU_USER_TARGET_D_OS_VERSIONS() \
|
||||
do { \
|
||||
builtin_version ("Hurd"); \
|
||||
builtin_version ("CRuntime_Glibc"); \
|
||||
} while (0)
|
||||
|
44
gcc/config/i386/i386-d.c
Normal file
44
gcc/config/i386/i386-d.c
Normal file
@ -0,0 +1,44 @@
|
||||
/* Subroutines for the D front end on the x86 architecture.
|
||||
Copyright (C) 2017-2018 Free Software Foundation, Inc.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "d/d-target.h"
|
||||
#include "d/d-target-def.h"
|
||||
|
||||
/* Implement TARGET_D_CPU_VERSIONS for x86 targets. */
|
||||
|
||||
void
|
||||
ix86_d_target_versions (void)
|
||||
{
|
||||
if (TARGET_64BIT)
|
||||
{
|
||||
d_add_builtin_version ("X86_64");
|
||||
|
||||
if (TARGET_X32)
|
||||
d_add_builtin_version ("D_X32");
|
||||
}
|
||||
else
|
||||
d_add_builtin_version ("X86");
|
||||
|
||||
if (TARGET_80387)
|
||||
d_add_builtin_version ("D_HardFloat");
|
||||
else
|
||||
d_add_builtin_version ("D_SoftFloat");
|
||||
}
|
@ -236,6 +236,9 @@ extern void ix86_expand_sse2_abs (rtx, rtx);
|
||||
extern void ix86_target_macros (void);
|
||||
extern void ix86_register_pragmas (void);
|
||||
|
||||
/* In i386-d.c */
|
||||
extern void ix86_d_target_versions (void);
|
||||
|
||||
/* In winnt.c */
|
||||
extern void i386_pe_unique_section (tree, int);
|
||||
extern void i386_pe_declare_function_type (FILE *, const char *, int);
|
||||
|
@ -718,6 +718,9 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
|
||||
/* Target Pragmas. */
|
||||
#define REGISTER_TARGET_PRAGMAS() ix86_register_pragmas ()
|
||||
|
||||
/* Target CPU versions for D. */
|
||||
#define TARGET_D_CPU_VERSIONS ix86_d_target_versions
|
||||
|
||||
#ifndef CC1_SPEC
|
||||
#define CC1_SPEC "%(cc1_cpu) "
|
||||
#endif
|
||||
|
@ -27,6 +27,12 @@ along with GCC; see the file COPYING3. If not see
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define EXTRA_TARGET_D_OS_VERSIONS() \
|
||||
ANDROID_TARGET_D_OS_VERSIONS();
|
||||
|
||||
#define GNU_USER_TARGET_D_CRITSEC_SIZE \
|
||||
(TARGET_64BIT ? (POINTER_SIZE == 64 ? 40 : 32) : 24)
|
||||
|
||||
#undef CC1_SPEC
|
||||
#define CC1_SPEC \
|
||||
LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC, \
|
||||
|
@ -40,6 +40,10 @@ x86-tune-sched-core.o: $(srcdir)/config/i386/x86-tune-sched-core.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
i386-d.o: $(srcdir)/config/i386/i386-d.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
i386.o: i386-builtin-types.inc
|
||||
|
||||
i386-builtin-types.inc: s-i386-bt ; @true
|
||||
|
@ -29,6 +29,12 @@ along with GCC; see the file COPYING3. If not see
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define GNU_USER_TARGET_D_OS_VERSIONS() \
|
||||
do { \
|
||||
builtin_version ("FreeBSD"); \
|
||||
builtin_version ("CRuntime_Glibc"); \
|
||||
} while (0)
|
||||
|
||||
#define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
|
||||
#define GNU_USER_DYNAMIC_LINKER32 GLIBC_DYNAMIC_LINKER32
|
||||
#define GNU_USER_DYNAMIC_LINKER64 GLIBC_DYNAMIC_LINKER64
|
||||
|
@ -30,5 +30,11 @@ along with GCC; see the file COPYING3. If not see
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define GNU_USER_TARGET_D_OS_VERSIONS() \
|
||||
do { \
|
||||
builtin_version ("Solaris"); \
|
||||
builtin_version ("CRuntime_Glibc"); \
|
||||
} while (0)
|
||||
|
||||
#undef GNU_USER_DYNAMIC_LINKER
|
||||
#define GNU_USER_DYNAMIC_LINKER "/lib/ld.so.1"
|
||||
|
@ -25,6 +25,12 @@
|
||||
builtin_define ("__ANDROID__"); \
|
||||
} while (0)
|
||||
|
||||
#define ANDROID_TARGET_D_OS_VERSIONS() \
|
||||
do { \
|
||||
if (TARGET_ANDROID) \
|
||||
builtin_version ("Android"); \
|
||||
} while (0)
|
||||
|
||||
#if ANDROID_DEFAULT
|
||||
# define NOANDROID "mno-android"
|
||||
#else
|
||||
|
@ -53,6 +53,19 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
builtin_assert ("system=posix"); \
|
||||
} while (0)
|
||||
|
||||
#define GNU_USER_TARGET_D_OS_VERSIONS() \
|
||||
do { \
|
||||
builtin_version ("linux"); \
|
||||
if (OPTION_GLIBC) \
|
||||
builtin_version ("CRuntime_Glibc"); \
|
||||
else if (OPTION_UCLIBC) \
|
||||
builtin_version ("CRuntime_UClibc"); \
|
||||
else if (OPTION_BIONIC) \
|
||||
builtin_version ("CRuntime_Bionic"); \
|
||||
else if (OPTION_MUSL) \
|
||||
builtin_version ("CRuntime_Musl"); \
|
||||
} while (0)
|
||||
|
||||
/* Determine which dynamic linker to use depending on whether GLIBC or
|
||||
uClibc or Bionic or musl is the default C library and whether
|
||||
-muclibc or -mglibc or -mbionic or -mmusl has been passed to change
|
||||
|
@ -27,6 +27,9 @@ along with GCC; see the file COPYING3. If not see
|
||||
ANDROID_TARGET_OS_CPP_BUILTINS(); \
|
||||
} while (0)
|
||||
|
||||
#define EXTRA_TARGET_D_OS_VERSIONS() \
|
||||
ANDROID_TARGET_D_OS_VERSIONS();
|
||||
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC \
|
||||
LINUX_OR_ANDROID_LD (GNU_USER_TARGET_LINK_SPEC, \
|
||||
|
56
gcc/config/mips/mips-d.c
Normal file
56
gcc/config/mips/mips-d.c
Normal file
@ -0,0 +1,56 @@
|
||||
/* Subroutines for the D front end on the MIPS architecture.
|
||||
Copyright (C) 2017-2018 Free Software Foundation, Inc.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "d/d-target.h"
|
||||
#include "d/d-target-def.h"
|
||||
|
||||
/* Implement TARGET_D_CPU_VERSIONS for MIPS targets. */
|
||||
|
||||
void
|
||||
mips_d_target_versions (void)
|
||||
{
|
||||
if (TARGET_64BIT)
|
||||
d_add_builtin_version ("MIPS64");
|
||||
else
|
||||
d_add_builtin_version ("MIPS32");
|
||||
|
||||
if (mips_abi == ABI_32)
|
||||
d_add_builtin_version ("MIPS_O32");
|
||||
else if (mips_abi == ABI_EABI)
|
||||
d_add_builtin_version ("MIPS_EABI");
|
||||
else if (mips_abi == ABI_N32)
|
||||
d_add_builtin_version ("MIPS_N32");
|
||||
else if (mips_abi == ABI_64)
|
||||
d_add_builtin_version ("MIPS_N64");
|
||||
else if (mips_abi == ABI_O64)
|
||||
d_add_builtin_version ("MIPS_O64");
|
||||
|
||||
if (TARGET_HARD_FLOAT_ABI)
|
||||
{
|
||||
d_add_builtin_version ("MIPS_HardFloat");
|
||||
d_add_builtin_version ("D_HardFloat");
|
||||
}
|
||||
else if (TARGET_SOFT_FLOAT_ABI)
|
||||
{
|
||||
d_add_builtin_version ("MIPS_SoftFloat");
|
||||
d_add_builtin_version ("D_SoftFloat");
|
||||
}
|
||||
}
|
@ -385,4 +385,7 @@ extern mulsidi3_gen_fn mips_mulsidi3_gen_fn (enum rtx_code);
|
||||
extern void mips_register_frame_header_opt (void);
|
||||
extern void mips_expand_vec_cond_expr (machine_mode, machine_mode, rtx *);
|
||||
|
||||
/* Routines implemented in mips-d.c */
|
||||
extern void mips_d_target_versions (void);
|
||||
|
||||
#endif /* ! GCC_MIPS_PROTOS_H */
|
||||
|
@ -645,6 +645,9 @@ struct mips_cpu_info {
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* Target CPU versions for D. */
|
||||
#define TARGET_D_CPU_VERSIONS mips_d_target_versions
|
||||
|
||||
/* Default target_flags if no switches are specified */
|
||||
|
||||
#ifndef TARGET_DEFAULT
|
||||
|
@ -24,3 +24,7 @@ $(srcdir)/config/mips/mips-tables.opt: $(srcdir)/config/mips/genopt.sh \
|
||||
frame-header-opt.o: $(srcdir)/config/mips/frame-header-opt.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
mips-d.o: $(srcdir)/config/mips/mips-d.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
@ -57,6 +57,19 @@
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define GNU_USER_TARGET_D_OS_VERSIONS() \
|
||||
do { \
|
||||
builtin_version ("linux"); \
|
||||
if (OPTION_GLIBC) \
|
||||
builtin_version ("CRuntime_Glibc"); \
|
||||
else if (OPTION_UCLIBC) \
|
||||
builtin_version ("CRuntime_UClibc"); \
|
||||
else if (OPTION_BIONIC) \
|
||||
builtin_version ("CRuntime_Bionic"); \
|
||||
else if (OPTION_MUSL) \
|
||||
builtin_version ("CRuntime_Musl"); \
|
||||
} while (0)
|
||||
|
||||
#undef CPP_OS_DEFAULT_SPEC
|
||||
#define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
|
||||
|
||||
|
@ -391,6 +391,19 @@ extern int dot_symbols;
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define GNU_USER_TARGET_D_OS_VERSIONS() \
|
||||
do { \
|
||||
builtin_version ("linux"); \
|
||||
if (OPTION_GLIBC) \
|
||||
builtin_version ("CRuntime_Glibc"); \
|
||||
else if (OPTION_UCLIBC) \
|
||||
builtin_version ("CRuntime_UClibc"); \
|
||||
else if (OPTION_BIONIC) \
|
||||
builtin_version ("CRuntime_Bionic"); \
|
||||
else if (OPTION_MUSL) \
|
||||
builtin_version ("CRuntime_Musl"); \
|
||||
} while (0)
|
||||
|
||||
#undef CPP_OS_DEFAULT_SPEC
|
||||
#define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux) %(include_extra)"
|
||||
|
||||
|
45
gcc/config/powerpcspe/powerpcspe-d.c
Normal file
45
gcc/config/powerpcspe/powerpcspe-d.c
Normal file
@ -0,0 +1,45 @@
|
||||
/* Subroutines for the D front end on the PowerPC architecture.
|
||||
Copyright (C) 2017-2018 Free Software Foundation, Inc.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "d/d-target.h"
|
||||
#include "d/d-target-def.h"
|
||||
|
||||
/* Implement TARGET_D_CPU_VERSIONS for PowerPC targets. */
|
||||
|
||||
void
|
||||
rs6000_d_target_versions (void)
|
||||
{
|
||||
if (TARGET_64BIT)
|
||||
d_add_builtin_version ("PPC64");
|
||||
else
|
||||
d_add_builtin_version ("PPC");
|
||||
|
||||
if (TARGET_HARD_FLOAT)
|
||||
{
|
||||
d_add_builtin_version ("PPC_HardFloat");
|
||||
d_add_builtin_version ("D_HardFloat");
|
||||
}
|
||||
else if (TARGET_SOFT_FLOAT)
|
||||
{
|
||||
d_add_builtin_version ("PPC_SoftFloat");
|
||||
d_add_builtin_version ("D_SoftFloat");
|
||||
}
|
||||
}
|
@ -231,6 +231,9 @@ extern void rs6000_target_modify_macros (bool, HOST_WIDE_INT, HOST_WIDE_INT);
|
||||
extern void (*rs6000_target_modify_macros_ptr) (bool, HOST_WIDE_INT,
|
||||
HOST_WIDE_INT);
|
||||
|
||||
/* Declare functions in powerpcspe-d.c */
|
||||
extern void rs6000_d_target_versions (void);
|
||||
|
||||
#if TARGET_MACHO
|
||||
char *output_call (rtx_insn *, rtx *, int, int);
|
||||
#endif
|
||||
|
@ -31965,11 +31965,12 @@ rs6000_output_function_epilogue (FILE *file)
|
||||
use language_string.
|
||||
C is 0. Fortran is 1. Ada is 3. C++ is 9.
|
||||
Java is 13. Objective-C is 14. Objective-C++ isn't assigned
|
||||
a number, so for now use 9. LTO, Go and JIT aren't assigned numbers
|
||||
either, so for now use 0. */
|
||||
a number, so for now use 9. LTO, Go, D and JIT aren't assigned
|
||||
numbers either, so for now use 0. */
|
||||
if (lang_GNU_C ()
|
||||
|| ! strcmp (language_string, "GNU GIMPLE")
|
||||
|| ! strcmp (language_string, "GNU Go")
|
||||
|| ! strcmp (language_string, "GNU D")
|
||||
|| ! strcmp (language_string, "libgccjit"))
|
||||
i = 0;
|
||||
else if (! strcmp (language_string, "GNU F77")
|
||||
|
@ -702,6 +702,9 @@ extern unsigned char rs6000_recip_bits[];
|
||||
#define TARGET_CPU_CPP_BUILTINS() \
|
||||
rs6000_cpu_cpp_builtins (pfile)
|
||||
|
||||
/* Target CPU versions for D. */
|
||||
#define TARGET_D_CPU_VERSIONS rs6000_d_target_versions
|
||||
|
||||
/* This is used by rs6000_cpu_cpp_builtins to indicate the byte order
|
||||
we're compiling for. Some configurations may need to override it. */
|
||||
#define RS6000_CPU_CPP_ENDIAN_BUILTINS() \
|
||||
|
@ -26,6 +26,10 @@ powerpcspe-c.o: $(srcdir)/config/powerpcspe/powerpcspe-c.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
powerpcspe-d.o: $(srcdir)/config/powerpcspe/powerpcspe-d.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
$(srcdir)/config/powerpcspe/powerpcspe-tables.opt: $(srcdir)/config/powerpcspe/genopt.sh \
|
||||
$(srcdir)/config/powerpcspe/powerpcspe-cpus.def
|
||||
$(SHELL) $(srcdir)/config/powerpcspe/genopt.sh $(srcdir)/config/powerpcspe > \
|
||||
|
39
gcc/config/riscv/riscv-d.c
Normal file
39
gcc/config/riscv/riscv-d.c
Normal file
@ -0,0 +1,39 @@
|
||||
/* Subroutines for the D front end on the RISC-V architecture.
|
||||
Copyright (C) 2017-2018 Free Software Foundation, Inc.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "target.h"
|
||||
#include "d/d-target.h"
|
||||
#include "d/d-target-def.h"
|
||||
|
||||
/* Implement TARGET_D_CPU_VERSIONS for RISC-V targets. */
|
||||
|
||||
void
|
||||
riscv_d_target_versions (void)
|
||||
{
|
||||
if (TARGET_64BIT)
|
||||
d_add_builtin_version ("RISCV64");
|
||||
else
|
||||
d_add_builtin_version ("RISCV32");
|
||||
|
||||
if (TARGET_HARD_FLOAT)
|
||||
d_add_builtin_version ("D_HardFloat");
|
||||
else
|
||||
d_add_builtin_version ("D_SoftFloat");
|
||||
}
|
@ -75,6 +75,9 @@ extern bool riscv_expand_block_move (rtx, rtx, rtx);
|
||||
/* Routines implemented in riscv-c.c. */
|
||||
void riscv_cpu_cpp_builtins (cpp_reader *);
|
||||
|
||||
/* Routines implemented in riscv-d.c */
|
||||
extern void riscv_d_target_versions (void);
|
||||
|
||||
/* Routines implemented in riscv-builtins.c. */
|
||||
extern void riscv_atomic_assign_expand_fenv (tree *, tree *, tree *);
|
||||
extern rtx riscv_expand_builtin (tree, rtx, rtx, machine_mode, int);
|
||||
|
@ -27,6 +27,9 @@ along with GCC; see the file COPYING3. If not see
|
||||
/* Target CPU builtins. */
|
||||
#define TARGET_CPU_CPP_BUILTINS() riscv_cpu_cpp_builtins (pfile)
|
||||
|
||||
/* Target CPU versions for D. */
|
||||
#define TARGET_D_CPU_VERSIONS riscv_d_target_versions
|
||||
|
||||
/* Default target_flags if no switches are specified */
|
||||
|
||||
#ifndef TARGET_DEFAULT
|
||||
|
@ -9,3 +9,8 @@ riscv-c.o: $(srcdir)/config/riscv/riscv-c.c $(CONFIG_H) $(SYSTEM_H) \
|
||||
coretypes.h $(TM_H) $(TREE_H) output.h $(C_COMMON_H) $(TARGET_H)
|
||||
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
|
||||
$(srcdir)/config/riscv/riscv-c.c
|
||||
|
||||
riscv-d.o: $(srcdir)/config/riscv/riscv-d.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
|
@ -57,6 +57,19 @@
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define GNU_USER_TARGET_D_OS_VERSIONS() \
|
||||
do { \
|
||||
builtin_version ("linux"); \
|
||||
if (OPTION_GLIBC) \
|
||||
builtin_version ("CRuntime_Glibc"); \
|
||||
else if (OPTION_UCLIBC) \
|
||||
builtin_version ("CRuntime_UClibc"); \
|
||||
else if (OPTION_BIONIC) \
|
||||
builtin_version ("CRuntime_Bionic"); \
|
||||
else if (OPTION_MUSL) \
|
||||
builtin_version ("CRuntime_Musl"); \
|
||||
} while (0)
|
||||
|
||||
#undef CPP_OS_DEFAULT_SPEC
|
||||
#define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
|
||||
|
||||
|
@ -391,6 +391,19 @@ extern int dot_symbols;
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define GNU_USER_TARGET_D_OS_VERSIONS() \
|
||||
do { \
|
||||
builtin_version ("linux"); \
|
||||
if (OPTION_GLIBC) \
|
||||
builtin_version ("CRuntime_Glibc"); \
|
||||
else if (OPTION_UCLIBC) \
|
||||
builtin_version ("CRuntime_UClibc"); \
|
||||
else if (OPTION_BIONIC) \
|
||||
builtin_version ("CRuntime_Bionic"); \
|
||||
else if (OPTION_MUSL) \
|
||||
builtin_version ("CRuntime_Musl"); \
|
||||
} while (0)
|
||||
|
||||
#undef CPP_OS_DEFAULT_SPEC
|
||||
#define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux) %(include_extra)"
|
||||
|
||||
|
45
gcc/config/rs6000/rs6000-d.c
Normal file
45
gcc/config/rs6000/rs6000-d.c
Normal file
@ -0,0 +1,45 @@
|
||||
/* Subroutines for the D front end on the PowerPC architecture.
|
||||
Copyright (C) 2017-2018 Free Software Foundation, Inc.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "d/d-target.h"
|
||||
#include "d/d-target-def.h"
|
||||
|
||||
/* Implement TARGET_D_CPU_VERSIONS for PowerPC targets. */
|
||||
|
||||
void
|
||||
rs6000_d_target_versions (void)
|
||||
{
|
||||
if (TARGET_64BIT)
|
||||
d_add_builtin_version ("PPC64");
|
||||
else
|
||||
d_add_builtin_version ("PPC");
|
||||
|
||||
if (TARGET_HARD_FLOAT)
|
||||
{
|
||||
d_add_builtin_version ("PPC_HardFloat");
|
||||
d_add_builtin_version ("D_HardFloat");
|
||||
}
|
||||
else if (TARGET_SOFT_FLOAT)
|
||||
{
|
||||
d_add_builtin_version ("PPC_SoftFloat");
|
||||
d_add_builtin_version ("D_SoftFloat");
|
||||
}
|
||||
}
|
@ -224,6 +224,9 @@ extern void rs6000_target_modify_macros (bool, HOST_WIDE_INT, HOST_WIDE_INT);
|
||||
extern void (*rs6000_target_modify_macros_ptr) (bool, HOST_WIDE_INT,
|
||||
HOST_WIDE_INT);
|
||||
|
||||
/* Declare functions in rs6000-d.c */
|
||||
extern void rs6000_d_target_versions (void);
|
||||
|
||||
#if TARGET_MACHO
|
||||
char *output_call (rtx_insn *, rtx *, int, int);
|
||||
#endif
|
||||
|
@ -28633,11 +28633,12 @@ rs6000_output_function_epilogue (FILE *file)
|
||||
use language_string.
|
||||
C is 0. Fortran is 1. Ada is 3. C++ is 9.
|
||||
Java is 13. Objective-C is 14. Objective-C++ isn't assigned
|
||||
a number, so for now use 9. LTO, Go and JIT aren't assigned numbers
|
||||
either, so for now use 0. */
|
||||
a number, so for now use 9. LTO, Go, D, and JIT aren't assigned
|
||||
numbers either, so for now use 0. */
|
||||
if (lang_GNU_C ()
|
||||
|| ! strcmp (language_string, "GNU GIMPLE")
|
||||
|| ! strcmp (language_string, "GNU Go")
|
||||
|| ! strcmp (language_string, "GNU D")
|
||||
|| ! strcmp (language_string, "libgccjit"))
|
||||
i = 0;
|
||||
else if (! strcmp (language_string, "GNU F77")
|
||||
|
@ -613,6 +613,9 @@ extern unsigned char rs6000_recip_bits[];
|
||||
#define TARGET_CPU_CPP_BUILTINS() \
|
||||
rs6000_cpu_cpp_builtins (pfile)
|
||||
|
||||
/* Target CPU versions for D. */
|
||||
#define TARGET_D_CPU_VERSIONS rs6000_d_target_versions
|
||||
|
||||
/* This is used by rs6000_cpu_cpp_builtins to indicate the byte order
|
||||
we're compiling for. Some configurations may need to override it. */
|
||||
#define RS6000_CPU_CPP_ENDIAN_BUILTINS() \
|
||||
|
@ -35,6 +35,10 @@ rs6000-p8swap.o: $(srcdir)/config/rs6000/rs6000-p8swap.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
rs6000-d.o: $(srcdir)/config/rs6000/rs6000-d.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
$(srcdir)/config/rs6000/rs6000-tables.opt: $(srcdir)/config/rs6000/genopt.sh \
|
||||
$(srcdir)/config/rs6000/rs6000-cpus.def
|
||||
$(SHELL) $(srcdir)/config/rs6000/genopt.sh $(srcdir)/config/rs6000 > \
|
||||
|
41
gcc/config/s390/s390-d.c
Normal file
41
gcc/config/s390/s390-d.c
Normal file
@ -0,0 +1,41 @@
|
||||
/* Subroutines for the D front end on the IBM S/390 and zSeries architectures.
|
||||
Copyright (C) 2017-2018 Free Software Foundation, Inc.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "d/d-target.h"
|
||||
#include "d/d-target-def.h"
|
||||
|
||||
/* Implement TARGET_D_CPU_VERSIONS for S/390 and zSeries targets. */
|
||||
|
||||
void
|
||||
s390_d_target_versions (void)
|
||||
{
|
||||
if (TARGET_ZARCH)
|
||||
d_add_builtin_version ("SystemZ");
|
||||
else if (TARGET_64BIT)
|
||||
d_add_builtin_version ("S390X");
|
||||
else
|
||||
d_add_builtin_version ("S390");
|
||||
|
||||
if (TARGET_SOFT_FLOAT)
|
||||
d_add_builtin_version ("D_SoftFloat");
|
||||
else if (TARGET_HARD_FLOAT)
|
||||
d_add_builtin_version ("D_HardFloat");
|
||||
}
|
@ -166,6 +166,9 @@ extern void s390_register_target_pragmas (void);
|
||||
/* Routines for s390-c.c */
|
||||
extern bool s390_const_operand_ok (tree, int, int, tree);
|
||||
|
||||
/* s390-d.c routines */
|
||||
extern void s390_d_target_versions (void);
|
||||
|
||||
/* Pass management. */
|
||||
namespace gcc { class context; }
|
||||
class rtl_opt_pass;
|
||||
|
@ -200,6 +200,9 @@ enum processor_flags
|
||||
/* Target CPU builtins. */
|
||||
#define TARGET_CPU_CPP_BUILTINS() s390_cpu_cpp_builtins (pfile)
|
||||
|
||||
/* Target CPU versions for D. */
|
||||
#define TARGET_D_CPU_VERSIONS s390_d_target_versions
|
||||
|
||||
#ifdef DEFAULT_TARGET_64BIT
|
||||
#define TARGET_DEFAULT (MASK_64BIT | MASK_ZARCH | MASK_HARD_DFP \
|
||||
| MASK_OPT_HTM | MASK_OPT_VX)
|
||||
|
@ -26,3 +26,7 @@ s390-c.o: $(srcdir)/config/s390/s390-c.c \
|
||||
$(TARGET_H) $(TARGET_DEF_H) $(CPPLIB_H) $(C_PRAGMA_H)
|
||||
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
|
||||
$(srcdir)/config/s390/s390-c.c
|
||||
|
||||
s390-d.o: $(srcdir)/config/s390/s390-d.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
48
gcc/config/sparc/sparc-d.c
Normal file
48
gcc/config/sparc/sparc-d.c
Normal file
@ -0,0 +1,48 @@
|
||||
/* Subroutines for the D front end on the SPARC architecture.
|
||||
Copyright (C) 2017-2018 Free Software Foundation, Inc.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "d/d-target.h"
|
||||
#include "d/d-target-def.h"
|
||||
|
||||
/* Implement TARGET_D_CPU_VERSIONS for SPARC targets. */
|
||||
|
||||
void
|
||||
sparc_d_target_versions (void)
|
||||
{
|
||||
if (TARGET_64BIT)
|
||||
d_add_builtin_version ("SPARC64");
|
||||
else
|
||||
d_add_builtin_version ("SPARC");
|
||||
|
||||
if (TARGET_V8PLUS)
|
||||
d_add_builtin_version ("SPARC_V8Plus");
|
||||
|
||||
if (TARGET_FPU)
|
||||
{
|
||||
d_add_builtin_version ("D_HardFloat");
|
||||
d_add_builtin_version ("SPARC_HardFloat");
|
||||
}
|
||||
else
|
||||
{
|
||||
d_add_builtin_version ("D_SoftFloat");
|
||||
d_add_builtin_version ("SPARC_SoftFloat");
|
||||
}
|
||||
}
|
@ -111,4 +111,7 @@ unsigned int sparc_regmode_natural_size (machine_mode);
|
||||
|
||||
extern rtl_opt_pass *make_pass_work_around_errata (gcc::context *);
|
||||
|
||||
/* Routines implemented in sparc-d.c */
|
||||
extern void sparc_d_target_versions (void);
|
||||
|
||||
#endif /* __SPARC_PROTOS_H__ */
|
||||
|
@ -27,6 +27,9 @@ along with GCC; see the file COPYING3. If not see
|
||||
|
||||
#define TARGET_CPU_CPP_BUILTINS() sparc_target_macros ()
|
||||
|
||||
/* Target CPU versions for D. */
|
||||
#define TARGET_D_CPU_VERSIONS sparc_d_target_versions
|
||||
|
||||
/* Specify this in a cover file to provide bi-architecture (32/64) support. */
|
||||
/* #define SPARC_BI_ARCH */
|
||||
|
||||
|
@ -23,3 +23,7 @@ PASSES_EXTRA += $(srcdir)/config/sparc/sparc-passes.def
|
||||
sparc-c.o: $(srcdir)/config/sparc/sparc-c.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
sparc-d.o: $(srcdir)/config/sparc/sparc-d.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
@ -19,3 +19,7 @@
|
||||
glibc-c.o: config/glibc-c.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
glibc-d.o: config/glibc-d.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
26
gcc/configure
vendored
26
gcc/configure
vendored
@ -612,6 +612,7 @@ ISLLIBS
|
||||
GMPINC
|
||||
GMPLIBS
|
||||
target_cpu_default
|
||||
d_target_objs
|
||||
fortran_target_objs
|
||||
cxx_target_objs
|
||||
c_target_objs
|
||||
@ -619,6 +620,8 @@ use_gcc_stdint
|
||||
xm_defines
|
||||
xm_include_list
|
||||
xm_file_list
|
||||
tm_d_include_list
|
||||
tm_d_file_list
|
||||
tm_p_include_list
|
||||
tm_p_file_list
|
||||
tm_defines
|
||||
@ -11858,6 +11861,7 @@ fi
|
||||
|
||||
tm_file="${tm_file} defaults.h"
|
||||
tm_p_file="${tm_p_file} tm-preds.h"
|
||||
tm_d_file="${tm_d_file} defaults.h"
|
||||
host_xm_file="auto-host.h ansidecl.h ${host_xm_file}"
|
||||
build_xm_file="${build_auto} ansidecl.h ${build_xm_file}"
|
||||
# We don't want ansidecl.h in target files, write code there in ISO/GNU C.
|
||||
@ -12241,6 +12245,21 @@ for f in $tm_p_file; do
|
||||
esac
|
||||
done
|
||||
|
||||
tm_d_file_list=
|
||||
tm_d_include_list="options.h insn-constants.h"
|
||||
for f in $tm_d_file; do
|
||||
case $f in
|
||||
defaults.h )
|
||||
tm_d_file_list="${tm_d_file_list} \$(srcdir)/$f"
|
||||
tm_d_include_list="${tm_d_include_list} $f"
|
||||
;;
|
||||
* )
|
||||
tm_d_file_list="${tm_d_file_list} \$(srcdir)/config/$f"
|
||||
tm_d_include_list="${tm_d_include_list} config/$f"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
xm_file_list=
|
||||
xm_include_list=
|
||||
for f in $xm_file; do
|
||||
@ -18510,7 +18529,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 18513 "configure"
|
||||
#line 18532 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -18616,7 +18635,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 18619 "configure"
|
||||
#line 18638 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -29504,6 +29523,9 @@ fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1752,6 +1752,7 @@ AC_SUBST(build_subdir)
|
||||
|
||||
tm_file="${tm_file} defaults.h"
|
||||
tm_p_file="${tm_p_file} tm-preds.h"
|
||||
tm_d_file="${tm_d_file} defaults.h"
|
||||
host_xm_file="auto-host.h ansidecl.h ${host_xm_file}"
|
||||
build_xm_file="${build_auto} ansidecl.h ${build_xm_file}"
|
||||
# We don't want ansidecl.h in target files, write code there in ISO/GNU C.
|
||||
@ -1984,6 +1985,21 @@ for f in $tm_p_file; do
|
||||
esac
|
||||
done
|
||||
|
||||
tm_d_file_list=
|
||||
tm_d_include_list="options.h insn-constants.h"
|
||||
for f in $tm_d_file; do
|
||||
case $f in
|
||||
defaults.h )
|
||||
tm_d_file_list="${tm_d_file_list} \$(srcdir)/$f"
|
||||
tm_d_include_list="${tm_d_include_list} $f"
|
||||
;;
|
||||
* )
|
||||
tm_d_file_list="${tm_d_file_list} \$(srcdir)/config/$f"
|
||||
tm_d_include_list="${tm_d_include_list} config/$f"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
xm_file_list=
|
||||
xm_include_list=
|
||||
for f in $xm_file; do
|
||||
@ -6343,6 +6359,8 @@ AC_SUBST(tm_include_list)
|
||||
AC_SUBST(tm_defines)
|
||||
AC_SUBST(tm_p_file_list)
|
||||
AC_SUBST(tm_p_include_list)
|
||||
AC_SUBST(tm_d_file_list)
|
||||
AC_SUBST(tm_d_include_list)
|
||||
AC_SUBST(xm_file_list)
|
||||
AC_SUBST(xm_include_list)
|
||||
AC_SUBST(xm_defines)
|
||||
@ -6350,6 +6368,7 @@ AC_SUBST(use_gcc_stdint)
|
||||
AC_SUBST(c_target_objs)
|
||||
AC_SUBST(cxx_target_objs)
|
||||
AC_SUBST(fortran_target_objs)
|
||||
AC_SUBST(d_target_objs)
|
||||
AC_SUBST(target_cpu_default)
|
||||
|
||||
AC_SUBST_FILE(language_hooks)
|
||||
|
617
gcc/d/ChangeLog
Normal file
617
gcc/d/ChangeLog
Normal file
@ -0,0 +1,617 @@
|
||||
2018-10-26 Eugene Wissner <belka@caraus.de>
|
||||
|
||||
* Make-lang.in (selftest-d): New.
|
||||
* d-diagnostic.cc (vwarning): Fix warning emitting.
|
||||
|
||||
2018-10-22 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-spec.cc (lang_specific_driver): Always link against phobos if any
|
||||
input file is given.
|
||||
|
||||
2018-10-21 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-lang.cc (d_get_alias_set): Always return zero.
|
||||
|
||||
2018-10-21 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* intrinsics.cc (maybe_set_intrinsic): Don't set built-in flag on
|
||||
unsupported pow() overloads.
|
||||
|
||||
2018-10-20 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* expr.cc (ExprVisitor::binop_assignment): Call stabilize_reference on
|
||||
LHS construct if it has side effects.
|
||||
|
||||
2018-10-20 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* intrinsics.cc (clear_intrinsic_flag): Remove function.
|
||||
(maybe_expand_intrinsic): Remove clear_intrinsic_flag call.
|
||||
|
||||
2018-10-20 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* intrinsics.cc (expand_intrinsic_copysign): Use mathfn_built_in to
|
||||
determine correct built-in to call.
|
||||
(expand_intrinsic_pow): Likewise.
|
||||
|
||||
2018-10-20 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* intrinsics.cc (expand_intrinsic_sqrt): Remove implicit int to double
|
||||
conversion.
|
||||
(expand_intrinsic_pow): Likewise.
|
||||
|
||||
2018-10-20 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (get_frame_for_symbol): Use error_at.
|
||||
(build_frame_type): Likewise.
|
||||
(get_framedecl): Likewise.
|
||||
* d-lang.cc (d_parse_file): Likewise.
|
||||
* decl.cc (DeclVisitor::visit(StructDeclaration)): Likewise.
|
||||
(DeclVisitor::finish_vtable): Likewise.
|
||||
(DeclVisitor::visit(ClassDeclaration)): Likewise.
|
||||
(DeclVisitor::visit(InterfaceDeclaration)): Likewise.
|
||||
(DeclVisitor::visit(EnumDeclaration)): Likewise.
|
||||
(DeclVisitor::visit(VarDeclaration)): Likewise.
|
||||
* toir.cc (IRVisitor::check_goto): Likewise.
|
||||
(IRVisitor::check_previous_goto): Likewise.
|
||||
(IRVisitor::visit(ThrowStatement)): Likewise.
|
||||
|
||||
2018-10-20 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (get_array_length): Use quoted format flag in message.
|
||||
(d_build_call): Likewise.
|
||||
* d-lang.cc (d_handle_option): Likewise.
|
||||
* decl.cc (DeclVisitor::finish_vtable): Likewise.
|
||||
* expr.cc (ExprVisitor::visit(ArrayLengthExp)): Likewise.
|
||||
(ExprVisitor::visit(DeleteExp)): Likewise.
|
||||
(ExprVisitor::visit(RemoveExp)): Likewise.
|
||||
(ExprVisitor::visit(RemoveExp)): Likewise.
|
||||
(ExprVisitor::visit(CallExp)): Likewise.
|
||||
(ExprVisitor::visit(DotVarExp)): Likewise.
|
||||
(ExprVisitor::visit(VarExp)): Likewise.
|
||||
(ExprVisitor::visit(ScopeExp)): Likewise.
|
||||
(ExprVisitor::visit(TypeExp)): Likewise.
|
||||
(build_expr): Likewise.
|
||||
|
||||
2018-10-20 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-diagnostic.cc (d_diagnostic_report_diagnostic): Skip translation
|
||||
by instead calling diagnostic_set_info_translated.
|
||||
|
||||
2018-10-20 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-tree.h (bool_type_node): Rename to d_bool_type.
|
||||
(byte_type_node): Rename to d_byte_type.
|
||||
(ubyte_type_node): Rename to d_ubyte_type.
|
||||
(short_type_node): Rename to d_short_type.
|
||||
(ushort_type_node): Rename to d_ushort_type.
|
||||
(int_type_node): Rename to d_int_type.
|
||||
(uint_type_node): Rename to d_uint_type.
|
||||
(long_type_node): Rename to d_long_type.
|
||||
(ulong_type_node): Rename to d_ulong_type.
|
||||
(cent_type_node): Rename to d_cent_type.
|
||||
(ucent_type_node): Rename to d_ucent_type.
|
||||
|
||||
2018-10-20 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* expr.cc (ExprVisitor::visit(PowExp)): Remove function.
|
||||
|
||||
2018-10-19 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-attribs.c: Rename to d-attribs.cc.
|
||||
* d-spec.c: Rename to d-spec.cc.
|
||||
|
||||
2018-10-19 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-lang.cc (d_gimplify_expr): Don't handle TREE_THIS_VOLATILE.
|
||||
|
||||
2018-10-19 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-diagnostic.cc (vwarning): Update to use Diagnostic enum.
|
||||
(vdeprecation): Likewise.
|
||||
(vdeprecationSupplemental): Likewise.
|
||||
* d-lang.cc (d_init_options): Explicitly set warnings and deprecations
|
||||
as DIAGNOSTICoff.
|
||||
(d_handle_option): Update to use Diagnostic enum.
|
||||
(d_post_options): Likewise.
|
||||
|
||||
2018-10-18 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-diagnostic.cc (expand_format): Rename to expand_d_format.
|
||||
Updated all callers.
|
||||
|
||||
2018-10-17 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (get_linemap): Rename function to make_location_t.
|
||||
Updated all callers.
|
||||
* d-tree.h (get_linemap): Rename declaration to make_location_t.
|
||||
|
||||
2018-10-17 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* expr.cc (ExprVisitor::binary_op): Use POINTER_DIFF_EXPR.
|
||||
|
||||
2018-10-17 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* intrinsics.cc (expand_intrinsic_bsf): Assert that built-in function
|
||||
code is not END_BUILTINS.
|
||||
(expand_intrinsic_bsr): Likewise.
|
||||
(expand_intrinsic_bswap): Likewise.
|
||||
(expand_intrinsic_popcnt): Likewise.
|
||||
|
||||
2018-10-17 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* config-lang.in (gtfiles): Add modules.cc.
|
||||
* modules.cc: Include gt-d-modules.h.
|
||||
(module_info): Mark with GTY.
|
||||
(static_ctor_list): Likewise.
|
||||
(static_dtor_list): Likewise.
|
||||
|
||||
2018-10-17 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-spec.c (lang_specific_driver): Use strrchr and strcmp to check
|
||||
input file suffix.
|
||||
|
||||
2018-10-17 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-spec.c (phobos_action): New enum.
|
||||
(library): Rename to phobos_library.
|
||||
(lang_specific_driver): Update to use phobos_library.
|
||||
(lang_specific_pre_link): Likewise.
|
||||
|
||||
2018-10-16 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-frontend.cc (Port::writelongLE): Remove function.
|
||||
(Port::writelongBE): Remove function.
|
||||
|
||||
2018-10-16 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-convert.cc (convert): Remove goto maybe_fold.
|
||||
|
||||
2018-10-16 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (warn_for_null_address): New function.
|
||||
(build_boolop): Warn about comparing address of decl to null.
|
||||
* d-convert.cc (decl_with_nonnull_addr_p): New function.
|
||||
(d_truthvalue_conversion): Warn about evaluating address as boolean.
|
||||
* d-tree.h (decl_with_nonnull_addr_p): Add declaration.
|
||||
* lang.opt (Waddress): New option.
|
||||
|
||||
2018-10-16 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (d_array_length): Assert that argument type is a
|
||||
dynamic array.
|
||||
(d_array_ptr): Likewise.
|
||||
(d_array_value): Likewise.
|
||||
(delegate_method): Assert that argument type is a delegate.
|
||||
(delegate_object): Likewise.
|
||||
|
||||
2018-10-16 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-attribs.c (handle_malloc_attribute): Use gcc_assert instead of
|
||||
gcc_unreachable.
|
||||
(handle_pure_attribute): Likewise.
|
||||
(handle_nothrow_attribute): Likewise.
|
||||
|
||||
2018-10-16 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* Make-lang.in: Rename compiler proper to d21.
|
||||
* config-lang.in (compilers): Rename compiler to d21.
|
||||
* d-spec.c (lang_specific_driver): Update comments.
|
||||
* lang-specs.h: Rename compiler to d21.
|
||||
|
||||
2018-10-16 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* lang.opt: Add missing periods to the ends of sentences.
|
||||
|
||||
2018-10-16 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-lang.cc (d_handle_option): Remove handling of -fdeps.
|
||||
(d_parse_file): Don't generate module dependencies.
|
||||
* lang.opt (fdeps, fdeps=): Remove options.
|
||||
(fintfc, fintfc-dir=, fintfc-file=): Remove options.
|
||||
(ftransition=safe): Remove option.
|
||||
|
||||
2018-10-16 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-lang.cc (d_init_ts): Remove handling of IASM_EXPR.
|
||||
(d_gimplify_expr): Likewise.
|
||||
* d-tree.def (IASM_EXPR): Remove tree code.
|
||||
|
||||
2018-10-15 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-attrib.c (attr_noreturn_exclusions): Attribute not mutually
|
||||
exclusive with self.
|
||||
* typeinfo.cc (TypeInfoVisitor::layout_interfaces): Assert that
|
||||
base class vtable is found in interface.
|
||||
|
||||
2018-10-08 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* decl.cc (DeclVisitor): Add using Visitor::visit.
|
||||
* expr.cc (ExprVisitor): Likewise.
|
||||
* imports.cc (ImportVisitor): Likewise.
|
||||
* toir.cc (IRVisitor): Likewise.
|
||||
* typeinfo.cc (TypeInfoVisitor): Likewise.
|
||||
(TypeInfoDeclVisitor): Likewise.
|
||||
(SpeculativeTypeVisitor): Likewise.
|
||||
* types.cc (TypeVisitor): Likewise.
|
||||
|
||||
2018-10-01 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-frontend.cc: Include compiler.h, errors.h, expression.h.
|
||||
(genCmain): Rename function to Compiler::genCmain.
|
||||
(Compiler::paintAsType): New function.
|
||||
(Compiler::loadModule): New function.
|
||||
(getTypeInfoType): Call error function directly.
|
||||
* d-lang.cc (deps_write): Use hash_set for dependency tracking.
|
||||
(d_parse_file): Call Compiler::loadModule.
|
||||
* d-target.cc: Remove include identifier.h, module.h.
|
||||
(Target::paintAsType): Remove function.
|
||||
(Target::loadModule): Remove function.
|
||||
(Target::getTargetInfo): New function.
|
||||
|
||||
2018-10-01 Eugene Wissner <belka@caraus.de>
|
||||
|
||||
* decl.cc (finish_thunk): Adjust call to cgraph_node::create_thunk.
|
||||
|
||||
2018-09-25 Eugene Wissner <belka@caraus.de>
|
||||
|
||||
* d-codegen.cc (d_assert_call): Don't make STRING_CSTs larger than they
|
||||
are.
|
||||
* expr.cc (ExprVisitor::visit(StringExp)): Likewise.
|
||||
* typeinfo.cc (TypeInfoVisitor::layout_string): Likewise.
|
||||
|
||||
2018-09-24 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-builtins.cc: Include expression.h, identifier.h.
|
||||
* d-codegen.cc: Include identifier.h.
|
||||
* d-convert.cc: Include declaration.h.
|
||||
* d-frontend.cc: Include identifier.h.
|
||||
* d-lang.cc: Include declaration.h, expression.h, identifier.h.
|
||||
(d_parse_file): Call moduleToBuffer to get string dump of contents.
|
||||
* d-target.cc: Include declaration.h, expression.h, identifier.h.
|
||||
* expr.cc: Include identifier.h.
|
||||
* imports.cc: Include identifier.h.
|
||||
* intrinsics.cc: Include identifier.h.
|
||||
* modules.cc: Include identifier.h.
|
||||
* toir.cc: Include expression.h, identifier.h.
|
||||
* typeinfo.cc: Include expression.h, identifier.h.
|
||||
* types.cc: Include expression.h, identifier.h.
|
||||
|
||||
2018-09-17 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* Make-lang.in (D_INCLUDES): Rename dfrontend to dmd.
|
||||
(d/%.o): Likewise.
|
||||
(d/%.dmdgen.o): Likewise.
|
||||
* verstr.h: Update to 2.076.1
|
||||
|
||||
2018-09-10 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* intrinsics.cc (maybe_expand_intrinsic): Handle INTRINSIC_EXP.
|
||||
* intrinsics.def (EXP): Add CTFE intrinsic.
|
||||
|
||||
2018-09-07 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-lang.cc: Include errors.h, mars.h.
|
||||
* decl.cc: Include errors.h.
|
||||
* typeinfo.cc: Include globals.h, errors.h.
|
||||
|
||||
2018-09-05 Eugene Wissner <belka@caraus.de>
|
||||
|
||||
* d-frontend.cc (eval_builtin): Replace DECL_BUILT_IN with
|
||||
fndecl_built_in_p.
|
||||
|
||||
2018-08-29 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-target.cc (Target::prefixName): Remove function.
|
||||
(Target::cppParameterType): New function.
|
||||
|
||||
2018-08-25 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* Make-lang.in (D_FRONTEND_OBJS): Add iasm.o, iasmgcc.o
|
||||
* lang.opt (fproperty): Remove option.
|
||||
* d-lang.cc (d_handle_option): Remove case for OPT_fproperty.
|
||||
* toir.cc (IRVisitor::visit(ExtAsmStatement)): Rename override to
|
||||
GccAsmStatement.
|
||||
|
||||
2018-07-23 Eugene Wissner <belka@caraus.de>
|
||||
|
||||
* d-lang.cc (d_handle_option): Change function argument to HOST_WIDE_INT.
|
||||
* lang.opt (Walloca-larger-than=, Wno-alloca-larger-than): New options.
|
||||
* opt.texi (Walloca-larger-than=, Wno-alloca-larger-than): Likewise.
|
||||
|
||||
2018-07-21 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* decl.cc (get_symbol_decl): Set all generated static symbols as
|
||||
DECL_EXTERNAL. Move logic for determining TREE_STATIC ...
|
||||
(start_function): ... here.
|
||||
(d_finish_decl): Update TLS model after finishing variable linkage.
|
||||
|
||||
2018-07-14 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* Make-lang.in (d.tags): Rename dfrontend to dmd.
|
||||
* d-attribs.c: Rename dfrontend includes to dmd.
|
||||
* d-builtins.cc: Likewise.
|
||||
* d-codegen.cc: Likewise.
|
||||
* d-convert.cc: Likewise.
|
||||
* d-diagnostic.cc: Likewise.
|
||||
* d-frontend.cc: Likewise.
|
||||
* d-incpath.cc: Likewise.
|
||||
* d-lang.cc: Likewise.
|
||||
* d-longdouble.cc: Likewise.
|
||||
* d-target.cc: Likewise.
|
||||
* decl.cc: Likewise.
|
||||
* expr.cc: Likewise.
|
||||
* imports.cc: Likewise.
|
||||
* intrinsics.cc: Likewise.
|
||||
* modules.cc: Likewise.
|
||||
* runtime.cc: Likewise.
|
||||
* toir.cc: Likewise.
|
||||
* typeinfo.cc: Likewise.
|
||||
* types.cc: Likewise.
|
||||
|
||||
2018-07-14 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* types.cc (same_type_p): Check type codes match before checking
|
||||
equivalence.
|
||||
|
||||
2018-07-09 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* Makefile.in (d/verstr.h): Remove recipe.
|
||||
(d.mostlyclean): Remove cleanup of verstr.h.
|
||||
* verstr.h: New file.
|
||||
|
||||
2018-07-06 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (lower_struct_comparison): Evaluate side effects of
|
||||
empty struct.
|
||||
(build_struct_comparison): Likewise.
|
||||
|
||||
2018-07-06 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* typeinfo.cc (TypeInfoVisitor::layout_interfaces): Only generate an
|
||||
interface vtable for classes.
|
||||
(TypeInfoVisitor::visit(TypeInfoClassDeclaration)): Likewise.
|
||||
|
||||
2018-07-05 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-lang.cc (deps_write): Ignore __main module.
|
||||
(d_handle_option): Handle -fmain option.
|
||||
(d_parse_file): Generate D main function if requested.
|
||||
* lang.opt (fmain): New option.
|
||||
|
||||
2018-07-04 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-builtins.cc (d_build_builtins_module): Export __builtin_clonglong
|
||||
and __builtin_culonglong to gcc builtins module.
|
||||
|
||||
2018-07-04 Eugene Wissner <belka@caraus.de>
|
||||
|
||||
* d-spec.c: Include opt-suggestions.h containing option_proposer used by
|
||||
gcc.h.
|
||||
|
||||
2018-07-01 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* decl.cc (get_symbol_decl): Implicitly convert return type of 'void'
|
||||
main to 'int' for both C and D entry functions.
|
||||
* toir.cc (IRVisitor::visit(ReturnStatement)): Likewise.
|
||||
|
||||
2018-06-30 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* expr.cc (ExprVisitor::visit(FuncExp)): Don't error about nested
|
||||
delegate literals.
|
||||
|
||||
2018-06-29 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-frontend.cc (eval_builtin): Allow both gcc and frontend builtins.
|
||||
* intrinsics.cc (call_builtin_fn): Use convert.
|
||||
(expand_intrinsic_sqrt): Use fold_convert.
|
||||
(expand_intrinsic_copysign): New function.
|
||||
(expand_intrinsic_pow): New function.
|
||||
(maybe_expand_intrinsic): Handle many math intrinsics.
|
||||
* intrinsics.def (EXPM1, EXP2, LOG, LOG2, LOG10, ROUND, FLOORF),
|
||||
(FLOOR, FLOORL, CEILF, CEIL, CEILL, TRUNC, FMIN, FMAX, COPYSIGN),
|
||||
(POW, FMA): Add math intrinsics.
|
||||
|
||||
2018-06-27 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (find_aggregate_field): Move to decl.cc
|
||||
(build_class_instance): Move to decl.cc, make static.
|
||||
* d-tree.h (build_class_instance): Remove declaration.
|
||||
* decl.cc (DeclVisitor::finish_vtable): New function.
|
||||
|
||||
2018-06-26 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* types.cc (TypeVisitor::visit(TypeClass)): Handle get_symbol_decl
|
||||
returning an error_mark_node.
|
||||
|
||||
2018-06-22 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* decl.cc (DeclVisitor::visit(FuncDeclaration)): Move function
|
||||
unnesting to...
|
||||
(get_symbol_decl): ... here.
|
||||
|
||||
2018-06-22 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-lang.cc (d_post_options): Set global showColumns parameter.
|
||||
|
||||
2018-06-22 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-diagnostic.cc (expand_format): Handle whitespace format specifier.
|
||||
(d_diagnostic_report_diagnostic): Change signature, updated all
|
||||
callers. Handle writing messages verbatim.
|
||||
(vmessage): New function.
|
||||
* d-lang.cc (d_parse_file): Use message to emit verbose diagnostics.
|
||||
* decl.cc (DeclVisitor::visit(FuncDeclaration)): Likewise.
|
||||
(get_symbol_decl): Likewise.
|
||||
|
||||
2018-06-22 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-builtins.cc (build_frontend_type): Use Type::merge2 to merge
|
||||
generated front-end types.
|
||||
* d-codegen.cc (declaration_type): Likewise.
|
||||
(type_passed_as): Likewise.
|
||||
* d-convert.cc (convert_expr): Use ClassDeclaration::isCPPclass.
|
||||
* d-lang.cc (d_build_eh_runtime_type): Likewise.
|
||||
* toir.cc (IRVisitor::visit): Use ClassDecalration::isCPPclass.
|
||||
* typeinfo.cc (TypeInfoVisitor::visit): Use Type::merge2 to merge
|
||||
generated front-end types.
|
||||
* types.cc (layout_aggregate_type): Use ClassDeclaration::isCPPclass.
|
||||
|
||||
2018-05-28 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* expr.cc (ExprVisitor::visit(StringExp)): Copy string literal from
|
||||
the frontend to a null terminated string.
|
||||
|
||||
2018-05-21 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* expr.cc (ExprVisitor::binary_op): Don't do complex conversions if
|
||||
already handling excess precision.
|
||||
|
||||
2018-04-02 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-lang.cc (doing_semantic_analysis_p): New variable.
|
||||
(d_parse_file): Set when in semantic pass.
|
||||
* d-tree.h (doing_semantic_analysis_p): Add declaration.
|
||||
* intrinsics.cc (maybe_expand_intrinsic): Test for
|
||||
doing_semantic_analysis_p.
|
||||
|
||||
2018-03-18 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (stabilize_expr): Move modify expression rewrite...
|
||||
* expr.cc (ExprVisitor::binop_assignment): ... here.
|
||||
|
||||
2018-03-11 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* expr.cc (ExprVisitor::visit(StringExp)): Include null terminator
|
||||
in length when calling build_String. Generate static array string
|
||||
literals as array constructors.
|
||||
|
||||
2018-03-04 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-lang.cc (d_handle_option): Rename OPT_fintfc cases to OPT_H.
|
||||
* gdc.texi (Code Generation): Rename -fintfc options to -H.
|
||||
* lang-specs.h: Add H, Hd, and Hf options.
|
||||
* lang.opt (H, Hd, Hf): New options.
|
||||
(fintfc, fintfc-dir=, fintfc-file=): Deprecate and alias new options.
|
||||
|
||||
2018-03-04 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* lang.opt (fdeps, fdeps=): Deprecate options.
|
||||
* gdc.texi (Code Generation): Remove deprecated fdeps options.
|
||||
|
||||
2018-02-25 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* Make-lang.in (D_FRONTEND_OBJS): Remove inline.o and inlinecost.o.
|
||||
|
||||
2018-02-24 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-frontend.cc (CTFloat::fabs): Assign result to real_t directly.
|
||||
(CTFloat::ldexp): Likewise.
|
||||
* d-longdouble.cc (longdouble::from_int): Remove function.
|
||||
(longdouble::from_uint): Likewise.
|
||||
(longdouble::to_int): Update Signature.
|
||||
(longdouble::to_uint): Likewise.
|
||||
(longdouble::operator): Likewise.
|
||||
(longdouble::add): New function, move operator overload headers.
|
||||
(longdouble::sub, longdouble::mul, longdouble::div): Likewise.
|
||||
(longdouble::mod, longdouble::neg): Likewise.
|
||||
(longdouble::cmp, longdouble::equals): Likewise.
|
||||
* d-target.cc (Target::_init): Construct assignment into real_t
|
||||
directly.
|
||||
|
||||
2018-02-19 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* Make-lang.in (DMD_WARN_CXXFLAGS): Only filter out
|
||||
-Wmissing-format-attribute from WARN_CXXFLAGS.
|
||||
|
||||
2018-02-18 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-builtins.cc (build_frontend_type): Set alignment of structs in
|
||||
frontend.
|
||||
|
||||
2018-02-17 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-incpath.cc (add_environment_paths): Remove function.
|
||||
* gdc.texi (Environment Variables): Remove section.
|
||||
|
||||
2018-02-10 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* expr.cc (ExprVisitor::AssertExp): Use builtin expect to mark assert
|
||||
condition as being likely true.
|
||||
|
||||
2018-02-11 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* lang.opt (fd-vgc, fd-verbose, fd-vtls): Remove options.
|
||||
(femit-moduleinfo, femit-templates): Likewise.
|
||||
(fmake-deps, fmake-mdeps): Likewise.
|
||||
(fin, fout, fXf): Likewise.
|
||||
|
||||
2018-01-28 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* gdc.texi (Runtime Options): Remove deprecated -fproperty option.
|
||||
|
||||
2018-01-27 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-lang.cc (d_gimplify_expr): Gimplify all CALL_EXPR_ARGS_ORDERED
|
||||
call arguments, not just non-constant.
|
||||
|
||||
2018-01-27 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* decl.cc (DeclVisitor::visit(VarDeclaration)): Don't reuse existing
|
||||
temporary for TARGET_EXPR.
|
||||
(declare_local_var): Push all variables to current binding level.
|
||||
|
||||
2018-01-27 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* toir.cc (build_function_body): Set input_location.
|
||||
|
||||
2018-01-23 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (build_frame_type): Don't add chain field for
|
||||
functions without context pointer.
|
||||
(build_closure): Don't set chain field for functions without context
|
||||
pointer.
|
||||
|
||||
2018-01-21 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* decl.cc (DeclVisitor::visit(StructDeclaration)): Mark compiler
|
||||
generated symbols as DECL_ONE_ONLY instead of DECL_COMDAT.
|
||||
(DeclVisitor::visit(ClassDeclaration)): Likewise.
|
||||
(DeclVisitor::visit(InterfaceDeclaration)): Likewise.
|
||||
(DeclVisitor::visit(EnumDeclaration)): Likewise.
|
||||
(get_symbol_decl): Mark template instantiations as DECL_ONE_ONLY
|
||||
instead of DECL_COMDAT. Don't call mark_needed.
|
||||
(declare_extern_var): Don't call mark_needed.
|
||||
(d_finish_decl): Remove zero initializer for common symbols.
|
||||
(finish_thunk): Don't call d_comdat_linkage on generic thunk.
|
||||
(d_comdat_linkage): Don't set DECL_DECLARED_INLINE on functions.
|
||||
* typeinfo.cc (TypeInfoDeclVisitor::visit(TypeInfoDeclaration)): Mark
|
||||
built-in typeinfo symbols as DECL_ONE_ONLY instead of DECL_COMDAT.
|
||||
|
||||
2018-01-21 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-lang.cc (d_init): Disable flag_weak if not supported.
|
||||
* decl.cc (d_comdat_linkage): Use flag_weak to guard setting
|
||||
DECL_ONE_ONLY on decls.
|
||||
(d_linkonce_linkage): New function.
|
||||
* gdc.texi (Runtime Options): Document -fweak.
|
||||
* lang.opt (fweak): Declare.
|
||||
|
||||
2018-01-21 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* decls.cc (get_symbol_decl): Use attribute to mark naked functions.
|
||||
|
||||
2018-01-08 Eugene Wissner <belka@caraus.de>
|
||||
|
||||
* d-builtins.cc (d_eval_constant_expression): Handle polynomial
|
||||
VECTOR_CST_NELTS.
|
||||
(build_frontend_type): Handle polynomial TYPE_VECTOR_SUBPARTS.
|
||||
|
||||
2018-01-08 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
Update copyright years.
|
||||
|
||||
Copyright (C) 2018 Free Software Foundation, Inc.
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved.
|
954
gcc/d/ChangeLog-2006
Normal file
954
gcc/d/ChangeLog-2006
Normal file
@ -0,0 +1,954 @@
|
||||
2006-12-27 DF <dvdfrdmn@users.sf.net>
|
||||
|
||||
* phobos/internal/fpmath.d: Support x86_64
|
||||
|
||||
* phobos/configure.in: x86_64 can use fpmath.d
|
||||
* phobos/configure: update
|
||||
|
||||
* target-ver-syms.sh: Add some CPU architectures
|
||||
|
||||
2006-12-26 DF <dvdfrdmn@users.sf.net>
|
||||
|
||||
* phobos/configure.in: actually use value of
|
||||
--enable-phobos-config-dir
|
||||
|
||||
2006-12-26 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
Rest of 0.178 changes:
|
||||
|
||||
* phobos/std/bitarray.d: revert previous changes
|
||||
|
||||
* d-decls.cc (toSymbolX): update
|
||||
|
||||
* d-glue.cc (TypeFunction::retStyle): implement
|
||||
|
||||
* phobos/std/format.d: update for Mangle.Tenum
|
||||
|
||||
-------------
|
||||
|
||||
Initial merge of 0.178:
|
||||
|
||||
* dmd/class.c, dmd/declaration.c, dmd/declaration.h, dmd/doc.c,
|
||||
dmd/expression.c, dmd/expression.h, dmd/func.c, dmd/init.c,
|
||||
dmd/lexer.c, dmd/mangle.c, dmd/mars.c, dmd/mars.h, dmd/mtype.c,
|
||||
dmd/optimize.c, dmd/parse.c, dmd/statement.c, dmd/statement.h,
|
||||
dmd/template.c, dmd/tocsym.c, dmd/toobj.c: Merge 0.178
|
||||
|
||||
* phobos/internal/gc/win32.d, phobos/internal/object.d,
|
||||
phobos/std/c/linux/linux.d, phobos/std/date.d,
|
||||
phobos/std/dateparse.d, phobos/std/format.d, phobos/std/gc.d,
|
||||
phobos/std/regexp.d, phobos/std/socket.d, phobos/std.ddoc: Merge
|
||||
0.178
|
||||
|
||||
---------------
|
||||
|
||||
* dmd/constfold.c (CastExp::constFold): Fix Bugzilla 738.
|
||||
|
||||
* dmd/todt.c (StructDeclaration::toDt): Fix Bugzilla 736.
|
||||
|
||||
* d-decls.cc (VarDeclaration::toSymbol): Fix Bugzilla 737.
|
||||
|
||||
* d-glue.cc (make_assign_math_op): Fix Bugzilla 739.
|
||||
|
||||
* d-codegen.cc, d-decls.cc, d-glue.cc, symbol.cc, symbol.h:
|
||||
Use toParent2. Handle nested template instance functions.
|
||||
(Bugzilla 742, 743)
|
||||
|
||||
2006-12-25 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* dmd/mtype.c: Don't use '@' in mangled names
|
||||
|
||||
* d-glue.cc (TypeFunction::toCtype): Handle recursive type
|
||||
reference (Bugzilla 745)
|
||||
|
||||
* d-codegen.cc, d-codegen.h, d-glue.cc, d-objfile.cc, d-objfile.h,
|
||||
dmd/aggregate.h, dmd/attrib.c, dmd/class.c, dmd/declaration.c,
|
||||
dmd/declaration.h, dmd/enum.c, dmd/enum.h, dmd/func.c,
|
||||
dmd/idgen.c, dmd/scope.c, dmd/scope.h, dmd/struct.c: Implement
|
||||
GCC attributes.
|
||||
|
||||
* dmd/mtype.c (TypeDelegate::dotExp): Fix regression caused by
|
||||
last fix.
|
||||
|
||||
2006-12-24 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* dmd/parse.h, dmd/parse.c(parseStatement, parseExtAsm),
|
||||
dmd/statement.h, asmstmt.cc: Implement GCC extended assembler.
|
||||
|
||||
2006-12-20 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* dmd/mars.h: format issues are due to newlib, not Cygwin
|
||||
|
||||
* setup-gcc.sh: Fix sed patterns and options.
|
||||
|
||||
* dmd/mtype.c (TypeDelegate::dotExp): Handle .ptr so that
|
||||
it can be an lvalue. (Bugzilla 696)
|
||||
|
||||
* d-irstate.cc (getLoopForLabel): Handle labels pointing to
|
||||
ScopeStatements. (Bugzilla 695)
|
||||
|
||||
2006-12-16 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
Release GDC 0.20
|
||||
|
||||
* setup-gcc.sh: account for modified version strings
|
||||
|
||||
* dmd/mtype.c (TypeTuple::toDecoBuffer): workaround newlib bug
|
||||
|
||||
* dmd/mars.h: fix printf formats for Cygwin
|
||||
|
||||
* d-builtins.c (d_init_builtins): Handle va_list type when it is
|
||||
an array.
|
||||
|
||||
* gcc-mars.cc, gdc-version: update
|
||||
|
||||
* d-decls.cc: warnings cleanup
|
||||
|
||||
* dmd/expression.c (realToMangleBuffer): filter out 'x'
|
||||
|
||||
2006-12-13 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* package/simple.sh: use MAKE environment variable
|
||||
|
||||
2006-12-11 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* patch-build_gcc-4.0: don't disable Objective C
|
||||
|
||||
2006-12-09 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* phobos/std/bitarray.d (unittest): workaround 0.177 breakage
|
||||
|
||||
* phobos/std/format.d,
|
||||
* phobos/std/string.d,
|
||||
* phobos/std/loader.d: update
|
||||
|
||||
* phobos/std/file.d: fix merge. update.
|
||||
|
||||
* dmd/root.[ch] (writestring): make arg const
|
||||
|
||||
* dmd/expression.c (toMangleBuffer): update
|
||||
|
||||
Initial 0.177 merges
|
||||
|
||||
* dmd/constfold.c, dmd/declaration.c, dmd/expression.[ch],
|
||||
dmd/func.c, dmd/idgen.c, dmd/manlge.c, dmd/mars.c, dmd/mtype.[ch],
|
||||
dmd/opover.c, dmd/tocsym.c, dmd/toobj.c, dmd/typinf.c: Merge 0.177
|
||||
|
||||
* etc/c/zlib.d, phobos/internal/aaA.d, phobos/internal/adi.d,
|
||||
phobos/internal/arraycat.d, phobos/internal/gc/gc.d,
|
||||
phobos/internal/gc/testgc.d, phobos/internal/object.d,
|
||||
phobos/internal/qsort.d, phobos/internal/switch.d,
|
||||
phobos/internal/trace.d, phobos/object.d, phobos/std/array.d,
|
||||
phobos/std/boxer.d, phobos/std/conv.d, phobos/std/cover.d,
|
||||
phobos/std/cpuid.d, phobos/std/date.d, phobos/std/file.d,
|
||||
phobos/std/format.d, phobos/std/loader.d, phobos/std/math2.d,
|
||||
phobos/std/md5.d, phobos/std/mmfile.d, phobos/std/outbuffer.d,
|
||||
phobos/std/path.d, phobos/std/regexp.d, phobos/std/socket.d,
|
||||
phobos/std/stream.d, phobos/std/string.d, phobos/std/switcherr.d,
|
||||
phobos/std/syserror.d, phobos/std/typeinfo/ti_Acdouble.d,
|
||||
phobos/std/typeinfo/ti_Acfloat.d, phobos/std/typeinfo/ti_Acreal.d,
|
||||
phobos/std/typeinfo/ti_Adchar.d, phobos/std/typeinfo/ti_Adouble.d,
|
||||
phobos/std/typeinfo/ti_Afloat.d, phobos/std/typeinfo/ti_Ag.d,
|
||||
phobos/std/typeinfo/ti_Aint.d, phobos/std/typeinfo/ti_Along.d,
|
||||
phobos/std/typeinfo/ti_Areal.d, phobos/std/typeinfo/ti_Ashort.d,
|
||||
phobos/std/typeinfo/ti_Aubyte.d, phobos/std/typeinfo/ti_Auint.d,
|
||||
phobos/std/typeinfo/ti_Aulong.d, phobos/std/typeinfo/ti_Aushort.d,
|
||||
phobos/std/typeinfo/ti_Awchar.d, phobos/std/uri.d,
|
||||
phobos/std/utf.d, phobos/std/windows/charset.d,
|
||||
phobos/std/windows/registry.d, phobos/std/zlib.d: Merge 0.177
|
||||
|
||||
--------------
|
||||
|
||||
* patch-apple-gcc-4.0.x, patch-build_gcc-4.0: Support
|
||||
building the Apple way on PowerPC machines.
|
||||
|
||||
2006-12-06 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* d-codegen.cc (call): Fix for calling delegate literal.
|
||||
|
||||
* setup-gcc.sh: fail if patching build_gcc fails
|
||||
|
||||
* d-glue.cc (NewExp::toElem): expand stack vars
|
||||
for GCC 3.x
|
||||
|
||||
* phobos/std/cpuid.d: fix for cpuid kludge
|
||||
|
||||
2006-12-05 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* dmd/mars.h: Handle msvcrt C99 printf incompatibility.
|
||||
|
||||
* dmd/template.c, dmd/declaration.c, dmd/expression.c, dmd/func.c,
|
||||
dmd/init.c, dmd/lexer.c, dmd/mangle.c, dmd/mtype.c,
|
||||
dmd/optimize.c, dmd/root.c: ditto
|
||||
|
||||
* phobos/config/unix-mid: fix compile error
|
||||
|
||||
2006-12-04 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
More 0.176 merges
|
||||
|
||||
* phobos/config/unix-mid: add reentrant funcs
|
||||
|
||||
* d-glue.cc (DeleteExp::toElem): handle on-stack vars
|
||||
|
||||
* d-glue.cc (FuncDeclaration::toObjFile): emit _arguments
|
||||
|
||||
* dmd/declaration.h, dmd/func.c: save _arguments local var for
|
||||
backend
|
||||
|
||||
2006-12-03 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* d-glue.cc: New _arguments ABI.
|
||||
|
||||
* gcc-mars.cc: Update for verror.
|
||||
|
||||
* d-decls.cc, d-objfile.cc,
|
||||
* d-glue.cc (Module::genobjfile, d_gcc_aggregate_dtors): Update
|
||||
for new toSymbolX.
|
||||
|
||||
* d-glue.cc (TypeAArray::toCtype): Implement new AA ABI.
|
||||
|
||||
* d-codegen.cc (convertTo): Don't allow conversion of dynamic
|
||||
array to associated array and vice versa.
|
||||
|
||||
* d-codegen.cc (getLibCallDecl, rawArray, convertForCondition),
|
||||
d-glue.cc (NullExp::toElem): change AA type
|
||||
|
||||
* gcc-mars.cc : printf corrections
|
||||
|
||||
* phobos/Makefile.in (MAIN_OBJS): add bind.o
|
||||
|
||||
Initial merge of DMD 0.176
|
||||
|
||||
* attrib.c, dmd/cast.c, dmd/class.c, dmd/cond.c, dmd/constfold.c,
|
||||
dmd/declaration.c, dmd/doc.c, dmd/dsymbol.h, dmd/dump.c,
|
||||
dmd/expression.c, dmd/expression.h, dmd/func.c, dmd/idgen.c,
|
||||
dmd/init.c, dmd/init.h, dmd/lexer.c, dmd/link.c, dmd/mangle.c,
|
||||
dmd/mars.c, dmd/mars.h, dmd/module.c, dmd/mtype.c, dmd/optimize.c,
|
||||
dmd/parse.c, dmd/root.c, dmd/statement.c, dmd/template.c,
|
||||
dmd/tocsym.c, dmd/todt.c, dmd/toobj.c: Merge 0.176
|
||||
|
||||
* internal/aaA.d, phobos/internal/cmath2.d, phobos/internal/deh.c,
|
||||
phobos/internal/object.d, phobos/linux.mak,
|
||||
phobos/std/c/linux/linux.d, phobos/std/c/linux/socket.d,
|
||||
phobos/std/compiler.d, phobos/std/math.d, phobos/std/socket.d,
|
||||
phobos/std/string.d, phobos/std/traits.d,
|
||||
phobos/std/typeinfo/ti_Aubyte.d, phobos/std/typeinfo/ti_ubyte.d,
|
||||
phobos/std.ddoc, phobos/win32.mak: Merge 0.176
|
||||
|
||||
* phobos/std/bind.d: New file in 0.176
|
||||
|
||||
* dmd/toir.[ch]: New files (from DMD 0.175)
|
||||
|
||||
* phobos/phobos.d: New file (from DMD 0.160)
|
||||
|
||||
--------------
|
||||
|
||||
* phobos/std/boxer.d (unbox(T : void*).unbox): fix
|
||||
|
||||
* d-glue.cc (NewExp::toElem): Support allocation on stack
|
||||
|
||||
Initial merge of DMD 0.175
|
||||
|
||||
* cast.c, dmd/class.c, dmd/dchar.c, dmd/dchar.h,
|
||||
dmd/declaration.c, dmd/declaration.h, dmd/delegatize.c,
|
||||
dmd/dsymbol.c, dmd/dump.c, dmd/enum.c, dmd/expression.c,
|
||||
dmd/expression.h, dmd/func.c, dmd/identifier.c, dmd/identifier.h,
|
||||
dmd/inifile.c, dmd/init.c, dmd/lexer.c, dmd/lstring.h,
|
||||
dmd/mangle.c, dmd/mars.c, dmd/mtype.c, dmd/mtype.h,
|
||||
dmd/optimize.c, dmd/parse.c, dmd/root.c, dmd/root.h, dmd/scope.c,
|
||||
dmd/scope.h, dmd/statement.c, dmd/statement.h, dmd/stringtable.c,
|
||||
dmd/todt.c, dmd/typinf.c: Merge 0.175
|
||||
|
||||
dmd/html.c: not merged
|
||||
|
||||
* phobos/internal/object.d, phobos/std/demangle.d,
|
||||
phobos/std/format.d, phobos/std/socket.d, phobos/std/stdio.d,
|
||||
phobos/std/traits.d, phobos/std/uni.d, phobos/std.ddoc:
|
||||
Merge 0.175
|
||||
|
||||
------------
|
||||
|
||||
* config/darwin8, config/mingw: update config fragments
|
||||
|
||||
2006-11-26 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* d-codegen.cc, d-glue.cc: Fix missing continue label
|
||||
expansion for GCC < 4.0
|
||||
|
||||
* d-glue.cc (make_math_op): Convert non-complex to complex
|
||||
in all version of GCC. (Buzilla 575)
|
||||
|
||||
* d-codegen.cc: for tree code class for GCC < 4.0
|
||||
|
||||
* phobos/Makefile.in: make test programs dependendent on
|
||||
libgphobos.a as gdc will still try to find it
|
||||
|
||||
* phobos/configure.in: conditionally build std/boxer.o
|
||||
|
||||
* phobos/Makefile.in (MAIN_OBJS): remove std/boxer.o
|
||||
|
||||
* phobos/internal/arraycat.d (_d_array_literal): disable
|
||||
|
||||
* phobos/std/format.d: fix for PowerPC Linux
|
||||
|
||||
2006-11-25 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* d-gcc-real.h: cleanup for warnings
|
||||
|
||||
2006-11-24 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* d-glue.cc (DotVarExp::toElem): Handle const members.
|
||||
|
||||
* d-codegen.cc (needs_temp): Return false for constants.
|
||||
(isFreeOfSideEffects): New function.
|
||||
|
||||
* d-glue.cc (do_array_set): Evaluate the rvalue only once
|
||||
(Bugzilla 578).
|
||||
|
||||
2006-11-18 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
Rest of DMD 0.174 merge:
|
||||
|
||||
* dmd/mtype.c (TypeDelegate::dotExp): Use cast-to-pointer
|
||||
for .ptr property
|
||||
|
||||
* d-decls.cc (VarDeclaration::toSymbol): Build CONST_DECLs
|
||||
* d-codegen.cc (IRState::emitLocalVar): Do nothing if CONST_DECL
|
||||
|
||||
* d-codegen.cc (ArrayScope::setArrayExp): Handle tuple/constant
|
||||
lengths.
|
||||
|
||||
* dmd/toobj.c (Dsymbol::toObjFile): emit local variables for
|
||||
tuples
|
||||
|
||||
* svn: move traits.d and typetuple.d to the correct directory
|
||||
|
||||
* gcc-mars.cc (error): add va_list form
|
||||
|
||||
* dmd/mars.h (error): use va_list for 'error'
|
||||
|
||||
* dmd/expression.c, dmd/lexer.c: fix compile errors
|
||||
|
||||
* phobos/Makefile.in (MAIN_OBJS): add traits.o and typetuple.o
|
||||
|
||||
* dmd-script: add -v1 option
|
||||
|
||||
* dmd/root.c (FileName::ensurePathExists): fix conditions
|
||||
for non-win32, non-linux.
|
||||
|
||||
* dmd-script (printUsage): add missing options documentation
|
||||
|
||||
* d-codegen.{h, cc}: use size_t
|
||||
|
||||
* phobos/internal/dgccmain2.d: update
|
||||
|
||||
Initial merge of DMD 0.174:
|
||||
|
||||
* dmd/attrib.c, dmd/cast.c, dmd/class.c, dmd/declaration.c,
|
||||
dmd/declaration.h, dmd/doc.c, dmd/dsymbol.c, dmd/dsymbol.h,
|
||||
dmd/expression.c, dmd/expression.h, dmd/func.c, dmd/hdrgen.c,
|
||||
dmd/idgen.c, dmd/inline.c, dmd/lexer.c, dmd/mangle.c, dmd/mars.c,
|
||||
dmd/mars.h, dmd/module.c, dmd/mtype.c, dmd/mtype.h, dmd/parse.c,
|
||||
dmd/statement.c, dmd/template.c, dmd/template.h, dmd/tocsym.c,
|
||||
dmd/todt.c, dmd/toobj.c, dmd/typinf.c, dmd/utf.c, dmd/utf.h: Merge
|
||||
0.174
|
||||
|
||||
* phobos/internal/aApplyR.d, phobos/internal/dmain2.d,
|
||||
phobos/internal/object.d, phobos/linux.mak, phobos/object.d,
|
||||
phobos/std/date.d, phobos/std/openrj.d, phobos/std/signals.d,
|
||||
phobos/win32.mak: Merge 0.174
|
||||
|
||||
* phobos/std/traits.d, phobos/std/typetuple.d: New files in 0.174
|
||||
|
||||
|
||||
2006-11-17 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* package/simple.sh: enhancements
|
||||
|
||||
* dmd/attrib.c: fix message
|
||||
|
||||
2006-11-16 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* d-codegen.cc (continueHere): fix error
|
||||
* d-glue.cc (d_gcc_aggregate_dtors): "
|
||||
|
||||
2006-11-14 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* d-builtins2.cc, d-codegen.{cc, h}, d-decls.cc, d-glue.cc,
|
||||
d-lang.h: remove D_TYPE_IS_NESTED. Do not pull original
|
||||
TypeFunction from FUNCTION_TYPE.
|
||||
|
||||
* d-codegen.cc: cleanup
|
||||
|
||||
* d-codegen.cc, gdc-alloca.h, phobos/config/gen_unix.c: fixes for
|
||||
older MacOS X builds
|
||||
|
||||
2006-11-13 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* phobos/std/cpuid.d: fixes for PIC
|
||||
|
||||
* d-asm-i386.h: Fix for referencing funcs (Bugzilla 307).
|
||||
Correct clobbers for cpuid, but left out EBX as a kludge for
|
||||
std.cpuid.
|
||||
|
||||
* phobos/std/c/linux/linux.d: make imports public (Bugzilla 403)
|
||||
|
||||
* d-decls.cc (uniqueName): Fixed logic error (Bugzilla 375). Then
|
||||
just removed most of the code and comments because the workaround
|
||||
is no longer needed.
|
||||
|
||||
2006-11-12 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* dmd/root.c (Object::hashCode): cast to pointer acceptable int type
|
||||
|
||||
Rest of DMD 0.173 merge:
|
||||
|
||||
* d-glue.cc (UnrolledLoopStatement::toIR): implement
|
||||
|
||||
* d-codegen.h (setContinueLabel): add interface for multiple continues
|
||||
|
||||
* d-irstate.h (Flow), d-irstate.cc: add overrideContinueLabel for
|
||||
GCC < 4.0
|
||||
|
||||
* d-builtins2.cc, d-glue.cc, d-codegen.cc: update for
|
||||
TypeFunction::arguments -> parameters and tuples
|
||||
|
||||
* dmd/func.c: update
|
||||
|
||||
* d-gcc-complex_t.h: update
|
||||
|
||||
* phobos/Makefile.in (MAIN_OBJS): add signals.o and cpuid.o
|
||||
|
||||
Initial merge of DMD 0.173:
|
||||
|
||||
* dmd/arraytypes.h, dmd/cast.c, dmd/class.c, dmd/complex_t.h,
|
||||
dmd/constfold.c, dmd/declaration.c, declaration.h,
|
||||
dmd/delegatize.c, dmd/doc.c, dmd/dsymbol.c, dmd/dsymbol.h,
|
||||
expression.c, dmd/expression.h, dmd/func.c, dmd/html.c,
|
||||
dmd/html.h, dmd/inline.c, lexer.c, dmd/lexer.h, dmd/mars.c,
|
||||
dmd/mars.h, dmd/mem.h, dmd/mtype.c, dmd/mtype.h, opover.c,
|
||||
dmd/optimize.c, dmd/parse.c, dmd/parse.h, dmd/statement.c,
|
||||
dmd/statement.h, struct.c, dmd/template.c, dmd/template.h,
|
||||
dmd/tocsym.c, dmd/toobj.c, dmd/typinf.c: Merge 0.173
|
||||
|
||||
* phobos/internal/object.d, phobos/linux.mak, phobos/std/stream.d,
|
||||
phobos/std/string.d, phobos/std/system.d, phobos/std.ddoc,
|
||||
phobos/unittest.d, phobos/win32.mak: Merge 0.173
|
||||
|
||||
* phobos/std/c/locale.d, phobos/std/cpuid.d, phobos/std/signals.d:
|
||||
New files in 0.173
|
||||
|
||||
----
|
||||
|
||||
* dmd/class.c, dmd/mars.c, dmd/opover.c, dmd/statement.c:
|
||||
Merge DMD 0.172
|
||||
|
||||
Merge DMD 0.171:
|
||||
|
||||
* dmd/func.c, dmd/optimize.c: Update comments
|
||||
|
||||
* dmd/aggregate.h, dmd/class.c, dmd/func.c, dmd/mars.c:
|
||||
Merge 0.171
|
||||
|
||||
* phobos/internal/aApplyR.d, phobos/internal/gc/gc/.d: Merge 0.171
|
||||
|
||||
----
|
||||
|
||||
Rest of DMD 0.170 merge:
|
||||
|
||||
* d-glue.cc (ArrayLiteralExp::toElem): Handle the case in which
|
||||
the type of the expression is a pointer.
|
||||
|
||||
* dmd/optimize.c (PtrExp::optimize): Don't change type
|
||||
of expression without cast
|
||||
|
||||
* phobos/internal/aApplyR.d: turn off debug(apply)
|
||||
|
||||
2006-11-11 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* d-glue.cc (ForeachStatement::toIR): support foreach_reverse
|
||||
|
||||
* dmd/lexer.c: size_t -> unsigned
|
||||
|
||||
* d-lang.cc (d_handle_option): update
|
||||
|
||||
* phobos/Makefile.in: add aApplyR.o
|
||||
|
||||
* phobos/internal/monitor.c: merged
|
||||
|
||||
Initial merge of DMD 0.170:
|
||||
|
||||
* dmd/attrib.c, dmd/cast.c, dmd/class.c, dmd/delegatize.c,
|
||||
dmd/dsymbol.c, dmd/expression.c, dmd/expression.h, dmd/func.c,
|
||||
dmd/identifier.c, dmd/idgen.c, dmd/import.c, dmd/lexer.c,
|
||||
dmd/lexer.h, dmd/mangle.c, dmd/mars.c, dmd/module.c, dmd/mtype.c,
|
||||
dmd/mtype.h, dmd/opover.c, dmd/parse.c, dmd/statement.c,
|
||||
dmd/statement.h, dmd/template.h, dmd/utf.h: Merge 0.170
|
||||
|
||||
* phobos/internal/aApply, phobos/internal/cast.d,
|
||||
phobos/internal/gc/gc.d, phobos/internal/mars.h,
|
||||
phobos/internal/object.d, phobos/linux.mak, phobos/object.d,
|
||||
phobos/std/gc.d, phobos/std/math.d, phobos/std/outofmemory.d,
|
||||
phobos/std/path.d, phobos/std/zlib.d, phobos/std.ddoc,
|
||||
phobos/unittest.d, phobos/win32.mak: Merge 0.170
|
||||
|
||||
* internal/monitor.c: not changed; merge deferred for now
|
||||
|
||||
* phobos/internal/aApplyR.d: new file in 0.170
|
||||
|
||||
----
|
||||
|
||||
Rest of 0.169 merge:
|
||||
|
||||
* phobos/internal/object.d: fix merge error
|
||||
|
||||
* d-asm-i386.h: update for DMD changes
|
||||
|
||||
* dmd/mtype.c, phobos/internal/adi.d (_adSortChar, _adSortWchar):
|
||||
fix for calling conventions
|
||||
|
||||
* d-gcc-complex_t.h: updated
|
||||
|
||||
Initial merge of DMD 0.169:
|
||||
|
||||
* dmd/aggregate.h, dmd/arraytypes.h, dmd/attrib.h, dmd/class.c,
|
||||
dmd/complex_t.h, dmd/cond.h, dmd/declaration.h, dmd/declaration.c,
|
||||
dmd/doc.h, dmd/dsymbol.c, dmd/dsymbol.h, dmd/enum.h,
|
||||
dmd/expression.c, dmd/expression.h, dmd/hdrgen.h, dmd/html.h,
|
||||
dmd/identifier.h, dmd/idgen.c, dmd/import.c, dmd/import.h,
|
||||
dmd/init.c, dmd/init.h, dmd/lexer.h, dmd/macro.h, dmd/macro.c,
|
||||
dmd/mars.c, dmd/mars.h, dmd/module.c, dmd/module.h, dmd/mtype.c,
|
||||
dmd/mtype.h, dmd/opover.c, dmd/optimize.c, dmd/parse.h,
|
||||
dmd/root.c, dmd/scope.c, dmd/scope.h, dmd/statement.c,
|
||||
dmd/statement.h, dmd/staticassert.h, dmd/struct.c, dmd/template.c,
|
||||
dmd/template.h, dmd/total.h, dmd/typinf.c, dmd/utf.h,
|
||||
dmd/version.h: Merge 0.169
|
||||
|
||||
* phobos/internal/adi.d, phbobos/internal/critical.c,
|
||||
phbobos/internal/mars.h, phbobos/internal/monitor.c,
|
||||
phbobos/internal/object.d, phbobos/object.d, phbobos/std/regexp.d:
|
||||
Merge 0.169
|
||||
|
||||
----
|
||||
|
||||
* dmd-script: Create directories for output files
|
||||
|
||||
Rest of 0.168 changes:
|
||||
|
||||
* d-dmd-gcc.h, d-glue.cc (d_gcc_aggregate_dtors): new function
|
||||
* dmd/toobj.c (ClassDeclaration::toObjFile): use d_gcc_aggregate_dtors
|
||||
|
||||
* d-codegen.cc (convertTo): handle delegate .ptr property
|
||||
|
||||
* lang-specs.h, dmd-script: handle .xhtml extension
|
||||
|
||||
Initial merge of DMD 0.168
|
||||
|
||||
* dmd/aggregate.h, dmd/arraytypes.h, dmd/cast.c, dmd/class.c,
|
||||
dmd/declaration.c, dmd/expression.h, dmd/func.c, dmd/html.[ch],
|
||||
dmd/idgen.c, dmd/init.c, dmd/lexer.c, dmd/lexer.h, dmd/link.c,
|
||||
dmd/mangle.c, dmd/mars.c, dmd/module.c, dmd/mtype.[ch],
|
||||
dmd/statement.c, dmd/toobj.c, dmd/typeinf.c: Merge 0.168
|
||||
|
||||
* phobos/etc/gamma.d, phobos/internal/object.d,
|
||||
phobos/std/c/linux/linux.d.orig-dmd, phobos/std/date.d,
|
||||
phobos/std/math.d, phobos/std/socket.d, phobos/std/socketstream.d,
|
||||
phobos/std/stream.d, phobos/std/uni.d, phobos/win32.mak: Merge 0.168
|
||||
|
||||
2006-11-10 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* Make-lang.in (d.install-common): cross install fix for gdmd
|
||||
|
||||
* d-glue.cc (NewExp::toElem): uint -> unsigned
|
||||
|
||||
* package/simple.sh: Don't depend on rsync
|
||||
|
||||
* patch-toplev-3.4.x, patch-toplev-4.0.x: Modify top-level
|
||||
Makefile.in, configure.in, and configure to work with
|
||||
a Canadian cross build.
|
||||
|
||||
* d-glue.cc (SynchronizedStatement::toIR): Remove uneeded
|
||||
startBindings call. Add missing _d_criticalenter call.
|
||||
|
||||
2006-10-12 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* phobos/config/unix-mid: add sysconf
|
||||
|
||||
2006-10-11 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* phobos/std/format.d (doFormat): support Mangle.Tstruct for p_args
|
||||
|
||||
* phobos/config/unix-head: import tm from gcc.config
|
||||
|
||||
* phobos/config/gen_unix.c (c_time): Moved out struct tm.
|
||||
|
||||
* phobos/config/gen_config1.c: Support clock_t. Move struct tm here.
|
||||
|
||||
* d-glue.cc (AssignExp::toElem): use _d_arraysetlength3p
|
||||
(FuncDeclaration::toObjFile): Fixed assert of class member if
|
||||
synchronized.
|
||||
|
||||
* d-codegen.{h, cc}: replace libcall _d_arraysetlength2p with
|
||||
_d_arraysetlength3p
|
||||
|
||||
* phobos/internal/gc/gc.d (_d_arraysetlength3p): pointer version
|
||||
of _d_arraysetlength3. GCC asm jump fix.
|
||||
|
||||
2006-10-09 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* d-codegen.{h, cc}: new libcalls: _dnewmp, _d_newarraymip
|
||||
|
||||
* phobos/internal/gc/gc.d (_dnewmp, _d_newarraymip): pointer version
|
||||
of _dnewm, _d_newarraymi
|
||||
|
||||
* phobos/config/unix-mid: add utime
|
||||
|
||||
* phobos/std/file.d: changes for GDC
|
||||
|
||||
* phobos/config/gen_unix.c: support utimbuf
|
||||
|
||||
2006-09-23 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
Initial merge of 0.167:
|
||||
|
||||
* dmd/array.c, dmd/cast.c, dmd/declaration.c, dmd/delegatize.c,
|
||||
dmd/expression.[ch], dmd/func.c, dmd/idgen.c, dmd/import.c,
|
||||
dmd/init.c, dmd/inline.c, dmd/lexer.[ch], dmd/mars.c,
|
||||
dmd/mtype.[ch], dmd/optimize.c, dmd/parse.c, dmd/statement.c,
|
||||
dmd/template.c, dmd/typinf.c: Merge 0.167
|
||||
|
||||
* phobos/internal/arraycat.d, phobos/internal/gc/gc.d,
|
||||
phobos/internal/gc/testgc.d, phobos/internal/object.d,
|
||||
phobos/linux.mak, phobos/object.d, phobos/std/asserterror.d,
|
||||
phobos/std/c/linux/linux.d.orig-dmd, phobos/std/c/time.d,
|
||||
phobos/std/file.d, phobos/std/format.d, phobos/std/math.d,
|
||||
phobos/std/string.d, phobos/std/thread.d, phobos/unittest.d,
|
||||
phobos/win32.mak: Merge 0.167
|
||||
|
||||
* phobos/std/c/windows/stat.d: New 0.167
|
||||
|
||||
2006-09-06 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* d-glue.cc (FuncDelaration::toObjFile):
|
||||
Assert isMember for synchronized functions.
|
||||
(NewExp::toElem): Correct some cases for nested classes
|
||||
|
||||
2006-09-04 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* gdc-version, gcc-mars.cc: update
|
||||
|
||||
* d-codegen.cc (trueDeclarationType): support lazy arguments
|
||||
(trueArgumentType): ditto
|
||||
|
||||
* d-codegen.{h, cc}: comment out convertForInitialization
|
||||
|
||||
* Make-lang.in (D_DMD_OBJS): add delegatize
|
||||
|
||||
* dmd/delegatize.c: new, DMD 0.166
|
||||
|
||||
* dmd/cast.c, dmd/declaration.[ch], dmd/expression.[ch],
|
||||
dmd/func.c, dmd/inline.c, dmd/lexer.c, dmd/lexer.h, dmd/mars.c,
|
||||
dmd/mtype.c, dmd/mtype.h, dmd/opover.c, dmd/parse.c,
|
||||
dmd/statement.c, dmd/struct.c, dmd/template.c, dmd/tocsym.c,
|
||||
dmd/typinf.c: Merge DMD 0.166
|
||||
|
||||
* phobos/etc/c/zlib/...: Merge 0.166
|
||||
|
||||
* phobos/internal/aApply.d, phobos/internal/gc/linux.mak,
|
||||
phobos/linux.mak, phobos/std/cover.d, phobos/std/utf.d,
|
||||
phobos/win32.mak: Merge 0.166
|
||||
|
||||
* phobos/etc/zlib/infblock.[ch], phobos/etc/zlib/infcodes.[ch],
|
||||
phobos/etc/zlib/infutil.[ch], phobos/etc/zlib/maketree.c,
|
||||
phobos/etc/zlib/zlib.html: remove, DMD 0.166
|
||||
|
||||
* gdc-version: update
|
||||
|
||||
* d-glue.cc (FuncDeclaration::toObjFile): update
|
||||
|
||||
* dmd/cast.c, dmd/declaration.[ch], dmd/enum.c,
|
||||
dmd/expression.[ch], dmd/func.c, dmd/init.c, dmd/inline.c,
|
||||
dmd/mars.c, dmd/mtype.c, dmd/statement.c, dmd/template.c,
|
||||
dmd/typeinf.c: Merge DMD 0.165
|
||||
|
||||
* phobos/internal/gc/gcx.d, phobos/std.ddoc: Merge DMD 0.165
|
||||
|
||||
* gdc-version: updated
|
||||
|
||||
* dmd/aggregate.h, dmd/declaration.[ch], dmd/doc.c, dmd/dsymbol.c,
|
||||
dmd/expression.c, dmd/import.c, dmd/inifile.c, dmd/mars.c,
|
||||
dmd/module.[ch], dmd/mtype.c, dmd/parse.c, dmd/statement.c,
|
||||
dmd/template.c: Merge DMD 0.164
|
||||
|
||||
* phobos/std/socket.d: Merge DMD 0.164
|
||||
* phobos/std/thread.d: no change
|
||||
|
||||
2006-07-22 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* phobos/internal/gc/testgc.d: add import
|
||||
|
||||
* phobos/std/thread.d (Thread.thread_init, Thread.getESP): make
|
||||
public
|
||||
|
||||
* phobos/std/c/unix/unix.d: use public import
|
||||
|
||||
* dmd/access.c, dmd/aggregate.h, dmd/attrib.c, dmd/class.c,
|
||||
dmd/declaration.[ch], dmd/enum.c, dmd/expression.c, dmd/func.c,
|
||||
dmd/import.[ch], dmd/mars.c, dmd/module.c, dmd/mtype.[ch],
|
||||
dmd/parse.[ch], dmd/scope.[ch], dmd/struct.c, dmd/template.[ch],
|
||||
dmd/todt.c: Merge DMD 0.163
|
||||
|
||||
* phobos/internal/object.d, phobos/std/c/linux/linux.d.orig-dmd,
|
||||
phobos/std/regexp.d, phobos/std/stdio.d, phobos/std/stream.d:
|
||||
Merge DMD 0.163
|
||||
|
||||
2006-07-12 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
Release GDC 0.19
|
||||
|
||||
* dmd/template.c: don't use ehfilter
|
||||
* gdc-version: update
|
||||
|
||||
2006-07-11 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
Support for Apple GCC and other fixes
|
||||
|
||||
* setup-gcc.sh: patch build_gcc
|
||||
* patch-build_gcc-4.0: new
|
||||
|
||||
* dmd-script: Support -arch option and apple driver naming.
|
||||
Use absolute path to execute program with -run.
|
||||
|
||||
2006-07-10 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* phobos/config/darwin8/{frag-gen,frag-math,frag-unix}: new
|
||||
* phobos/configure.in: support Darwin cross compiling
|
||||
* phobos/configure.in: updated
|
||||
|
||||
* phobos/config/gen_unix.c (c_fcntl): added *_OK enums
|
||||
* phobos/config/skyos/frag-unix: updated
|
||||
|
||||
2006-07-03 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* ../../gcc/tree.h, ../../gcc/tree-dump.c: machine readable dump
|
||||
|
||||
Merge DMD 0.162
|
||||
|
||||
* d-glue.cc (AssignExp::toElem): use _d_arraysetlength2p
|
||||
|
||||
* phobos/internal/gc/gc.d: chanage _d_arraysetlength2 to
|
||||
_d_arraysetlength2p
|
||||
|
||||
2006-07-02 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* d-codegen.{h, cc}: support _d_arraysetlength2
|
||||
|
||||
* dmd/cast.c, dmd/declaration.c, dmd/doc.c, dmd/expression.c,
|
||||
dmd/func.c, dmd/mars.c, dmd/mtype.c, dmd/parse.c, dmd/struct.c,
|
||||
dmd/template.[ch], dmd/toobj.c: merged
|
||||
|
||||
* phobos/internal/gc/gc.d, phobos/object.d,
|
||||
phobos/std/asserterror.d, phobos/std/moduleinit.d: merged
|
||||
|
||||
---
|
||||
|
||||
* phobos/std/regexp.d (RegExp.Range.setbitmax): fix for
|
||||
big endian
|
||||
|
||||
2006-06-28 DF <dvdfrdmn@users.sf.net>
|
||||
|
||||
* d-glue.cc (TypeStruct::toCtype, TypeEnum::toCtype): Move
|
||||
initTypeDecl call to after size calculation.
|
||||
|
||||
2006-06-24 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* phobos/Makefile.in: fix and clean up config.d dependencies
|
||||
|
||||
* d-gcc-real.cc (real_t): fix assumptions about HOST_WIDE_INT
|
||||
|
||||
2006-06-23 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* Make-lang.in, asmstmt.cc, d-convert.cc, d-gcc-includes.h,
|
||||
d-lang.cc, setup-gcc.sh: update to support building with Apple
|
||||
GCC
|
||||
* d-apple-gcc.cc, patch-apple-gcc-4.0.x: new
|
||||
|
||||
Misc fixes
|
||||
|
||||
* Make-lang.in: Add dependencies for DMD header files.
|
||||
|
||||
* phobos/config/gen_unix.c (c_time): fix array bounds bug
|
||||
|
||||
2006-06-22 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* Make-lang.in: use BUILD_LDFLAGS for generator progs
|
||||
|
||||
2006-06-21 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* d-asm-i386.h: implement offset/offsetof
|
||||
|
||||
2006-06-20 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
Merge DMD 0.161
|
||||
|
||||
* gcc-mars.cc, gdc-version: updated
|
||||
|
||||
* dmd/cast.c, dmd/class.c, dmd/declaration.[ch], dmd/dsymbol.c,
|
||||
dmd/expression.[ch], dmd/func.c, dmd/idegen.c, dmd/import.h,
|
||||
dmd/inline.c, dmd/lexer.[ch], dmd/mars.[ch], dmd/module.c,
|
||||
dmd/mtype.c, dmd/opover.c, dmd/parse.c, dmd/root.[ch],
|
||||
dmd/statement.c, dmd/struct.c, dmd/template.[ch], dmd/toobj.c:
|
||||
Merge DMD 0.161
|
||||
|
||||
* phobos/internal/adi.d, phobos/internal/cast.d,
|
||||
phobos/internal/trace.d, phobos/linux.mak,
|
||||
phobos/std/asserterror.d, phobos/std/base64.d,
|
||||
phobos/std/bitarray.d, phobos/std/boxer.d,
|
||||
phobos/std/c/linux/socket.d, phobos/std/c/windows/windows.d,
|
||||
phobos/std/c/windows/winsock.d, phobos/std/conv.d,
|
||||
phobos/std/cstream.d, phobos/std/date.d, phobos/std/dateparse.d,
|
||||
phobos/std/demangle.d, phobos/std/file.d, phobos/std/format.d,
|
||||
phobos/std/math.d, phobos/std/math2.d, phobos/std/mmfile.d,
|
||||
phobos/std/random.d, phobos/std/regexp.d, phobos/std/socket.d,
|
||||
phobos/std/socketstream.d, phobos/std/stream.d,
|
||||
phobos/std/string.d, phobos/std/stream.d, phobos/std/thread.d,
|
||||
phobos/std/typeinfo/ti_Along.d, phobos/std/typeinfo/ti_Aulong.d,
|
||||
phobos/std/tyeinfo/ti_void.d, phobos/std/uni.d, phobos/std/uri.d,
|
||||
phobos/std/utf.d, phobos/std/windows/registry.d, phobos/std/zip.d,
|
||||
phobos/std/zlib.d, phobos/std.ddoc, phobos/unittest.d,
|
||||
phobos/win32.mak: Merge DMD 0.161
|
||||
|
||||
* Make-lang.in, d-lang.cc: Possible workaround for MingGW path
|
||||
issues. Create d-confdefs.h to contain the values of D_PHOBOS_DIR
|
||||
and D_PHOBOS_TARGET_DIR.
|
||||
|
||||
2006-06-10 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* History: new file
|
||||
* package/install.sif: ditto
|
||||
* package/simple.sh:
|
||||
|
||||
* phobos/std/zip.d (putUshort): fix for BigEndian case
|
||||
|
||||
* phobos/internal/gc/gcgccextern.d: update for version(freebsd)
|
||||
|
||||
* target-ver-syms.sh: Use "freebsd" for FreeBSD.
|
||||
|
||||
* phobos/configure.in: Enable std.loader for FreeBSD.
|
||||
* phobos/std/loader.d: ditto
|
||||
* phobos/configure: updated
|
||||
|
||||
* Make-lang.in: Support package building. Cleanup.
|
||||
|
||||
2006-06-08 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* patch-gcc-4.0.x: updated with...
|
||||
* .../gcc/tree-nested.c: check if static chain is a PARM_DECL
|
||||
(Bugzilla 175)
|
||||
|
||||
2006-06-07 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* Make-lang.in: use CXX_FOR_BUILD
|
||||
|
||||
* phobos/std/format.d (unittest): Some C libraries do not support
|
||||
the %A format.
|
||||
|
||||
2006-06-06 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* phobos/config/skyos/frag-unix: update for SkyOS beta 10
|
||||
|
||||
2006-06-05 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
Merge DMD 0.160
|
||||
|
||||
* d-codegen.cc (arrayType): handle zero-length arrays for local
|
||||
variables.
|
||||
|
||||
* gdc-version, gcc-mars.cc: update
|
||||
|
||||
* d-glue.cc (NewExp::toElem): support 'exp. new ...'
|
||||
|
||||
* d-codegen.{h, cc}: support _d_assert_msg
|
||||
|
||||
* dmd/attrib.c, dmd/enum.c, dmd/expression.[ch], dmd/idgen.c,
|
||||
dmd/inifile.c, dmd/inline.c, dmd/mars.c, dmd/module.c,
|
||||
dmd/mtype.c, dmd/opover.c, dmd/parse.[ch], dmd/statement.[ch],
|
||||
dmd/staticassert.[ch], dmd/struct.c: Merge DMD 0.160
|
||||
|
||||
* phobos/std/asserterror.d, phobos/std/regexp.d,
|
||||
phobos/std/zlib.d, phobos/std.ddoc, phobos/win32.mak: Merge DMD
|
||||
0.160
|
||||
|
||||
2006-06-04 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
Various fixes
|
||||
|
||||
* d-codegen.cc (twoFieldType): cleanup
|
||||
|
||||
* phobos/internal/gc/gc_dyld.c: correct callback signature
|
||||
|
||||
* phobos/std/format.d (unittest): Undo test change.
|
||||
(putreal): Handle the case where real is equivalent to double.
|
||||
|
||||
* d-glue.cc (TypeClass::toCtype): use prepareTypeDecl instead of
|
||||
setting an initial TYPE_NAME (Bugzilla 174)
|
||||
(TypeStruct::toCtype): ditto
|
||||
(TypeEnum::toCtype): ditto
|
||||
|
||||
* d-objfile.{h, cc} (prepareTypeDecl): New: Create type
|
||||
declarations, but do not declare them to back end.
|
||||
|
||||
Merge DMD 0.159 and more
|
||||
|
||||
* d-asm-i386.h (parsePrimaryExp): handle floating point const
|
||||
decls specially (Bugzilla 141)
|
||||
|
||||
2006-06-03 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* d-glue.cc (AssertExp::toElem): handle interfaces
|
||||
|
||||
* phobos/std/math.d (poly): fix for darwin x86
|
||||
|
||||
* phobos/std/format.d (unittest): handle some variation in %a
|
||||
formats
|
||||
|
||||
* gdc-version: updated
|
||||
|
||||
* gcc-mars.cc: updated
|
||||
|
||||
* dmd/attrib.c, dmd/attrib.h, dmd/class.c, dmd/declaration.c,
|
||||
dmd/doc.c, dmd/expression.c, dmd/expression.h, dmd/func.c,
|
||||
dmd/link.c, dmd/mars.c, dmd/module.c, dmd/module.h, dmd/parse.c,
|
||||
dmd/parse.h, dmd/statement.c, dmd/staticassert.c, dmd/struct.c,
|
||||
dmd/template.c, dmd/toobj.c: Merge DMD 0.159
|
||||
|
||||
* phobos/std/c/linux/linux.d.orig-dmd,
|
||||
phobos/std/c/linux/linuxextern.d, phobos/std/c/windows/windows.d,
|
||||
phobos/std/regexp.d, phobos/std/string.d, phobos/std/uni.d,
|
||||
phobos/std.ddoc: Merge DMD 0.159
|
||||
|
||||
* dmd-script: use -O3 for GCC if -O is passed
|
||||
|
||||
Fix bugs 157, 162, 164, 171
|
||||
|
||||
* d-asm-i386.h: 'invlpg' instruction takes an operand (Bug 171)
|
||||
|
||||
* patch-gcc-4.0.x: updated with...
|
||||
* .../gcc/tree-nested.c: use a VAR_DECL for custom static chain
|
||||
(Bug 162, Bug 164)
|
||||
|
||||
* gdc-version: updated
|
||||
|
||||
* d-glue.cc (FuncExp::toElem): Handle Tpointer case. (Bug 157)
|
||||
|
||||
2006-06-01 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* Start of SourceForge repository
|
||||
|
||||
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved.
|
1340
gcc/d/ChangeLog-2007
Normal file
1340
gcc/d/ChangeLog-2007
Normal file
File diff suppressed because it is too large
Load Diff
331
gcc/d/ChangeLog-2008
Normal file
331
gcc/d/ChangeLog-2008
Normal file
@ -0,0 +1,331 @@
|
||||
2008-12-12 Arthur Loiret <arthur.loiret@u-psud.fr>
|
||||
|
||||
Bugzilla 929:
|
||||
|
||||
* dmd/mtype.c: Provide isZeroInit() overload in TypeAArray that
|
||||
returns TRUE.
|
||||
* dmd/mtype.h: Add prototype for TypeAArray::isZeroInit().
|
||||
|
||||
* dmd2/mtype.c, dmd2/mtype.h: Ditto.
|
||||
|
||||
2008-07-21 David Friedman <David Friedman>
|
||||
|
||||
* dmd/root.c, dmd2/root.c: Fix earlier patching error.
|
||||
|
||||
* phobos/config/x3.c, phobos2/config/x3.c: Fix problem when
|
||||
building under MSYS.
|
||||
|
||||
* config-lang.in: Remove lang_requires.
|
||||
|
||||
2008-07-20 David Friedman <David Friedman>
|
||||
|
||||
* dmd/expression.c, dmd2/expression.c: Make integer conversion
|
||||
fix work for other hosts/targets.
|
||||
|
||||
2008-07-20 Arthur Loiret <arthur.loiret@u-psud.fr>
|
||||
|
||||
* dmd/expression.c: Fix integer conversion routines on x86_64.
|
||||
Patch from downs <default_357-line@yahoo.de>, thanks!
|
||||
* dmd2/expression.c: Likewise.
|
||||
|
||||
* config-lang.in: Add lang_requires="c c++".
|
||||
|
||||
2008-07-19 David Friedman <David Friedman>
|
||||
|
||||
* patches/patch-gcc-4.0.x, patches/patch-gcc-4.1.x: Fix infinite
|
||||
loop bug in patch.
|
||||
* patches/patch-apple-gcc-4.0.x: Ditto.
|
||||
|
||||
* d-lang.cc: Do not assume D_OS_VERSYM is defined.
|
||||
Handle TARGET_xxx_CPP_BUILTINS macros for more targets.
|
||||
|
||||
2008-07-17 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* dmd-script: Append an exe suffix to executables when the
|
||||
target is Windows.
|
||||
|
||||
* phobos/gcc/deh.d, phobos2/gcc/deh.d: Fix for sjlj exceptions.
|
||||
|
||||
2008-06-16 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* d-decls.cc: Correct logic for output constanting vars for V1.
|
||||
|
||||
2008-06-01 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
Merge DMD.1.30 and 2.014
|
||||
|
||||
* dmd-script: Implement -man, -lib and single-object features.
|
||||
|
||||
* phobos2/Makefile.am: add bigint
|
||||
|
||||
* phobos2/config/{ldfuncs,ldfuncs-darwin,ldfuncs-ppclinux,noldfuncs},
|
||||
Merge nanl change from std/c/math.d
|
||||
|
||||
* phobos2/gcc/support.d: Merge std/c/math.d changes.
|
||||
|
||||
* d-objfile.cc (obj_append): Implement.
|
||||
* phobos2/std/c/unix/unix.d: Merge linux.d and socket.d changes
|
||||
|
||||
* d-glue.cc, d-irstate.cc, d-lang.cc: Update
|
||||
|
||||
* dmd/..., dmd2/..., phbobos/..., phobos2/...: Merge
|
||||
|
||||
2008-05-26 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* asmstmt.cc, d-decls.cc, d-glue.cc, d-misc.c, d-objfile.{cc, h}:
|
||||
Fix for -combine compilation. Remove fileContext global and clean
|
||||
up generation of unique symbol names.
|
||||
|
||||
* phobos/internal/object.d: Correct merge error
|
||||
|
||||
----
|
||||
|
||||
* dmd-script, lang.opt, d-lang.cc, : support -ignore
|
||||
|
||||
Merge DMD 1.029 and 2.013
|
||||
|
||||
* phobos2/std/perf.d: use std.c.unix.unix
|
||||
|
||||
2008-05-22 Arthur Loiret <arthur.loiret@u-psud.fr>
|
||||
|
||||
* target-ver-syms.sh: Add missing CPUs and fix
|
||||
d_cpu_versym/d_cpu_versym64 for each.
|
||||
|
||||
* d-lang.cc: Fix build on non biarched 64-bit archs (alpha, ia64, ...)
|
||||
and fix 64-bit cpu detection.
|
||||
|
||||
* Move patch-* to patches/
|
||||
* setup-gcc.sh: Update.
|
||||
|
||||
2008-05-10 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* lang-specs.h: Support a "cc1d" spec. (Bugzilla 2068)
|
||||
|
||||
Merge DMD 1.028 and 2.012
|
||||
|
||||
* d-codegen.{h,cc}: Add postblitting array libcalls.
|
||||
|
||||
* phobos2/internal/arrayassign.d
|
||||
(_d_arraysetassign, _d_arraysetctor): Use size_t.
|
||||
|
||||
* d-glue.cc (AssignExp::toElem): Postblit-aware code
|
||||
|
||||
* phobos2/Makefile.am: Add arrayssign.d. Remove math2.d.
|
||||
|
||||
* dmd/..., dmd2/..., phbobos/..., phobos2/...: Merge
|
||||
|
||||
2008-05-03 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* d-dmd-gcc.h, d-glue.cc, dmd*/toobj.c: Cleanup: Remove unused
|
||||
d_gcc_aggregate_dtors.
|
||||
|
||||
2008-05-02 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
Merge DMD 1.027 and 2.011
|
||||
|
||||
* termios.d: Point to std.c.unix.unix. Leave original
|
||||
termios.d as termios.d.orig-dmd
|
||||
|
||||
* asmstsmt.cc: Implement blockExit
|
||||
|
||||
* phobos2/config/unix.x3: Add termios stuff
|
||||
|
||||
* phobos2/std/c/unix/unix.d: Merge new funcs from std.c.linux.d
|
||||
|
||||
* d-objfile.cc: Implement stub obj_startaddress
|
||||
|
||||
* d-glue.cc (ForStatement::toIR): condition may be NULL
|
||||
(DeleteExp::toIR): Use libcalls for interfaces
|
||||
|
||||
* dmd*/clone.c, dmd*/e2ir.c: New files.
|
||||
|
||||
* Make-lang.in: Add new clone.c
|
||||
|
||||
* d-codegen.{h, cc}, d-glue.cc: Use _d_callinterfacefinalizer.
|
||||
Also use _d_delinterface instead of casting.
|
||||
|
||||
* dmd/..., dmd2/..., phbobos/..., phobos2/...: Merge
|
||||
|
||||
2008-04-27 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
Merge DMD 1.026 and 2.010
|
||||
|
||||
* dmd/..., dmd2/..., phbobos/..., phobos2/...: Merge
|
||||
|
||||
---
|
||||
|
||||
* d-lang.cc (d_write_global_declarations): Make earlier change
|
||||
regarding cgraph_optimize only apply to 4.0.x.
|
||||
|
||||
---
|
||||
|
||||
* d-decls.cc (VarDeclartion::toSymbol): Change for
|
||||
V2 STCmanifest. Make more constant vars have
|
||||
static storage (instead of making CONST_DECLs) in
|
||||
both V1 and V2.
|
||||
|
||||
* dmd2/constfold.c (Cmp): Compare wchar and dchar
|
||||
strings portably.
|
||||
|
||||
* asmstmt.cc (ExtAsmStatement::semantic): Heuristic
|
||||
for evaluating operands: If an input operand, evaluate.
|
||||
|
||||
* d-asm-i386.h: Make previous change apply to V1.
|
||||
|
||||
* d-glue.cc (TypeEnum::toCtype): Update.
|
||||
|
||||
Phobos changes (applies to V2 Phobos as well):
|
||||
|
||||
* phobos/Makefile.am, phobos/configure.in:
|
||||
Deal with strerror_r portability.
|
||||
|
||||
* phobos/Makefile.in, phobos/configure, phobos/config.h.in:
|
||||
Updated.
|
||||
|
||||
* phobos/gcc/cbridge_strerror.c: New file.
|
||||
|
||||
* phobos/std/c/string.d: Replace non-portable strerror_r with
|
||||
_d_gnu_cbridge_strerror.
|
||||
|
||||
* phobos/std/file.d, phobos/std/loader.d, phobos/std/process.d,
|
||||
phobos/std/socket.d, phobos/std/stdio.d: Use
|
||||
_d_gnu_cbridge_strerror.
|
||||
|
||||
Merge DMD 2.009:
|
||||
|
||||
* dmd2/..., phobos2/...: Merge.
|
||||
|
||||
Merge DMD 1.025:
|
||||
|
||||
* dmd/..., phobos/...: Merge.
|
||||
|
||||
2008-04-25 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* asmstmt.cc, d-asm-i386.h: Handle some other cases
|
||||
for constant floating point operands.
|
||||
|
||||
2008-04-19 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* dmd/toobj.c, dmd2/toobj.c (EnumDeclaration::toObjFile):
|
||||
Output initializer correctly.
|
||||
|
||||
* d-decls.cc (EnumDeclaration::toInitializer): Correctly
|
||||
set up initializer symbol. (Bugzilla 1746)
|
||||
|
||||
2008-04-17 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* dmd/toobj.c (InterfaceDeclaration::toObjFile): Fix error.
|
||||
(Bugzilla 1844)
|
||||
|
||||
2008-04-16 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* d-codegen.{h, cc}: Clean up nested function / nested class /
|
||||
closure code.
|
||||
|
||||
* phobos/std/c/stdlib.d, phobos2/...: Remove comment that hides
|
||||
atof. (Bugzilla 1888)
|
||||
|
||||
2008-03-11 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* d-glue.cc: cleanup
|
||||
|
||||
* dmd/expression.c (DotVarExp::semantic): Apply fix from dmd2/
|
||||
|
||||
* dmd2/expression.c (DotVarExp::semantic): Move fix to
|
||||
better location.
|
||||
|
||||
2008-03-09 David Friedman <dvdfrdmn@users.sf.net>
|
||||
|
||||
* dmd2/func.c (FuncDeclaration::needsClosure): Closures fix:
|
||||
Change test from isVirtual to isThis.
|
||||
|
||||
* dmd2/expression.c (DotVarExp::semantic): Note change from DMD.
|
||||
|
||||
----
|
||||
|
||||
* patch-build_gcc-5465: Correctly build driver-driver
|
||||
|
||||
* phobos*/Makefile.am (MAIN_OBJS): Add std/cover.o
|
||||
|
||||
* phobos2/std/file.d: use 'mkdir -p' in unittest
|
||||
|
||||
* d-builtins2.cc: Fixes for pointer-to-function types (for V2)
|
||||
|
||||
* d-codegen.cc: Add _d_allocmemory libcall.
|
||||
(emitLocalVar): Rework.
|
||||
(var): New function to handle static-frame/closure variables
|
||||
(convertTo): Use typesSame instead of typesCompatible
|
||||
(assignValue): New function to handle Exp(v=value) vs. Exp(value)
|
||||
(getFrameForFunction, getFrameForNestedClass): New interface
|
||||
to get frames for nested functions.
|
||||
(functionNeedsChain): Return false for nested functions that
|
||||
take closures.
|
||||
|
||||
* d-decls.cc: Changes for const/invariant/STCinit
|
||||
|
||||
* d-glue.cc: Use new interface for nested functions. Use
|
||||
IRState::var instead of v->toSymbol()->Stree. Create
|
||||
closures.
|
||||
|
||||
* d-lang.cc: Implement CONVERT_PARM_FOR_INLINING hook
|
||||
|
||||
* d-objfile.cc: Add case for closure-using function when
|
||||
setting the link-once attribute.
|
||||
|
||||
* package/simple.sh: install .../include/d2
|
||||
|
||||
* patch-build_gcc-4.0, patch-build_gcc-5465: Support D 2.0
|
||||
includes and libraries.
|
||||
|
||||
* phobos2/std/bitmanip.d: Apply previous bitarray.d changes.
|
||||
|
||||
* phobos*/std/typeinfo/ti_ptr.d (getHash): Cast to hash_t.
|
||||
|
||||
* d-decls.cc (VarDeclaration::toSymbol): For D 2.0, use
|
||||
isInvariant() and STCinit as criteria for making CONST_DECLs and
|
||||
setting TREE_READONLY.
|
||||
|
||||
* phobos2/std/c/linux/linux.d: Do not import std.c.dirent.
|
||||
|
||||
* phobos2/std/c/dirent.d: Deprecated std.c.dirent.
|
||||
|
||||
* phobos2/std/c/unix/unix.d: Move dirent/DIR routines here.
|
||||
|
||||
* phobos*/std/c/darwin/ldblcompat.d: declare constants as 'string'
|
||||
|
||||
Merge DMD 2.008:
|
||||
|
||||
* dmd2/..., phobos2/...: Merge.
|
||||
|
||||
Merge DMD 1.024:
|
||||
|
||||
* phobos*/config/unix.x3: ensure MSG_NOSIGNAL is defined
|
||||
|
||||
* dmd/..., phobos/...: Merge.
|
||||
|
||||
------
|
||||
|
||||
* patch-apple-gcc-4.0.x, patch-apple-gcc-5465: Include patch
|
||||
for SRA pass like the other 4.x patches.
|
||||
|
||||
* d-codegen.cc (convertTo): Ensure pointers are cast to an
|
||||
unsigned type.
|
||||
|
||||
* d-objfile.cc (dt2tree_list_of_elems): Always generate a
|
||||
CONSTRUCTOR for struct data.
|
||||
(ObjectFile::ObjectFile): Use NULL_TREE for file context instead
|
||||
of TRANSLATION_UNIT_DECL.
|
||||
|
||||
* d-lang.cc (d_write_global_declarations): Call
|
||||
debug_hooks->global_decl before cgraph_optimize so that nested
|
||||
class functions do not get passed to dwarf2out before the
|
||||
outer class functions.
|
||||
|
||||
* Rename patch-build_gcc-4.0 to patch-build_gcc-4.0.x
|
||||
|
||||
|
||||
Copyright (C) 2008 Free Software Foundation, Inc.
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved.
|
185
gcc/d/ChangeLog-2009
Normal file
185
gcc/d/ChangeLog-2009
Normal file
@ -0,0 +1,185 @@
|
||||
2009-12-28 michaelp <baseball.mjp@gmail.com>
|
||||
|
||||
Merge with DMD 1.043
|
||||
|
||||
* phobos/configure.in: Changed part of phobos configure.
|
||||
|
||||
* samples/README, samples/samples.sh: Uploading the start of the some
|
||||
small tests to help in the testing of GDC/D components.
|
||||
|
||||
* Make-lang.in, d-lang.cc, dmd/machobj.c, phobos/config/unix.x3,
|
||||
phobos/std/file.d, phobos/std/moduleinit.d, phobos/std/socket.d: Fixed
|
||||
problem when building on Mac OS X.
|
||||
|
||||
2009-12-05 michaelp <baseball.mjp@gmail.com>
|
||||
|
||||
Merge with DMD 1.042
|
||||
|
||||
* Make-lang.in: Added async.dmd.o
|
||||
|
||||
* d-asm-i386.h, d-codegen.h: Merge changes from dmd/constfold.c.
|
||||
|
||||
* d-codegen.h, phobos2/aclocal.m4, phobos2/configure.in: Fixed
|
||||
problems with D2.
|
||||
|
||||
2009-11-22 michaelp <baseball.mjp@gmail.com>
|
||||
|
||||
Merge with DMD 1.041
|
||||
|
||||
* Make-lang.in: Update for files added in DMD 1.041.
|
||||
|
||||
* d-backendfunctions.c: Added stubs for functions in the backend that
|
||||
cannot be included in the front end source.
|
||||
|
||||
* dmd-script: Added Bitbucket page to display for gdmd wrapper script.
|
||||
|
||||
2009-11-07 Vincenzo Ampolo <vincenzo.ampolo@gmail.com>
|
||||
|
||||
Changes to GCC-4.4.x branch:
|
||||
|
||||
* tools/makewebstatistics.d: Added d tool to generate webstats about
|
||||
dstress in D2.
|
||||
|
||||
2009-10-25 michaelp <baseball.mjp@gmail.com>
|
||||
|
||||
Merge with DMD 1.040
|
||||
|
||||
* dmd/..., phobos/...: Now working for D1 (Not on GCC 4.3.4?)
|
||||
|
||||
* asmstmt.cc: Merge from dmd/statement.c
|
||||
|
||||
* phobos/acinclude.m4, phobos/configure.in, phobos/phobos-ver-syms.in:
|
||||
Posix is now defined.
|
||||
|
||||
2009-10-24 Vincenzo Ampolo <vincenzo.ampolo@gmail.com>
|
||||
|
||||
* dmd/attrib.c, dmd/cast.c, dmd/class.c, dmd/constfold.c,
|
||||
dmd/declaration.c, dmd/dsymbol.c, dmd/expression.c, dmd/toobj.c: Fixes
|
||||
some errors in the DMD v1 frontend. Trying to fix DMD 1.039, but still
|
||||
no fix. The problem may be in phobos then.
|
||||
|
||||
Changes to GCC-4.4.x branch:
|
||||
|
||||
* d-lang.cc, d-lang.h setup-gcc.sh, patches/patch-gcc-4.4.x,
|
||||
patches/patch-toplev-4.4.x: Applied Eldar patches for gcc 4.4.0
|
||||
|
||||
2009-10-07 Vincenzo Ampolo <vincenzo.ampolo@gmail.com>
|
||||
|
||||
* dmd2/attrib.c, dmd2/class.c, dmd2/declaration.c, dmd2/doc.c,
|
||||
dmd2/dsymbol.h, dmd2/func.c, dmd2/parse.c, dmd2/statement.c,
|
||||
dmd2/template.c, dmd2/toir.c: 2.015 WORKING ;)
|
||||
|
||||
* dmd2/parse.c: Fixed problem with static if.
|
||||
|
||||
* dmd2/template.c: Fixed problem with tuples.
|
||||
|
||||
* Makefile-lang.in: Update for files added in DMD 2.015.
|
||||
|
||||
2009-10-01 Vincenzo Ampolo <vincenzo.ampolo@gmail.com>
|
||||
|
||||
Changes to 2.032 branch:
|
||||
|
||||
* dmd2/..., phobos2/...: Force merge with 2.032 - NOT WORKING AT ALL.
|
||||
- Adding new files.
|
||||
|
||||
2009-10-04 michaelp <baseball.mjp@gmail.com>
|
||||
|
||||
Merge with DMD 1.039
|
||||
|
||||
* d-decls.cc: Merge changes from dmd/mtype.h.
|
||||
|
||||
* phobos/internal/aaA.d, phobos/std/stdio.d: Small Phobos fix.
|
||||
|
||||
2009-09-30 Vincenzo Ampolo <vincenzo.ampolo@gmail.com>
|
||||
|
||||
* phobos2/internal/aaA.d, phobos2/linux.mak, phobos2/std/algorithm.d,
|
||||
phobos2/std/functional.d, phobos2/std/math.d, phobos2/std/thread.d:
|
||||
DMD 2.015 Phobos changes.
|
||||
|
||||
* Make-lang.in: Fixed a problem introduced by Michael modifying a
|
||||
common file between D1 and D2.
|
||||
|
||||
|
||||
2009-09-29 michaelp <baseball.mjp@gmail.com>
|
||||
|
||||
Merge with DMD 1.036
|
||||
|
||||
2009-09-28 Vincenzo Ampolo <vincenzo.ampolo@gmail.com>
|
||||
|
||||
Merge with DMD 2.015
|
||||
|
||||
* dmd2/mtype.h, dmd2/parse.c: Fixed parser in D2.
|
||||
|
||||
* dmd2/template.c, dmd2/toobj.c: Other fixes.
|
||||
|
||||
2009-09-28 michaelp <baseball.mjp@gmail.com>
|
||||
|
||||
Merge with DMD 1.035
|
||||
|
||||
* d-objfile.cc: Merge changes from dmd/attrib.c.
|
||||
|
||||
* phobos/Makefile.in, phobos/internal/arraydouble.d,
|
||||
phobos/internal/arrayfloat.d: Included arraydouble, arrayfloat, and
|
||||
arrayreal in libphobos Makefile.
|
||||
|
||||
* asmstmt.cc, dmd/statement.c, dmd/statement.h, phobos/std/math.d: Fixed
|
||||
Phobos std.math bug.
|
||||
|
||||
2009-09-25 michaelp <baseball.mjp@gmail.com>
|
||||
|
||||
Merge with DMD 1.033
|
||||
|
||||
2009-09-17 Vincenzo Ampolo <vincenzo.ampolo@gmail.com>
|
||||
|
||||
* dmd2.032/...: Initial import of version 2.032.
|
||||
|
||||
* setup-gcc.sh, dmd/.svn/...: Removed .svn directory.
|
||||
|
||||
2009-09-13 michaelp <baseball.mjp@gmail.com>
|
||||
|
||||
* phobos/std/boxer.d phobos/std/dateparse.d: Fixed phobos build and
|
||||
possible implicit conversion errors in boxer.d.
|
||||
|
||||
* d-objfile.cc: Removed assert(0) line 926.
|
||||
|
||||
2009-09-13 Vincenzo Ampolo <vincenzo.ampolo@gmail.com>
|
||||
|
||||
* History gdc-version: Changed version.
|
||||
|
||||
* phobos2/config/x3, setup-gcc.sh: Added support for DMD 2.
|
||||
|
||||
* phobos2/std/c/string.d, phobos2/std/contracts.d: Fixed a std.string
|
||||
bug following these guidelines:
|
||||
http://www.digitalmars.com/d/archives/D/gnu/strerror_r_3403.html
|
||||
|
||||
* phobos2/std/contracts.d, phobos2/std/date.d, phobos2/std/dateparse.d,
|
||||
phobos2/std/file.d, phobos2/std/md5.d, phobos2/std/path.d,
|
||||
phobos2/std/random.d, phobos2/std/stdio.d: Fix DMD 2 for GCC-4.3.4
|
||||
|
||||
2009-09-11 Vincenzo Ampolo <vincenzo.ampolo@gmail.com>
|
||||
|
||||
Switching to Mercurial branch system.
|
||||
|
||||
* d/...: Setting up default branch with GCC-4.3.x support.
|
||||
|
||||
* branches/gcc-4.1/...: Starting gcc-4.1.x stable branch.
|
||||
|
||||
* setup-gcc.sh, target-ver-syms.sh: Fixed permission problems in
|
||||
bash scripts.
|
||||
|
||||
2009-09-10 Vincenzo Ampolo <vincenzo.ampolo@gmail.com>
|
||||
|
||||
* trunk/...: Import of gdc 0.24 stable into bitbucket.
|
||||
|
||||
2009-01-31 Arthur Loiret <arthur.loiret@u-psud.fr>
|
||||
|
||||
* d-glue.cc, d-objfile.cc, d-codegen.cc, d-lang.h, d-builtins2.cc,
|
||||
d-convert.cc, d-codegen.h: Replace calls to build macro by appropriate
|
||||
buildN function (build is removed in GCC > 4.1).
|
||||
|
||||
|
||||
Copyright (C) 2009 Free Software Foundation, Inc.
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved.
|
1484
gcc/d/ChangeLog-2010
Normal file
1484
gcc/d/ChangeLog-2010
Normal file
File diff suppressed because it is too large
Load Diff
1248
gcc/d/ChangeLog-2011
Normal file
1248
gcc/d/ChangeLog-2011
Normal file
File diff suppressed because it is too large
Load Diff
857
gcc/d/ChangeLog-2012
Normal file
857
gcc/d/ChangeLog-2012
Normal file
@ -0,0 +1,857 @@
|
||||
2013-02-15 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* Make-lang.in (GDC_EXTENDED_ASM_SYNTAX): Remove macro.
|
||||
|
||||
2013-02-14 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-lang.h (D_DECL_IS_CONTRACT): Remove macro.
|
||||
* d-decls.cc (FuncDeclaration::toSymbol): Likewise.
|
||||
|
||||
2013-02-13 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-lang.cc (d_gcc_is_target_win32): Remove.
|
||||
(d_add_builtin_version): New function to handle define_builtin
|
||||
callback from backend.
|
||||
* d-codegen.cc (IRState::maybeExpandSpecialCall): Remove intrinsic bt.
|
||||
|
||||
* d-builtins.c: Merge with d-builtins2.cc.
|
||||
* d-builtins2.cc: Remove.
|
||||
|
||||
2013-02-07 Johannes Pfau <johannespfau@gmail.com>
|
||||
|
||||
* d-lang.cc (d_init): Use gcc's config system for predefined OS versions.
|
||||
* setup-gcc.sh: Likewise.
|
||||
* target-ver-syms.sh: Likewise.
|
||||
|
||||
2013-02-05 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-builtins2.cc (gcc_type_to_d_type): Remove STRUCTTHISREF condition.
|
||||
* d-decls.cc (FuncDeclaration::toSymbol): Likewise.
|
||||
* d-elem.cc (ThisExp::toElem): Likewise.
|
||||
* d-ctype.cc (TypeSArray::toCtype): Remove SARRAYVALUE condition.
|
||||
* d-codegen.cc (IRState::isDeclarationReferenceType): Likewise.
|
||||
(IRState::isArgumentReferenceType): Likewise.
|
||||
|
||||
2013-02-01 Johannes Pfau <johannespfau@gmail.com>
|
||||
|
||||
* d-lang.cc (d_init): Use gcc's config system for predefined CPU versions.
|
||||
(d_init): Fix definition of D_LP64 version.
|
||||
* setup-gcc.sh: Likewise.
|
||||
* target-ver-syms.sh: Likewise.
|
||||
|
||||
2012-12-16 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-decls.cc (FuncDeclaration::toSymbol): Don't optimise PUREconst
|
||||
calls.
|
||||
|
||||
2012-10-27 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-codegen.cc (IRState::buildAssignOp): Handle case where LHS type is
|
||||
not compatible with expression type.
|
||||
|
||||
2012-10-26 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-decls.cc (ClassDeclaration::toSymbol): Use empty RECORD_TYPE to
|
||||
build internal symbol.
|
||||
(Module::toSymbol): Likewise.
|
||||
* d-objfile.cc (outdata): Set type size from constructor if not
|
||||
COMPLETE_TYPE_P. Assert that DECL_INITIAL is never bigger than
|
||||
TYPE_SIZE.
|
||||
|
||||
2012-10-25 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-codegen.cc (IRState::getFrameInfo): Use vthis to determine whether
|
||||
function is nested.
|
||||
|
||||
2012-10-21 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-builtins2.cc (gcc_type_to_d_type): Remove special case for
|
||||
double/long double types.
|
||||
(d_gcc_magic_builtins_module): Cleanup generation of builtin types.
|
||||
Add __builtin_unwind_int and __builtin_unwind_uint.
|
||||
|
||||
2012-10-16 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-objfile.cc (ObjectFile::outputThunk): Mark thunk as DECL_WEAK
|
||||
rather than using weakref attribute.
|
||||
|
||||
2012-10-14 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-bi-attrs.h: Remove file.
|
||||
* d-builtins.c (d_attribute_table): Define table of machine independant
|
||||
attributes for gcc builtins.
|
||||
(d_format_attribute_table): Define table of format attributes for gcc
|
||||
builtins.
|
||||
(handle_noreturn_attribute, handle_leaf_attribute,
|
||||
handle_const_attribute, handle_malloc_attribute,
|
||||
handle_returns_twice_attribute, handle_pure_attribute,
|
||||
handle_novops_attribute, get_nonnull_operand,
|
||||
handle_nonnull_attribute, handle_nothrow_attribute,
|
||||
handle_sentinel_attribute, handle_type_generic_attribute,
|
||||
handle_fnspec_attribute, handle_transaction_pure_attribute,
|
||||
ignore_attribute): Moved common attribute handlers from d-bi-attrs.h.
|
||||
* d-lang.cc (LANG_HOOKS_ATTRIBUTE_TABLE): Use instead of
|
||||
LANG_HOOKS_COMMON_ATTRIBUTE_TABLE.
|
||||
(d_attribute_table): Renamed from d_common_attribute_table.
|
||||
(d_format_attribute_table): Renamed from
|
||||
d_common_format_attribute_table.
|
||||
(d_init_ts): Renamed from d_common_init_ts.
|
||||
|
||||
* d-builtins2.cc (d_bi_init): Determine D frontend type for size_t.
|
||||
* d-objfile.cc (ObjectFile::hasModule): Remove old compatibility
|
||||
macros.
|
||||
|
||||
2012-10-08 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-glue.cc (VectorExp::toElem): Handle non-constant array literals as
|
||||
vector expressions.
|
||||
|
||||
2012-10-04 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-glue.cc (VectorExp::toElem): Handle both array literal as well as
|
||||
single element constructors for vector expressions.
|
||||
|
||||
2012-09-27 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-convert.cc (convert): Remove assert.
|
||||
|
||||
2012-09-22 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-codegen.cc (IRState::maybeCompound): Use IRState::compound.
|
||||
(IRState::maybeVoidCompound): Use IRState::voidCompound.
|
||||
(IRState::call): Check TREE_SIDE_EFFECTS to determine order of
|
||||
evaluation in function calls. Evaluate callee before arguments if has
|
||||
side effects.
|
||||
* d-decls.cc (FuncDeclaration::toSymbol): Don't set any pure/nothrow
|
||||
attributes if asserts are generated in code.
|
||||
* d-incpath (add_fileimp_path): Fix ICE using -J option.
|
||||
* d-objfile.cc (Obj::moduleinfo): Clean-up.
|
||||
|
||||
2012-09-18 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-lang.cc (d_initialize_diagnostics): New function, disable unneeded
|
||||
diagnostic options.
|
||||
(d_handle_option): Remove OPT_fdebug_c.
|
||||
* d-spec.c (lang_specific_driver): Remove OPT_fod_, OPT_fop.
|
||||
* lang.opt: Remove -fdebug-c, -fod, and -fop compiler options.
|
||||
|
||||
2012-09-17 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-codegen.h (CtorEltMaker::cons): Adjust call to VEC_safe_push.
|
||||
* d-objfile.cc (ObjectFile::stripVarDecl): Clean-up.
|
||||
|
||||
2012-09-16 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-codegen.cc (IRState::isCallByAlias): New function.
|
||||
(IRState::call): Use IRState::isCallByAlias.
|
||||
* d-objfile.cc (ObjectFile::setupSymbolStorage): Mark
|
||||
force_static_public symbols as public.
|
||||
|
||||
* d-spec.c (lang_specific_driver): Update for GCC-4.8.
|
||||
* lang.opt: Fix spelling of option -static-libphobos
|
||||
|
||||
* d-codegen.cc (IRState::maybeExpandSpecialCall): Do not handle inp*
|
||||
and outp* port intrinsic functions.
|
||||
(IRState::maybeSetUpBuiltin): Likewise.
|
||||
(IRState::expandPortIntrinsic): Remove.
|
||||
|
||||
2012-09-10 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-codegen.cc (AggLayout::doFields): Propagate volatile out of type.
|
||||
(AggLayout::addField): Likewise.
|
||||
* d-decls.cc (VarDeclaration::toSymbol): Likewise.
|
||||
|
||||
2012-09-06 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-codegen.h (IRState::vconvert): Don't use VIEW_CONVERT_EXPR.
|
||||
* d-glue.cc (TypeEnum::toCtype): Mark TYPE_PACKED if flag_short_enums.
|
||||
(TypeClass::toCtype): Mark TREE_ADDRESSABLE to ensure class is always
|
||||
passed in memory.
|
||||
|
||||
* d-tree.def (UNSIGNED_RSHIFT_EXPR): Define new tree expression.
|
||||
(FLOAT_MOD_EXPR): Define new tree expression.
|
||||
* d-lang.cc (d_common_init_ts): New function.
|
||||
(d_write_global_declarations): Call check_global_declarations after
|
||||
finalize_compilation_unit.
|
||||
(d_gimplify_expr): Handle UNSIGNED_RSHIFT_EXPR, IASM_EXPR.
|
||||
* d-codegen.cc (IRState::arrayOpNotImplemented): New function.
|
||||
(IRState::buildOp): New function.
|
||||
(IRState::buildAssignOp): New function.
|
||||
* d-glue.cc (build_bool_binop): Remove function, mostly move to
|
||||
CmpExp::toElem.
|
||||
(build_math_op): Remove function, mostly move to IRState::buildOp.
|
||||
(build_assign_math_op): Remove function, mostly move to
|
||||
IRState::buildAssignOp.
|
||||
(BinExp::toElemBin): Remove function.
|
||||
(IdentityExp::toElem, EqualExp::toElem, CmpExp::toElem)
|
||||
(AndAndExp::toElem, OrOrExp::toElem): Clean-up, use IRState::boolOp.
|
||||
(XorExp::toElem, OrExp::toElem, AndExp::toElem, UshrExp::toElem)
|
||||
(ShrExp::toElem, ShlExp::toElem, ModExp::toElem, DivExp::toElem)
|
||||
(MulExp::toElem, MinExp::toElem, AddExp::toElem):Use
|
||||
IRState::arrayOpNotImplemented, IRState::buildOp.
|
||||
(XorAssignExp::toElem, OrAssignExp::toElem, AndAssignExp::toElem)
|
||||
(UshrAssignExp::toElem, ShrAssignExp::toElem, ShlAssignExp::toElem)
|
||||
(ModAssignExp::toElem, DivAssignExp::toElem, MulAssignExp::toElem)
|
||||
(MinAssignExp::toElem, AddAssignExp::toElem): Use
|
||||
IRState::arrayOpNotImplemented, IRState::buildAssignOp.
|
||||
|
||||
* d-codegen.cc (libcall_ids): Remove _adCmpChar.
|
||||
(IRState::getLibCallDecl): Remove LIBCALL_ADCMPCHAR.
|
||||
* d-glue.cc (CmpExp::toElem): Don't call LIBCALL_ADCMPCHAR.
|
||||
|
||||
* lang.opt: Define Wcast-result.
|
||||
* d-codegen.cc (IRState::convertTo): Warn about null result, but only
|
||||
if -Wcast-result.
|
||||
(IRState::hwi2toli): Move to header.
|
||||
(IRState::realPart): Likewise.
|
||||
(IRState::imagPart): Likewise.
|
||||
(IRState::toElemLvalue): Clean-up tree args array.
|
||||
(IRState::doArraySet): New function.
|
||||
(IRState::arraySetExpr): New function.
|
||||
* d-glue.cc (EqualExp::toElem): Clean-up tree args array.
|
||||
(CatAssignExp::toElem): Likewise.
|
||||
(AssignExp::toElem): Likewise.
|
||||
(DeleteExp::toElem): Likewise.
|
||||
(NewExp::toElem): Use IRState::modify.
|
||||
(ArrayLiteralExp::toElem): Don't call ARRAYLITERALTX library function
|
||||
if assigning to static array.
|
||||
(StructLiteralExp::toElem): Use IRState::arraySetExpr.
|
||||
(do_array_set): Move to IRState::doArraySet.
|
||||
(array_set_expr): Move to IRState::arraySetExpr.
|
||||
|
||||
* d-lang.h (D_TYPE_IMAGINARY_FLOAT): Define.
|
||||
(d_convert_basic): Remove.
|
||||
* d-builtins.c (d_init_builtins): Mark imaginary types as
|
||||
D_TYPE_IMAGINARY_FLOAT.
|
||||
* d-builtins2.cc (gcc_type_to_d_type): Use convert.
|
||||
* d-codegen.cc (IRState::emitLocalVar): Call pushdecl earlier so
|
||||
catches CONST_DECLs.
|
||||
(IRState::convertTo): Remove handling of conversions between
|
||||
imaginary/real, imaginary/complex, complex/imaginary types, use
|
||||
convert.
|
||||
(IRState::convertForArgument): Use convert.
|
||||
(IRState::arrayElemRef): Likewise.
|
||||
(IRState::call): Likewise.
|
||||
(IRState::libCall): Likewise.
|
||||
(IRState::maybeExpandSpecialCall): Likewise.
|
||||
* d-convert.cc (d_convert_basic): Mark static.
|
||||
(convert): Handle correct conversions between imaginary/real,
|
||||
imaginary/complex, complex/imaginary types.
|
||||
* d-glue.cc (InExp::toElem): Use convert.
|
||||
(BoolExp::toElem): Likewise.
|
||||
(FuncDeclaration::buildClosure): Likewise.
|
||||
|
||||
* d-builtins.c (def_fn_type): Use build_varargs_function_type_array and
|
||||
build_function_type_array to create built-in functions.
|
||||
(d_init_builtins): Use lang_hooks.types.type_for_size.
|
||||
* d-builtins2.cc (d_gcc_magic_builtins_module): Use
|
||||
lang_hooks.types.type_for_mode.
|
||||
* d-codegen.cc (IRState::pointerIntSum): Use
|
||||
lang_hooks.types.type_for_size.
|
||||
(IRState::call): Use lang_hooks.types.type_promotes_to.
|
||||
(IRState::maybeExpandSpecialCall): Likewise.
|
||||
* d-glue.cc (build_math_op): Use lang_hooks.types.type_for_mode.
|
||||
* d-lang.cc (d_type_for_mode): Mark static.
|
||||
(d_type_for_size): Likewise.
|
||||
(d_type_promotes_to): Likewise.
|
||||
|
||||
2012-08-31 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-glue.cc (FuncDeclaration::toObjFile): Flatten nested levels and
|
||||
loops in function, delay printing function name in verbose mode until
|
||||
we know the function is being compiled.
|
||||
|
||||
* d-codegen.cc (IRState::buildFrameForFunction): New function.
|
||||
(IRState::buildChain): Use IRState::buildFrameForFunction to get the
|
||||
frame record type.
|
||||
(IRState::getFrameInfo): Likewise.
|
||||
* d-glue.cc (FuncDeclaration::buildClosure): Likewise.
|
||||
|
||||
2012-08-30 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* asmstmt.cc (ExtAsmStatement::toCBuffer): Mark unused parameter as
|
||||
ATTRIBUTE_UNUSED.
|
||||
* d-codegen.cc (WrappedExp::toCBuffer): Likewise.
|
||||
* d-objfile.cc (ObjectFile::setupSymbolStorage): Revert to previous
|
||||
behaviour of setting symbol storage.
|
||||
|
||||
* d-codegen.cc (IRState::expandDecl): Use IRState::vinit.
|
||||
(IRState::binding): Likewise.
|
||||
(IRState::var): Handle all declarations, not just vars.
|
||||
* d-glue.cc (PtrExp::toElem): Simplify use of IRState::var.
|
||||
(SymbolExp::toElem ): Likewise.
|
||||
(ThisExp::toElem): Likewise.
|
||||
|
||||
* d-lang.cc (d_init): Remove 'Thumb' identifier for ARM as 16bit
|
||||
platforms aren't supported.
|
||||
(GNU_LongDouble128): Remove identifier as long double size is
|
||||
determined from type information.
|
||||
|
||||
* d-decls.cc (TypeInfoDeclaration::toSymbol): Mark all typeinfo decls
|
||||
as 'used'.
|
||||
* d-glue.cc (one_elem_array): Remove.
|
||||
(CatExp::toElem): Inline use of one_elem_array, clean-up.
|
||||
* d-objfile.cc (ObjectFile::setupSymbolStorage): Update to better
|
||||
handle use of declarations marked with comdat, extern or static.
|
||||
(ObjectFile::doSimpleFunction): Mark function as 'used'.
|
||||
* dt.cc (dt2node): Clean-up indentation.
|
||||
|
||||
* Make-lang.in: Fix issue with cross-compiler configuration.
|
||||
|
||||
2012-08-29 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* lang-specs.h: Remove special case for handled D source files.
|
||||
* Make-lang.in: Remove special case for building gcc.o, use
|
||||
GCC_EXTRA_LIBS to link against, rather than specific gcc object files.
|
||||
(D_DRIVER_NAME): Remove use of variable.
|
||||
(D_DRIVER_OBJS): Likewise.
|
||||
(D_COMPILER_NAME): Likewise.
|
||||
|
||||
2012-08-23 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-builtins2.cc (eval_builtin): Use builtin_decl_explicit.
|
||||
* d-codegen.cc (IRState::emitLocalVar): Use warning.
|
||||
(IRState::convertTo): Likewise.
|
||||
(IRState::addressOf): Use IRState::markAddressable.
|
||||
(IRState::markAddressable): New function.
|
||||
(IRState::markUsed): New function.
|
||||
(IRState::markRead): New function.
|
||||
(IRState::maybeExpandSpecialCall): Use builtin_decl_explicit.
|
||||
(IRState::floatMod): Likewise.
|
||||
(IRState::exceptionObject): Likewise.
|
||||
* d-glue.cc (IdentityExp::toElem): Likewise.
|
||||
(EqualExp::toElem): Likewise.
|
||||
(PowExp::toElem): Likewise.
|
||||
(AssignExp::toElem): Likewise.
|
||||
(HaltExp::toElem): Likewise.
|
||||
(ArrayLiteralExp::toElem): Likewise.
|
||||
(FuncDeclaration::toObjFile): Likewise.
|
||||
* d-lang.cc (d_mark_addressable): Remove function.
|
||||
(d_mark_exp_read): Remove function.
|
||||
* d-lang.h (d_warning): Remove macro.
|
||||
(d_built_in_decls): Remove macro.
|
||||
* d-objfile.cc (Obj::includelib): Use warning.
|
||||
(Obj::startaddress): Likewise.
|
||||
|
||||
2012-08-22 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-lang.cc (binary): Moved function from frontend.
|
||||
* d-codegen.cc (IRState::extractMethodCallExpr): Update for new C++ VEC
|
||||
template in GCC.
|
||||
* d-bi-attrs.h (parse_optimize_options): Likewise.
|
||||
* d-dmd-gcc.h: Remove ifdef __cplusplus, use GCC_SAFE_DMD.
|
||||
* d-gcc-includes.h: Remove ifdef __cplusplus.
|
||||
* d-lang.h: Likewise.
|
||||
* Make-lang.in: Remove CC and CFLAGS from Makefile, add build rule for
|
||||
new texi man pages.
|
||||
* gdc.texi: New documentation for GDC.
|
||||
|
||||
2012-08-18 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-codegen.cc (IRState::convertTo): Fix to allow conversion between
|
||||
void* and associative arrays.
|
||||
(IRState::convertForArgument): Use d_convert_basic.
|
||||
(IRState::call): Don't use d_convert_basic, now handled by
|
||||
convertForArgument.
|
||||
* d-gcc-real.cc (real_t::real_t): Increase real type mode to be greater
|
||||
than integer type size to prevent overflow in conversions.
|
||||
* d-glue.cc (CastExp::toElem): Don't get implicit AA type.
|
||||
|
||||
2012-08-17 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* dfrontend: Update to D frontend version 2.060
|
||||
|
||||
* d-codegen.cc (libcall_ids): New library functions.
|
||||
(IRState::getLibCallDecl): Implement new library function signatures.
|
||||
* d-codegen.h (LibCall::LIBCALL_NEWITEMT): New enum value.
|
||||
(LibCall::LIBCALL_NEWITEMIT): Likewise.
|
||||
* d-decls.cc (FuncDeclaration::toSymbol): Small readability cleanup.
|
||||
* d-glue.cc (NewExp::toElem): Use new library functions.
|
||||
(StructLiteralExp::toElem): Update for new frontend.
|
||||
(ReturnStatement::toIR): Likewise.
|
||||
* d-incpath.cc (add_import_path): New signature.
|
||||
(add_fileimp_path): Likewise.
|
||||
(add_import_paths): Pass split Strings to helper functions.
|
||||
* d-lang.cc (d_parse_file): Use Obj::init and Obj::term.
|
||||
* d-objfile.cc (objmod): New variable.
|
||||
(Obj::init): New function.
|
||||
(Obj::term): Likewise.
|
||||
(Obj::includelib): Likewise.
|
||||
(Obj::startaddress): Likewise.
|
||||
(Obj::allowZeroSize): Likewise.
|
||||
(Obj::moduleinfo): Likewise.
|
||||
(Obj::export_symbol): Likewise.
|
||||
* symbol.h (Obj): New struct to allow object oriented interface to glue
|
||||
code from frontend.
|
||||
|
||||
* d-builtins2.cc (d_gcc_magic_stdarg_check): Add new va_arg magic
|
||||
function that stores the next value through a passed parameter.
|
||||
Remove workaround for inout signature as va_list is always passed by
|
||||
reference to intrinsic templates.
|
||||
(d_gcc_magic_module): Assign module directly to global IRState.
|
||||
* d-codegen.cc (IRState::builtinsModule): Remove static declaration.
|
||||
(IRState::intrinsicModule): Likewise.
|
||||
(IRState::intrinsicCoreModule): Likewise.
|
||||
(IRState::mathModule): Likewise.
|
||||
(IRState::mathCoreModule): Likewise.
|
||||
(IRState::cstdargTemplateDecl): Likewise.
|
||||
(IRState::cstdargStartTemplateDecl): Likewise.
|
||||
(IRState::varsInScope): Likewise.
|
||||
(IRState::call): Use flag_split_darrays.
|
||||
(IRState::maybeExpandSpecialCall): Clean-up va_start and va_arg
|
||||
implementations.
|
||||
(IRState::maybeSetUpBuiltin): Handle new va_arg function.
|
||||
* d-codegen.h (Intrinsic::INTRINSIC_VA_ARG): New enum definition.
|
||||
(IRState::setBuiltinsModule): Remove.
|
||||
(IRState::setIntrinsicModule): Likewise.
|
||||
(IRState::setMathModule): Likewise.
|
||||
(IRState::setCStdArg): Likewise.
|
||||
* d-glue.cc (CatExp::toElem): Use flag_split_darrays.
|
||||
* d-irstate.cc (IRBase::startFunction): Set varsInScope.
|
||||
* d-lang.cc (d_init_options): Set modules that require special
|
||||
handling.
|
||||
(d_handle_option): Don't handle OPT_fsplit_dynamic_arrays.
|
||||
* lang.opt: fsplit-dynamic-arrays mapped to variable
|
||||
flag_split_darrays.
|
||||
|
||||
2012-08-16 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-glue.cc (IdentityExp::toElem): Re-order precendence of type
|
||||
checking. Treat static arrays as D arrays in identity comparisons.
|
||||
(EqualExp::toElem): Use adEq2 over built-in memcmp for equality
|
||||
comparisons for static and dynamic arrays.
|
||||
(TypeStruct::toCtype): Remove old platform specific workaround.
|
||||
|
||||
* d-builtins2.cc (bi_lib_list): New decl to hold list of GCC library
|
||||
built-ins.
|
||||
(d_bi_init): Add decls to bi_list_list if recognising built-ins.
|
||||
(d_gcc_magic_builtins_module): Rename built-in type C long to
|
||||
__builtin_clong, built-in type C ulong to __builtin_culong.
|
||||
(d_gcc_magic_libbuiltins_check): New function to assign internal
|
||||
symbol for built-in library functions.
|
||||
(d_gcc_magic_libbuiltins_module): New function to scan modules that
|
||||
contain GCC library built-ins.
|
||||
(d_gcc_magic_module): Search all core.stdc modules for possible GCC
|
||||
library built-ins.
|
||||
* d-codegen.h (IRState::useBuiltins): Remove.
|
||||
* d-lang.cc (d_init_options): Don't set IRState::useBuiltins.
|
||||
(d_handle_option): Likewise.
|
||||
* lang.opt: Re-order D frontend compiler options.
|
||||
|
||||
* d-codegen.cc (IRState::buildChain): Override chainLink and chainFunc
|
||||
for function if static chain is passed via hidden 'this' and no frame
|
||||
is created.
|
||||
(IRState::getFrameInfo): Pass static chain around nested functions in
|
||||
the same way as closures for better performance.
|
||||
|
||||
* d-codegen.cc (libcall_ids): Re-order list in ascii collating order,
|
||||
add new library routines to lookup, rename all non-vararg functions to
|
||||
match DMD ABI implementation.
|
||||
(LibCall): Re-order enum and rename values to match libcall_ids.
|
||||
(IRState::toElemLvalue): Use new LibCall name.
|
||||
(IRState::getLibCallDecl): Update to match current library signatures,
|
||||
add implementation of new library routines.
|
||||
(IRState::maybeSetLibCallDecl): New function to set internal symbol
|
||||
for special D RT library functions.
|
||||
* d-decls.cc (FuncDeclaration::toSymbol): Use
|
||||
IRState::maybeSetLibCallDecl.
|
||||
* d-glue.cc (InExp::toElem): Use new LibCall name.
|
||||
(CatAssignExp::toElem): Likewise.
|
||||
(IndexExp::toElem): Likewise.
|
||||
(DeleteExp::toElem): Likewise.
|
||||
(RemoveExp::toElem): Likewise.
|
||||
(NewExp::toElem): Likewise.
|
||||
(ArrayLiteralExp::toElem): Likewise.
|
||||
(AssocArrayLiteralExp::toElem): Likewise.
|
||||
(NullExp::toElem): Use IRState::convertTo.
|
||||
|
||||
* d-codegen.cc (needs_temp): Remove.
|
||||
(IRState::makeTemp): New function.
|
||||
(IRState::maybeMakeTemp): Re-implement to use isFreeOfSideEffects.
|
||||
(IRState::isFreeOfSideEffects): Re-implement to allow better CSE.
|
||||
(IRState::call): Use IRState::makeTemp.
|
||||
|
||||
* d-builtins2.cc (gcc_type_to_d_type): Use d_convert_basic.
|
||||
* d-codegen.cc (IRState::emitLocalVar): Use IRState::vinit.
|
||||
(IRState::convertTo): New function for tree conversions.
|
||||
(IRState::convertTo): Use IRState::convertTo.
|
||||
(IRState::convertForCondition): Likewise.
|
||||
(IRState::darrayVal): Likewise.
|
||||
(IRState::pointerIntSum): Likewise.
|
||||
(IRState::pointerOffsetOp): Likewise.
|
||||
(IRState::pvoidOkay): Likewise.
|
||||
(IRState::boundsCond): Likewise.
|
||||
* d-convert.cc (convert): New function to be called from C.
|
||||
(d_build_truthvalue_op): Use d_convert_basic.
|
||||
* d-glue.cc (convert): Remove.
|
||||
(build_bool_binop): Use IRState::convertTo.
|
||||
(build_math_op): Likewise.
|
||||
(CmpExp::toElem): Likewise.
|
||||
(PowExp::toElem): Likewise.
|
||||
(do_array_set): Likewise.
|
||||
(AssignExp::toElem): Likewise.
|
||||
(VectorExp::toElem): Likewise.
|
||||
(NotExp::toElem): Likewise.
|
||||
(CallExp::toElem): Likewise.
|
||||
(SymbolExp::toElem): Likewise.
|
||||
* dt.cc (dt2tree_list_of_elems): Use d_convert_basic.
|
||||
|
||||
2012-07-26 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-gcc-real.cc (real_t::real_t): Use d_float64 for constructor.
|
||||
(real_t::isConst0): Remove.
|
||||
(real_t::isConst1): Likewise.
|
||||
(real_t::isConst2): Likewise.
|
||||
(real_t::isConstMinus1): Likewise.
|
||||
(real_t::isConstHalf): Likewise.
|
||||
* d-gcc-real.h (longdouble): New typedef for real_t.
|
||||
(ldouble): New template for ldouble conversions.
|
||||
(ld_sprint): New function for ldouble to string formatting.
|
||||
* d-codegen.cc (IRState::hwi2toli): Handle maximum 64bit value case.
|
||||
|
||||
2012-07-18 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-codegen.cc (IRState::delegateVal): Remove ENABLE_CHECKING code.
|
||||
(IRState::objectInstanceMethod): Remove special case to avoid calling
|
||||
DotTypeExp::toElem.
|
||||
* d-glue.cc (CommaExp::toElem): Likewise.
|
||||
(DotTypeExp::toElem): Implement function.
|
||||
(StructLiteralExp::toElem): Assert instead that basetype is a struct.
|
||||
* d-gcc-reah.cc (real_t::real_t): New overload for 'double' type.
|
||||
(real_t::format): Change function type to int, return size of buffer
|
||||
from function.
|
||||
(real_t::formatHex): Likewise.
|
||||
* d-builtins2.cc (d_gcc_magic_stdarg_check): Update signature, remove
|
||||
check for is_c_std_arg.
|
||||
(d_gcc_magic_stdarg_module): Likewise.
|
||||
(d_gcc_magic_module): Remove check for core.vararg.
|
||||
* d-codegen.cc (INTRINSIC_STD_VA_ARG): Remove.
|
||||
(IRState::maybeSetUpBuiltin): Don't handle INTRINSIC_STD_VA_ARG.
|
||||
|
||||
2012-07-13 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-decls.cc (Dsymbol::toSymbolX): Remove use of PRIuSIZE format macro.
|
||||
(FuncDeclaration::toThunkSymbol): Likewise.
|
||||
|
||||
2012-07-12 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-lang.h (D_DECL_IS_CONTRACT): New macro.
|
||||
* d-decls.cc (FuncDeclaration::toSymbol): Mark in and out contracts as
|
||||
D_DECL_IS_CONTRACT.
|
||||
(FuncDeclaration::toThunkSymbol): D thunks no longer private by
|
||||
design. Alter mangling of thunk symbols to be unique across the entire
|
||||
compilation unit.
|
||||
* d-objfile.cc (ObjectFile::makeDeclOneOnly): Catch public contracts to
|
||||
mark them as one-only.
|
||||
(ObjectFile::outputThunk): Mark weakref thunks as private.
|
||||
|
||||
2012-07-10 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* Make-lang.in: Remove unused borrowed objects.
|
||||
* d-builtins2.cc (d_bi_builtin_func): Don't add builtin if
|
||||
-fno-builtin was given.
|
||||
* d-codegen.cc (IRState::emitTemplates): Remove static declaration.
|
||||
(IRState::splitDynArrayVarArgs): Likewise.
|
||||
(IRState::useInlineAsm): Likewise.
|
||||
(IRState::useBuiltins): Likewise.
|
||||
(d_gcc_force_templates): Update to use global gen.
|
||||
* d-codegen.h (emitTemplates): Remove static attribute.
|
||||
(splitDynArrayVarArgs): Likewise.
|
||||
(useBuiltins): Likewise.
|
||||
(useInlineAsm): Remove member.
|
||||
(stdInc): Define new member.
|
||||
* d-incpath.cc (std_inc): Remove global.
|
||||
(add_import_paths): Update function signature.
|
||||
* d-lang.cc (d_init_options): Default splitDynArrayVarArgs to false.
|
||||
(d_init): Update call to add_import_paths.
|
||||
(d_handle_option): Remove OPT_fd_inline_asm, add
|
||||
OPT_fsplit_dynamic_arrays.
|
||||
* lang.opt: Likewise.
|
||||
|
||||
2012-07-08 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-builtins2.cc (d_gcc_type_align): Update function signature. Use
|
||||
type align size to determine the known align size of a decl.
|
||||
* d-dmd-gcc.h (d_gcc_type_align): Update function signature.
|
||||
* symbol.h (Symbol): New member, Salignment.
|
||||
* symbol.cc (Symbol::Symbol): Initialise Salignment.
|
||||
* d-decls.cc (VarDeclaration::toSymbol): Set Salignment if there is an
|
||||
alignment in effect on the decl.
|
||||
(AggregateDeclaration::toInitializer): Likewise.
|
||||
* d-objfile.cc (ObjectFile::outputStaticSymbol): Set DECL_ALIGN if
|
||||
Salignment was given for static decl.
|
||||
|
||||
2012-07-07 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-builtins2.cc (d_gcc_magic_builtins_module): Add check for
|
||||
DECL_ASSEMBLER_NAME_SET_P when testing for builtins that can be
|
||||
markable as pure in the D frontend.
|
||||
|
||||
* d-codegen.cc (IRState::integerConstant): Hide use of
|
||||
HOST_BITS_PER_WIDE_INT macros.
|
||||
(IRState::hwi2toli): Likewise.
|
||||
(IRState::getTargetSizeConst): Likewise.
|
||||
|
||||
* d-builtins.c (d_global_trees): Move declaration here.
|
||||
(lookup_C_type_name): Rename to lookup_ctype_name.
|
||||
(d_init_builtins): Move set-up of d_global_trees here.
|
||||
(gcc_d_backend_init): Move function from d-glue.cc and refactored.
|
||||
(gcc_d_backend_term): Likewise.
|
||||
* d-builtins2.cc (d_bi_init): Set-up D frontend sizes here.
|
||||
* d-glue.cc (gcc_d_backend_init): Removed.
|
||||
(gcc_d_backend_term): Likewise.
|
||||
|
||||
* d-incpath.cc (add_phobos_versyms): New function to scan
|
||||
phobos-vers-syms file.
|
||||
(register_import_chains): Renamed to add_import_paths.
|
||||
* d-lang.cc (d_init): Call add_phobos_versyms and add_import_paths.
|
||||
(d_parse_int): Don't use strtol to get number from argument string.
|
||||
|
||||
* d-incpath.cc (maybe_fixup_phobos_target): Remove.
|
||||
(register_import_chains): Remove use of maybe_fixup_phobos_target.
|
||||
* d-lang.cc (maybe_fixup_os_versym): Remove
|
||||
(d_init): Remove use of maybe_fixup_os_versym.
|
||||
|
||||
* d-lang.cc (saved_reg_names): Remove.
|
||||
(d_init): Remove use of saved_reg_names.
|
||||
(d_post_options): Likewise.
|
||||
|
||||
2012-07-05 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-glue.cc (StructLiteralExp::toElem): Stop after first assignment for
|
||||
constructors built for union types.
|
||||
|
||||
2012-07-01 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* symbol.h (deferredNestedFuncs): Renamed from otherNestedFuncs, use as
|
||||
value type rather than pointer.
|
||||
(thunks): Use as value type rather than pointer.
|
||||
* d-decls.cc (FuncDeclaration::toSymbol): Remove check for
|
||||
deferredNestedFuncs being NULL.
|
||||
(FuncDeclaration::toThunkSymbol): Remove check for thunks being NULL.
|
||||
* d-glue.cc (DelegateExp::toElem): Remove check for deferredNestedFuncs
|
||||
being NULL.
|
||||
(FuncDeclaration::toObjFile): Likewise.
|
||||
* d-objfile.cc (ObjectFile::shouldEmit): Add nested functions to
|
||||
deferredNestedFuncs of their parent function incase parent is actually
|
||||
emitted later in during compilation.
|
||||
* d-builtins2.cc (d_gcc_type_align): Explicit alignment of variables
|
||||
takes precedence over default alignment.
|
||||
* d-gcc-includes.h: Re-order list of includes.
|
||||
|
||||
2012-06-26 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-codegen.cc (IRState::twoFieldType): Use rest_of_decl_compilation.
|
||||
* d-gcc-includes.h: Remove last of poisoned backend headers.
|
||||
* d-glue.cc (FuncDeclaration::toObjFile): Use fprintf for diagnostic
|
||||
message. Use rest_of_decl_compilation directly.
|
||||
(SynchronizedStatement::toIR): Likewise.
|
||||
(TypeFunction::toCtype): Remove old version1 macro.
|
||||
* d-lang.cc (d_parse_file): Remove dependency on backend header. Use
|
||||
fprintf for diagnostic messages.
|
||||
(nametype): Use rest_of_decl_compilation directly.
|
||||
(d_handle_option): Remove version 1 option.
|
||||
* dmd-script: Likewise.
|
||||
* lang.opt: Likewise.
|
||||
* d-objfile.cc (ObjectFile::outputStaticSymbol): Use
|
||||
rest_of_decl_compilation directly.
|
||||
(ObjectFile::declareType): Likewise.
|
||||
(obj_moduleinfo): Likewise.
|
||||
(obj_tlssections): Likewise.
|
||||
(ObjectFile::outputThunk): Implement new method of thunk generation
|
||||
for external symbols using weakref.
|
||||
* d-objfile.h (rodc): Remove.
|
||||
|
||||
2012-06-25 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-builtins.c (d_init_builtins): Use build_tree_list to initialise
|
||||
void_list_node.
|
||||
* d-glue.cc (ArrayLiteralExp::toElem): Always generate code for
|
||||
arrayliteralTp.
|
||||
(TypeFunction::toCtype): Chain on void_list_node to the end of the
|
||||
function type parameters. Fixes function signatures in debugging.
|
||||
|
||||
2012-06-23 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* Make-lang.in (d_OBJS): Add so IN_GCC_FRONTEND is defined when
|
||||
building gdc sources.
|
||||
* d-builtins.c: Remove poisoned headers.
|
||||
* d-codegen.cc: Likewise.
|
||||
* d-gcc-includes.h: GCC system headers included first, removed
|
||||
internally defined macros and poisoned headers.
|
||||
* d-gcc-tree.h: Use GCC system headers instead of defining tree_node.
|
||||
* d-lang.cc: GCC system headers included first.
|
||||
(pushdecl_top_level): Removed.
|
||||
* d-objfile.cc: Remove poisoned headers.
|
||||
* gdc_alloca.h: Use liberty.h instead of handling include of alloca.
|
||||
|
||||
* d-decls.cc (Dsymbol::toSymbolX): Use snprintf rather than sprintf.
|
||||
(FuncDeclaration::toSymbol): Likewise.
|
||||
* d-gcc-real.cc (real_t::init): Likewise.
|
||||
* symbol.cc (Symbol::Symbol): Use NULL_TREE to initialise tree.
|
||||
(symbol_calloc): Use xstrdup to copy string.
|
||||
|
||||
* Make-lang.in: Remove D language version 1 from build
|
||||
(_GNU_SOURCE): Removed macro from build.
|
||||
(ELFOBJ): Likewise.
|
||||
(D_VA_LIST_TYPE_VOIDPTR): Likewise.
|
||||
* asmstmt.cc (ExtAsmStatement::semantic): Removed use of V2 macro.
|
||||
* d-builtins2.cc (d_gcc_builtin_va_list_d_type): Removed use of
|
||||
D_VA_LIST_TYPE_VOIDPTR macro.
|
||||
(gcc_type_to_d_type): Likewise.
|
||||
(d_gcc_magic_stdarg_check): Likewise.
|
||||
(d_gcc_magic_builtins_module): Removed use of V2 macro, and V1
|
||||
encapsulated code.
|
||||
* d-codegen.cc (IRState::convertTo): Likewise.
|
||||
(IRState::toDArray): Likewise.
|
||||
(IRState::typesCompatible): Likewise.
|
||||
(IRState::arrayBoundsCheck): Likewise.
|
||||
(IRState::assertCall): Likewise.
|
||||
(libcall_ids): Likewise.
|
||||
(IRState::getLibCallDecl): Likewise.
|
||||
(IRState::getFrameForSymbol): Likewise.
|
||||
(IRState::isFuncNestedIn): Likewise.
|
||||
(IRState::buildChain): Likewise.
|
||||
(IRState::getFrameInfo): Likewise.
|
||||
(IRState::getFrameRef): Likewise.
|
||||
(IRState::functionNeedsChain): Likewise.
|
||||
(IRState::startCond): Likewise.
|
||||
(IRState::exitIfFalse): Likewise.
|
||||
(IRState::startCase): Likewise.
|
||||
(IRState::doCase): Likewise.
|
||||
(IRState::endCase): Likewise.
|
||||
* d-decls.cc (VarDeclaration::toSymbol): Likewise
|
||||
(FuncDeclaration::toSymbol): Likewise.
|
||||
* d-glue.cc (CondExp::toElem): Likewise.
|
||||
(build_bool_binop): Likewise.
|
||||
(EqualExp::toElem): Likewise.
|
||||
(CmpExp::toElem): Likewise.
|
||||
(AndAndExp::toElem): Likewise.
|
||||
(OrOrExp::toElem): Likewise.
|
||||
(AssignExp::toElem): Likewise.
|
||||
(CastExp::toElem): Likewise.
|
||||
(CallExp::toElem): Likewise.
|
||||
(AssertExp::toElem): Likewise.
|
||||
(AssocArrayLiteralExp::toElem): Likewise.
|
||||
(StructLiteralExp::toElem): Likewise.
|
||||
(FuncDeclaration::toObjFile): Likewise.
|
||||
(Module::genobjfile): Likewise.
|
||||
(TypeFunction::toCtype): Likewise.
|
||||
(ThrowStatement::toIR): Likewise.
|
||||
(TryCatchStatement::toIR): Likewise.
|
||||
(ReturnStatement::toIR): Likewise.
|
||||
(SwitchStatement::toIR): Likewise.
|
||||
(IfStatement::toIR): Likewise.
|
||||
(ForStatement::toIR): Likewise.
|
||||
(ExpStatement::toIR): Likewise.
|
||||
* d-irstate.cc (IRBase::startFunction): Likewise.
|
||||
* d-lang.cc (d_init_options_struct): Likewise.
|
||||
(d_handle_option): Likewise.
|
||||
(d_parse_file): Likewise.
|
||||
|
||||
2012-06-21 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* Make-lang.in: Remove d-asm-i386.h
|
||||
* asmstmt.cc (d_build_asm_stmt): Update signature, use build5.
|
||||
(getFrameRelativeValue): Remove.
|
||||
(d_format_priv_asm_label): Likewise.
|
||||
(d_have_inline_asm): Likewise.
|
||||
(AsmProcessor): Likewise.
|
||||
(AsmStatement::toIR): Update sorry message.
|
||||
* d-codegen.cc (IRState::expandPortIntrinsic): Update call to
|
||||
d_build_asm_stmt.
|
||||
(IRState::doAsm): Likewise.
|
||||
* d-decls.cc (FuncDeclaration::toSymbol): Remove check for inline asm.
|
||||
* d-glue.cc (FuncDeclaration::toObjFile): Likewise.
|
||||
(LabelStatement::toIR): Likewise.
|
||||
* d-lang.cc (VersionCondition::addPredefinedGlobalIdent): Remove D
|
||||
Inline Asm version identifiers.
|
||||
* d-lang.h (d_build_asm_stmt): Update signature.
|
||||
|
||||
2012-06-19 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-decls.cc (FuncDeclaration::toSymbol): Mark in/out contracts as
|
||||
TREE_PUBLIC to allow calling cross-module.
|
||||
* d-lang.cc (d_parse_file): Update for 2.059.
|
||||
|
||||
2012-06-16 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* dfrontend: Merged with DMD 2.059.
|
||||
* d-builtins2.cc (gcc_type_to_d_type): Use new frontend value.
|
||||
* d-codegen.cc (IRState::getLibCallDecl): Fix return type of _aaDelp.
|
||||
(IRState::getVThis): Use frontend provided member to determine if
|
||||
function has nested references.
|
||||
* d-decl.cc (FuncDeclaration::toSymbol): Weakly pure functions don't
|
||||
guarantee no vops.
|
||||
* d-gcc-real.cc (max_float_mode): Remove.
|
||||
(real_t::convert): Catch imaginary types in conversion.
|
||||
* d-glue.cc (EqualExp::toElem): Use memcmp for struct comparisons.
|
||||
(CatAssignExp::toElem): Rework order of logic to allow appending
|
||||
delegates to an array.
|
||||
(DelegateExp::toElem): Implement handling of lambda functions.
|
||||
(FuncExp::toElem): Ditto.
|
||||
(AssocArrayLiteralExp::toElem): Implement handling of AssociativeArray
|
||||
types sent to backend.
|
||||
* d-objfile.cc (lmtab): Remove.
|
||||
(cvtLocToloc_t): Update implementation.
|
||||
(outdata): Now assert that we don't receive error nodes.
|
||||
|
||||
2012-06-05 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-decls.cc (FuncDeclaration::toSymbol): Make better use of 'pure' and
|
||||
'pure const' functions in GCC codegen.
|
||||
* d-bi-attrs.h: Added TM_ATTR* masks.
|
||||
(handle_tm_wrap_attribute, handle_tm_attribute, tm_attr_to_mask,
|
||||
find_tm_attribute): New.
|
||||
(struct d_common_attribute_table): Added transaction* attributes.
|
||||
|
||||
2012-06-04 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-objfile.cc (ObjectFile::outputThunk): Output thunks moved back to
|
||||
the frontend, as backend does not emit them for DECL_EXTERNAL functions.
|
||||
|
||||
2012-05-29 Daniel Green <venix1@gmail.com>
|
||||
|
||||
* setup-gcc.sh: Add GCC 4.8 to list of supported GCC versions. Patch
|
||||
courtesy of Calrama
|
||||
https://bitbucket.org/goshawk/gdc/issue/345
|
||||
|
||||
2012-05-29 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-codegen.cc (IRState::endCase): Remove parameter from function. Use
|
||||
condition type as the SWITCH_EXPR type, rather than use of void.
|
||||
* d-codegen.h (IRState::endCase): Update signature.
|
||||
* d-glue.cc (SwitchStatement::toIR): Update call to endCase.
|
||||
|
||||
2012-05-28 Daniel Green <venix1@gmail.com>
|
||||
|
||||
* d-builtins.c (DEF_ATTR_STRING): Define and undefine along with other
|
||||
macros.
|
||||
* d-lang.cc (d_write_global_declartions): Use
|
||||
finalize_compilation_unit. GCC 2012-04-30
|
||||
* d-objfile.cc (ObjectFile::outputThunk): Use
|
||||
symtab_add_to_same_comdat_group. GCC 2012-04-30
|
||||
* lang.opt: Match help strings for duplicated options.
|
||||
|
||||
2012-02-01 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* setup-gcc.sh: Remove -hg option.
|
||||
* dfrontend/func.c (FuncDeclaration::semantic): Remove code adding
|
||||
method to flat list.
|
||||
(FuncDeclaration::semantic3): Re-add here.
|
||||
|
||||
2012-01-01 Iain Buclaw <ibuclaw@ubuntu.com>
|
||||
|
||||
* d-builtins2.cc (IRState::buildChain): Don't do nrvo if the
|
||||
variable is put in a closure.
|
||||
* d-glue.cc (FuncDeclaration::buildClosure): Ditto.
|
||||
(ReturnStatement::toIR): Don't call postblit on nrvo returns.
|
||||
(DtorExpStatement::toIR): Don't call destructor if var is returned as
|
||||
the nrvo variable.
|
||||
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved.
|
1221
gcc/d/ChangeLog-2013
Normal file
1221
gcc/d/ChangeLog-2013
Normal file
File diff suppressed because it is too large
Load Diff
660
gcc/d/ChangeLog-2014
Normal file
660
gcc/d/ChangeLog-2014
Normal file
@ -0,0 +1,660 @@
|
||||
2014-12-14 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* Make-lang.in (check_gdc_parallelize): Update for testsuite changes.
|
||||
* d-convert.cc (d_convert_basic): Avoid stack overflow when converting
|
||||
from pointer to integer.
|
||||
* d-objfile.cc (FuncDeclaration::toObjFile): Emit correct frame
|
||||
information for closures rather than generic void pointers.
|
||||
|
||||
2014-11-10 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-elem.cc (CatExp::toElem): Split dynamic arrays when passing as
|
||||
varargs to arraycatT and arraycatnT.
|
||||
|
||||
2014-11-09 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (build_vthis): Handle getting static chain for nested
|
||||
templated structs.
|
||||
|
||||
2014-09-07 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-elem.cc (ArrayLiteralExp::toElem): Remove special handling for
|
||||
immutable arrays.
|
||||
|
||||
2014-08-03 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-longdouble.cc (longdouble::formatHex): Convert buffer to uppercase
|
||||
for use in mangling templates.
|
||||
|
||||
2014-07-29 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-elem.cc (NewExp::toElem): Check for opaque structs before
|
||||
continuing to generate the new expression.
|
||||
|
||||
* d-lang.h.cc (d_vtbl_ptr_type_node): Renamed to vtbl_ptr_type_node.
|
||||
(d_boolean_type_node): Renamed to bool_type_node.
|
||||
(d_char_type_node): Renamed to char8_type_node.
|
||||
(d_wchar_type_node): Renamed to char16_type_node.
|
||||
(d_dchar_type_node): Renamed to char32_type_node.
|
||||
(d_ifloat_type_node): Renamed to ifloat_type_node.
|
||||
(d_idouble_type_node): Renamed to idouble_type_node.
|
||||
(d_ireal_type_node): Renamed to ireal_type_node.
|
||||
(byte_type_node, ubyte_type_node): New macros for fixed integral
|
||||
types in D.
|
||||
(short_type_node, ushort_type_node): Likewise.
|
||||
(int_type_node, uint_type_node): Likewise.
|
||||
(long_type_node, ulong_type_node): Likewise.
|
||||
(cent_type_node, ucent_type_node): Likewise.
|
||||
* d-builtins.c (d_init_builtins): Initialise all D specific type nodes.
|
||||
* d-codegen.cc (d_bounds_condition): Use D-specific type macros instead
|
||||
of backend C types.
|
||||
(layout_aggregate_type): Likewise.
|
||||
(build_integer_cst): Likewise.
|
||||
(build_boolop): Likewise.
|
||||
* d-convert.cc (d_build_truthvalue_op): Likewise.
|
||||
(d_truthvalue_conversion): Likewise.
|
||||
* d-ctype.cc (Type::toCtype): Likewise.
|
||||
* d-decls.cc (FuncDeclaration::toSymbol): Likewise.
|
||||
* d-elem.cc (CmpExp::toElem): Likewise.
|
||||
(OrOrExp::toElem): Likewise.
|
||||
(NotExp::toElem): Likewise.
|
||||
* d-lang.cc (d_type_for_mode): Likewise.
|
||||
(d_type_for_size): Likewise.
|
||||
(d_signed_or_unsigned_type): Likewise.
|
||||
|
||||
2014-07-23 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-ctype.cc (TypeFunction::toCtype): Only check for ref return for
|
||||
functions returning non-void.
|
||||
|
||||
2014-07-21 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-objfile.cc (output_declaration_p): Don't emit any declarations from
|
||||
the gcc.attribute module.
|
||||
(StructDeclaration::toObjFile): Call output_declaration_p.
|
||||
* d-glue.cc (verror): Only call vasprintf on the initial format string.
|
||||
|
||||
2014-07-17 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-lang.cc (d_init_options_struct): Set flag_wrapv as on by default.
|
||||
|
||||
2014-07-14 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-elem.cc (NewExp::toElem): Don't initialise a new'd struct at the
|
||||
caller. The callee ensures this is done.
|
||||
|
||||
2014-07-13 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-objfile.cc (d_finish_symbol): Always set TREE_STATIC for symbols
|
||||
being sent to the backend here.
|
||||
|
||||
2014-07-12 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-objfile.cc (d_finish_symbol): Don't set DECL_INITIAL if the
|
||||
initialiser is all zeros.
|
||||
|
||||
2014-07-10 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-builtins.cc (lookup_ctype_name): Remove function.
|
||||
(string_type_node): Move to static declaration from d_global_trees.
|
||||
(const_string_type_node): Likewise.
|
||||
(wint_type_node): Likewise.
|
||||
(intmax_type_node): Likewise.
|
||||
(uintmax_type_node): Likewise.
|
||||
(signed_size_type_node): Likewise.
|
||||
(d_init_builtins): Update.
|
||||
* d-lang.cc (d_type_for_mode): Return only fixed size types.
|
||||
(d_type_for_size): Likewise.
|
||||
(d_signed_or_unsigned_type): Likewise.
|
||||
(d_unsigned_type): Remove duplicated code from
|
||||
d_signed_or_unsigned_type.
|
||||
(d_signed_type): Likewise.
|
||||
|
||||
2014-07-03 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-objfile.cc (finish_thunk): Use set_decl_section_name, copy the
|
||||
implicit section flag.
|
||||
(setup_symbol_storage): Use decl_default_tls_model.
|
||||
|
||||
2014-06-26 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.h (d_types_compatible): Remove function.
|
||||
(d_types_same): Use more conservative approach to type equality.
|
||||
* d-codegen.cc (get_libcall): Allow backend to be able to optimise
|
||||
closure memory allocations.
|
||||
(convert_for_assignment): Use d_types_same.
|
||||
* d-elem.cc (CatExp::toElem): Likewise.
|
||||
(BinExp::toElemBin): Likewise.
|
||||
(CatAssignExp::toElem): Likewise.
|
||||
(StructLiteralExp::toElem): Likewise.
|
||||
|
||||
2014-06-14 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-elem.cc (CondExp::toElem): Handle void type condition expressions.
|
||||
(AssignExp::toElem): Use ismemset to test for initialising arrays with
|
||||
a single value.
|
||||
(StructLiteralExp::toElem): Build static initialiser if a symbol was
|
||||
created by the front-end.
|
||||
* d-codegen.h (d_types_compatible): First check equality of types, then
|
||||
implicit compatibility.
|
||||
* d-convert.cc (d_default_conversion): Remove function, fold
|
||||
implementation into...
|
||||
(d_truthvalue_conversion): ... here.
|
||||
|
||||
2014-06-12 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-convert.cc (d_scalar_conversion): Remove function.
|
||||
(d_build_truthvalue_op): Update.
|
||||
(d_truthvalue_conversion): Update.
|
||||
|
||||
* d-codegen.cc (get_frame_for_symbol): Remove glue-specific error
|
||||
messages and refactor.
|
||||
(build_vthis): Likewise.
|
||||
(get_framedecl): Likewise.
|
||||
* d-elem.cc (AssignExp::toElem): Update call to build_vthis.
|
||||
(NewExp::toElem): Likewise.
|
||||
(StructLiteralExp::toElem): Likewise.
|
||||
* d-objfile.cc (Dsymbol::toObjFile): Fix build warning.
|
||||
|
||||
* d-codegen.cc (d_decl_context): Always return parent context for
|
||||
functions nested in functions.
|
||||
(is_degenerate_closure): Remove function.
|
||||
(needs_static_chain): Remove function.
|
||||
* d-decls.cc (FuncDeclaration::toSymbol): Remove workaround for cgraph
|
||||
nesting structure, saving the original context decl.
|
||||
* d-lang.h (D_DECL_STATIC_CHAIN): Remove macro.
|
||||
* d-objfile.cc (Symbol::Symbol): Remove ScontextDecl field.
|
||||
(FuncDeclaration::toObjFile): Remove workaround for cgraph nesting
|
||||
structure, restoring the original context decl. Delay building the
|
||||
cgraph node until...
|
||||
(d_finish_function): ... here, where the function is unnested.
|
||||
|
||||
2014-06-11 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-objfile.cc (d_finish_function): Update the callgraph to reflect
|
||||
unnesting of the function, as unravelling has already been handled by
|
||||
the frontend. Do not delay calling cgraph_finalize_function.
|
||||
|
||||
2014-06-09 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-objfile.cc (d_comdat_group): Return a decl.
|
||||
* d-decl.cc (FuncDeclaration::toThunkSymbol): Don't set comdat group.
|
||||
* d-elem.cc (EqualExp::toElem): Always store temporaries when comparing
|
||||
two dynamic arrays.
|
||||
|
||||
2014-06-08 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-decls.cc (TypeInfoDeclaration::toSymbol): Add assert that Error
|
||||
types never reach the backend.
|
||||
* d-typinf.cc (Type::getTypeInfo): Likewise.
|
||||
|
||||
2014-06-08 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* dfrontend: Update to D front-end version 2.065.
|
||||
|
||||
* d-codegen.cc (d_build_call): Evaluate side effects of the object
|
||||
parameter for method or delegate calls before passing.
|
||||
(libcall_ids): Rename _d_array_bounds to _d_arraybounds.
|
||||
(get_libcall): Update parameter types for _d_arraycopy.
|
||||
(finish_aggregate_type): Update for frontend UDA changes.
|
||||
* d-ctype.cc (TypeTypedef::toCtype): Update for frontend UDA changes.
|
||||
(TypeEnum::toCtype): Likewise.
|
||||
(TypeStruct::toCtype): Likewise.
|
||||
(TypeClass::toCtype): Likewise.
|
||||
* d-elem.cc (BoolExp::toElem): New function.
|
||||
* d-lang.cc (rootmodule): New declaration for frontend entrypoint
|
||||
changes.
|
||||
(genCmain): Update for frontend entrypoint changes.
|
||||
(d_handle_option): Don't duplicate memory for argument values.
|
||||
(d_parse_file): Don't duplicate memory for source filenames.
|
||||
* d-objfile.cc (VarDeclaration::toObjFile): Don't emit instantiated
|
||||
manifest constants to debug.
|
||||
(TemplateInstance::toObjFile): Update for frontend changes.
|
||||
(output_template_p): Remove function.
|
||||
(output_declaration_p): Update for frontend changes.
|
||||
(setup_symbol_storage): Update for frontend UDA changes.
|
||||
* d-target.cc (Target::reverseCppOverloads): New declaration.
|
||||
* d-typinf.cc (Type::getInternalTypeInfo): Update for frontend changes.
|
||||
(Type::getTypeInfo, Type::getTypeInfoDeclaration): Likewise.
|
||||
(TypeTypedef::getTypeInfoDeclaration): Likewise.
|
||||
(TypePointer::getTypeInfoDeclaration): Likewise.
|
||||
(TypeDArray::getTypeInfoDeclaration): Likewise.
|
||||
(TypeSArray::getTypeInfoDeclaration): Likewise.
|
||||
(TypeAArray::getTypeInfoDeclaration): Likewise.
|
||||
(TypeStruct::getTypeInfoDeclaration): Likewise.
|
||||
(TypeClass::getTypeInfoDeclaration): Likewise.
|
||||
(TypeVector::getTypeInfoDeclaration): Likewise.
|
||||
(TypeEnum::getTypeInfoDeclaration): Likewise.
|
||||
(TypeFunction::getTypeInfoDeclaration): Likewise.
|
||||
(TypeDelegate::getTypeInfoDeclaration): Likewise.
|
||||
(TypeTuple::getTypeInfoDeclaration): Likewise.
|
||||
(createTypeInfoArray): Likewise.
|
||||
|
||||
* d-intrinsics.def: New file for declaring D intrinsics.
|
||||
|
||||
* d-builtins.cc (std_intrinsic_module, std_math_module)
|
||||
(core_math_module, va_arg_template, va_arg2_template)
|
||||
(va_start_template): Remove declarations.
|
||||
(is_intrinsic_module_p, is_math_module_p, is_builtin_va_arg_p)
|
||||
(is_builtin_va_start_p, d_gcc_magic_stdarg_check)
|
||||
(d_gcc_magic_stdarg_module): Remove functions.
|
||||
(d_gcc_magic_builtins_module): Rename to d_build_builtins_module.
|
||||
(d_gcc_magic_libbuiltins_module): Rename to maybe_set_builtin.
|
||||
(d_gcc_magic_libbuiltins_check): Rename to maybe_set_builtin_1.
|
||||
(gcc_type_to_d_type): Rename to build_dtype.
|
||||
(gcc_cst_to_d_expr): Rename to build_expression.
|
||||
(d_gcc_eval_builtin): Remove function.
|
||||
(eval_builtin): Moved to...
|
||||
* d-glue.cc (eval_builtin): New function, updated for glue changes.
|
||||
(FuncDeclaration::isBuiltin): New function to determine whether a
|
||||
given function symbol is a compiler intrinsic.
|
||||
* d-codegen.cc (maybe_expand_builtin): Rename to expand_intrinsic.
|
||||
(Intrinsic): Remove enum declaration, replaced with...
|
||||
(intrinsic_code): New enum for compiler intrinsics.
|
||||
(intrinsic_decls): New declaration for store intrinsic information.
|
||||
(expand_intrinsic_bt): Update signature.
|
||||
(maybe_set_intrinsic): New function to replace...
|
||||
(maybe_set_builtin_frontend): Remove function.
|
||||
* d-decls.cc (FuncDeclaration::toSymbol): Update for glue changes.
|
||||
|
||||
* d-builtins.c: Rename to d-builtins.cc
|
||||
* d-gt.c: Rename to d-gt.cc
|
||||
* d-spec.c: Rename to d-spec.cc
|
||||
|
||||
* d-toir.cc: Renamed to toir.cc
|
||||
* toir.cc: New file, re-implement toIR methods as a visitor.
|
||||
|
||||
* d-codegen.cc (insert_type_modifiers): Handle MODwildconst modifiers.
|
||||
(build_ir): New function.
|
||||
* d-objfile.cc (FuncDeclaration::toObjFile): Use build_ir to walk
|
||||
front-end IR trees.
|
||||
* d-decls.cc (VarDeclaration::toSymbol): Mark compiler temporaries as
|
||||
DECL_ARTIFICIAL.
|
||||
(ClassDeclaration::toVtblSymbol): Update for front-end changes.
|
||||
* d-builtins.c (gcc_type_to_d_type): Likewise.
|
||||
* d-elem.cc (CatAssignExp::toElem): Likewise.
|
||||
(ArrayLiteralExp::toElem): Likewise.
|
||||
(BoolExp::toElem): Remove function.
|
||||
(ComExp::toElem): Assert that unhandled array operations no longer
|
||||
leak from the front-end.
|
||||
(NegExp::toElem): Likewise.
|
||||
* d-glue.cc (Global::init): Initialise new member run_noext.
|
||||
* d-incpath (add_import_path): Update for front-end changes.
|
||||
* d-lang.cc (d_add_builtin_version): Likewise.
|
||||
* d-todt.cc (StructDeclaration::toDt): Likewise.
|
||||
* d-toir.cc (LabelStatement::toIR): Don't delete forward references.
|
||||
(GotoStatement::toIR): Assert that undefined labels no longer leak
|
||||
from the front-end.
|
||||
|
||||
2014-05-31 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-todt.cc (dt_container): Properly handle zero length static arrays.
|
||||
* d-codegen.h (build_dtype): Rename to lang_dtype.
|
||||
(build_ddecl): Rename to lang_ddecl.
|
||||
|
||||
2014-05-21 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-builtins.c (d_init_builtins): Use void_node instead of
|
||||
d_void_zero_node.
|
||||
* d-lang.h (d_void_zero_node): Remove.
|
||||
* d-elem.cc (AndAndExp::toElem): Adjust.
|
||||
(OrOrExp::toElem): Likewise.
|
||||
(AssertExp::toElem): Likewise.
|
||||
(TupleExp::toElem): Likewise.
|
||||
|
||||
* d-builtins.c (d_init_builtins): Use null_pointer_node instead of
|
||||
d_null_pointer.
|
||||
* d-lang.h (d_null_pointer): Remove.
|
||||
* d-codegen.cc (convert_expr): Adjust.
|
||||
(get_frame_for_symbol): Likewise.
|
||||
(build_vthis): Likewise.
|
||||
(get_framedecl): Likewise.
|
||||
* d-elem.cc (DeleteExp::toElem): Likewise.
|
||||
(CallExp::toElem): Likewise.
|
||||
(AssertExp::toElem): Likewise.
|
||||
(NewExp::toElem): Likewise.
|
||||
(ArrayLiteralExp::toElem): Likewise.
|
||||
(NullExp::toElem): Likewise.
|
||||
* d-objfile.cc (ClassDeclaration::toObjFile): Likewise.
|
||||
(InterfaceDeclaration::toObjFile): Likewise.
|
||||
(FuncDeclaration::toObjFile): Likewise.
|
||||
(build_moduleinfo): Likewise.
|
||||
* d-todt.cc (TypeInfoTypedefDeclaration::toDt): Likewise.
|
||||
(TypeInfoEnumDeclaration::toDt): Likewise.
|
||||
(TypeInfoStructDeclaration::toDt): Likewise.
|
||||
|
||||
2014-05-18 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-longdouble.cc (longdouble::from_shwi): Rename to from_int.
|
||||
(longdouble::from_uhwi): Rename to from_uint.
|
||||
(longdouble::to_shwi): Rename to to_int.
|
||||
(longdouble::to_uhwi): Rename to to_uint.
|
||||
(longdouble::set): Adjust.
|
||||
(longdouble::operator): Likewise.
|
||||
|
||||
* d-lang.cc (alloc_binding_level): Adjust.
|
||||
(build_d_type_lang_specific): Likewise.
|
||||
(build_d_decl_lang_specific): Likewise.
|
||||
* d-lang.h (lang_type): Don't use variable_size gty attribute.
|
||||
* d-codegen.cc (cst_to_hwi): Remove function.
|
||||
* d-codegen.cc (tree_to_hwi): Remove function.
|
||||
* d-builtins.c (gcc_type_to_d_type): Adjust.
|
||||
(gcc_cst_to_d_expr): Likewise.
|
||||
* d-convert.cc (d_truthvalue_conversion): Use integer_zerop.
|
||||
(get_nonnull_operand): Use tree_fits_uhwi_p.
|
||||
* d-longdouble.cc (longdouble::from_int): Adjust.
|
||||
(longdouble::from_uint): Likewise.
|
||||
(longdouble::to_int): Likewise.
|
||||
|
||||
2014-04-30 Johannes Pfau <johannespfau@gmail.com>
|
||||
|
||||
* d-lang.cc (d_init): Define GNU_SEH_Exceptions and
|
||||
GNU_DWARF2_Exceptions versions.
|
||||
|
||||
2014-04-21 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-lang.cc (d_init_options): Default deprecation warnings to off.
|
||||
* d-ctype.cc (TypeDelegate::toCtype): Propogate TREE_ADDRESSABLE from
|
||||
the base function to the delegatised copy.
|
||||
|
||||
2014-04-15 Johannes Pfau <johannespfau@gmail.com>
|
||||
|
||||
* d-lang.cc (d_handle_noclone_attribute): New function to handle
|
||||
noclone attribute. noclone is required by the naked attribute.
|
||||
* d-elem.cc (SymbolExp::toElem): Convert symbols to the expression
|
||||
type.
|
||||
|
||||
2014-04-13 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (get_frameinfo): Don't copy the node for frame record.
|
||||
* d-irstate.cc (IRState::endCatches): Rebuild the STATEMENT_LIST of
|
||||
catches in a TRY_CATCH_EXPR if it gets optimised away by
|
||||
IRState::popStatement.
|
||||
* d-codegen.cc (d_attribute_p): Provide access to target attributes.
|
||||
|
||||
2014-03-31 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (error_mark_p): Removed function, replace uses with
|
||||
error_operand_p.
|
||||
(error_mark): Removed function, replace uses with error_mark_node.
|
||||
* d-ctype.cc (Type::toCtype): Return d_unknown_type_node for frontend
|
||||
error types.
|
||||
* d-objfile.cc (VarDeclaration::toObjFile): Don't build CONST_DECLs for
|
||||
non-scalar manifests.
|
||||
|
||||
2014-03-23 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-decls.cc (Dsymbol::toImport): Prevent GC from collecting
|
||||
IMPORTED_DECL nodes whilst front-end compilation in progress.
|
||||
|
||||
2014-03-19 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (AggLayout::visit): Rename to layout_aggregate_type.
|
||||
(AggLayout::doFields, AggLayout::doInterfaces): Remove function and
|
||||
move implementation into layout_aggregate_type.
|
||||
(AggLayout::addField): Rename to insert_aggregate_field.
|
||||
(AggLayout::finish): Rename to finish_aggregate_type.
|
||||
* d-codegen.h (AggLayout): Update definition.
|
||||
* d-ctype.cc (TypeStruct::toCtype): Update for glue changes.
|
||||
(TypeFunction::toCtype): Fix ICE on generic function types.
|
||||
(TypeClass::toCtype): Move generation of vptr and monitor fields into
|
||||
layout_aggregate_type. Moved generation of TYPE_METHODS from ...
|
||||
* d-objfile.cc (FuncDeclaration::toObjFile): ... here into
|
||||
TypeClass::toCtype. Don't build up TYPE_METHODS on a per-function
|
||||
basis, generate the entire vtable.
|
||||
|
||||
2014-03-18 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-decls.cc (Dsymbol::toSymbolX): Set the symbol prettyIdent.
|
||||
(Dsymbol::toImport): Emit packages as their fully qualified names.
|
||||
(ClassDeclaration::toSymbol): Distinguish between the classinfo
|
||||
assembler and decl name.
|
||||
(InterfaceDeclaration::toSymbol): Likewise for interface symbol.
|
||||
(Module::toSymbol): Likewise for moduleinfo symbol.
|
||||
(ClassDeclaration::toVtblSymbol): Likewise for class vtable symbol.
|
||||
(AggregateDeclaration::toInitializer)
|
||||
(TypedefDeclaration::toInitializer, EnumDeclaration::toInitializer):
|
||||
Likewise for default initialisers.
|
||||
* d-objfile.cc (Module::genobjfile): Don't set-up moduleinfo symbol
|
||||
storage twice.
|
||||
|
||||
2014-03-17 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (d_decl_context): Fix null pointer dereference.
|
||||
* d-objfile.cc (FuncDeclaration::toObjFile): Don't override the setting
|
||||
of DECL_CONTEXT on the declaration here.
|
||||
(d_finish_symbol): Likewise.
|
||||
* d-objfile.cc (VarDeclaration::toObjFile): Move the generation of
|
||||
manifest constants to ...
|
||||
* d-decls.cc (VarDeclaration::toSymbol): ... here, and emit them as
|
||||
CONST_DECLs. Set the DECL_CONTEXT for all variable symbols.
|
||||
|
||||
* d-builtins.cc (d_gcc_magic_builtins_module): Don't store compiler
|
||||
generated builtins in Symbol::isym, use Symbol::csym instead.
|
||||
(d_gcc_magic_libbuiltins_check): Likewise.
|
||||
* d-codegen.cc (d_decl_context): Return the imported symbol tree of
|
||||
modules where the NAMESPACE_DECL is now stored.
|
||||
(d_build_module): Remove function. Move implementation to ...
|
||||
* d-decls.cc (Dsymbol::toImport): ... here. Build an IMPORTED_DECL for
|
||||
all imported declarations.
|
||||
(FuncDeclaration::toSymbol): Remove special handling of Symbol::isym.
|
||||
(Module::toSymbol): Remove call to d_build_module.
|
||||
* d-objfile.cc (Dsymbol::toObjFile): Handle emission of IMPORTED_DECL
|
||||
symbols to debug.
|
||||
|
||||
2014-03-16 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (build_attributes): Ensure D-specific attributes have
|
||||
their value interpreted through CTFE.
|
||||
|
||||
2014-02-21 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (d_build_module): Update signature to accept a Loc
|
||||
location to the module declaration.
|
||||
* d-decls.cc (Module::toSymbol): Update call to d_build_module.
|
||||
Set TREE_PUBLIC/DECL_EXTERNAL to distingush which modules are being
|
||||
compiled.
|
||||
* d-objfile.cc (Dsymbol::toObjFile): Handle Import symbols, and emit
|
||||
debug information for imported modules.
|
||||
(ImportStatement::toIR): Likewise.
|
||||
(set_input_location): New function to implement the equivalent of
|
||||
set_decl_location, but instead sets input_location.
|
||||
|
||||
2014-02-19 Johannes Pfau <johannespfau@gmail.com>
|
||||
|
||||
* d-objfile.cc (build_call_function): Call set_input_location
|
||||
to set debug info correctly
|
||||
|
||||
2014-02-18 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-objfile.cc (VarDeclaration::toObjFile): Remove toplevel check.
|
||||
DECL_CONTEXT is never set on manifest constants.
|
||||
(d_finish_compilation): Remove fancy check on force outputting
|
||||
symbols to object file.
|
||||
(build_type_decl): Don't emit the qualified identifier in debug
|
||||
information. The fully qualified name is now determined through the
|
||||
NAMESPACE_DECL context chain.
|
||||
* d-ctype.cc (TypeEnum::toCtype): Likewise for enum members.
|
||||
(VarDeclaration::toSymbol): Likewise for static variables.
|
||||
(FuncDeclaration::toSymbol): Likewise for functions.
|
||||
|
||||
* d-decls.cc (FuncDeclaration::toSymbol): Don't emit the 'D main'
|
||||
symbol to debug as plain 'main'.
|
||||
* d-objfile.cc (VarDeclaration::toObjFile): Don't emit the qualified
|
||||
identifier of manifest constants in debug information.
|
||||
|
||||
2014-02-17 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (d_build_module): New function.
|
||||
* d-decls.cc (Module::toSymbol): Use d_build_module to build up the
|
||||
qualified module namespace.
|
||||
|
||||
* d-codegen.cc (expand_intrinsic_op, expand_intrinsic_op2): New
|
||||
functions to build a call to a builtin code.
|
||||
(expand_intrinsic_bsr, expand_intrinsic_bt): New functions to expand a
|
||||
BUILTIN_FRONTEND call to core.bitop intrinsics.
|
||||
(expand_intrinsic_vaarg, expand_intrinsic_vastart): New functions to
|
||||
expand a BUILTIN_FRONTEND call to core.vararg intrinsics.
|
||||
(maybe_expand_builtin): Update.
|
||||
|
||||
2014-02-16 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-decls.cc (Module::toSymbol): Build a NAMESPACE_DECL to populate the
|
||||
DECL_CONTEXT of toplevel functions.
|
||||
* d-codegen.cc (d_decl_context): Return the enclosing module
|
||||
NAMESPACE_DECL as the decl context only when the symbol is extern(D)
|
||||
and not D main.
|
||||
|
||||
2014-02-15 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-decls.cc (VarDeclaration::toSymbol): Don't call
|
||||
setup_symbol_storage until after SET_DECL_ASSEMBLER_NAME has been set.
|
||||
|
||||
* d-decls.cc (VarDeclaration::toSymbol): Give prettyIdent precedence
|
||||
for the DECL_NAME over the simple identifier.
|
||||
(FuncDeclaration::toSymbol): Likewise.
|
||||
* d-objfile.cc (d_finish_symbol): Remove setting DECL_NAME as
|
||||
prettyIdent, this has already been done in Declaration::toSymbol.
|
||||
(d_finish_function): Likewise.
|
||||
|
||||
* d-decls.cc (VarDeclaration::toSymbol): Call set_user_assembler_name
|
||||
if pragma(mangle) was seen.
|
||||
(FuncDeclaration::toSymbol): Likewise.
|
||||
|
||||
2014-02-12 Johannes Pfau <johannespfau@gmail.com>
|
||||
|
||||
* d-decls.cc (FuncDeclaration::toSymbol): Do not set TREE_NOTHROW on
|
||||
nothrow functions.
|
||||
* d-decls.cc (TypeInfoDeclaration::toSymbol): Call relayout_decl after
|
||||
changing the type.
|
||||
|
||||
2014-02-03 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
|
||||
* d-codegen.cc (d_build_call): Remove special handling of
|
||||
flag_split_darrays switch.
|
||||
(maybe_expand_builtin): Likewise.
|
||||
* d-elem.cc (CatExp::toElem): Likewise.
|
||||
* lang.opt (fsplit-dynamic-arrays): Remove.
|
||||
|
||||
2014-02-02 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-glue.cc (readFile, writeFile, ensurePathToNameExists): Define.
|
||||
* d-incpath.cc (add_import_path): Update for frontend changes.
|
||||
(add_fileimp_path): Likewise.
|
||||
* d-lang.cc (deps_write): Likewise.
|
||||
(d_parse_file): Likewise.
|
||||
* d-todt.cc (Dts): Update define for frontend changes.
|
||||
* d-decls.cc (ClassDeclaration::toVtblSymbol): Don't mark __vtbl
|
||||
symbols as virtual. They are global static symbols.
|
||||
|
||||
2014-01-12 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-decls.cc (EnumDeclaration::toDebug): Build TYPE_DECL only for
|
||||
enumeral types.
|
||||
|
||||
2014-01-06 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-ctype.cc (TypeClass::toCtype): Don't add __monitor field for
|
||||
extern(C++) classes.
|
||||
|
||||
* d-builtins.c (d_gcc_magic_module): Remove tdata.
|
||||
* d-codegen.cc (build_interface_binfo): Likewise.
|
||||
* d-ctype.cc (TypeEnum::toCtype): Likewise.
|
||||
(TypeClass::toCtype): Likewise.
|
||||
* d-lang.cc (deps_write): Likewise.
|
||||
|
||||
2014-01-05 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-ctype.cc (TypeEnum::toCtype): Don't push CONST_DECLs into current
|
||||
function.
|
||||
* d-decls.cc (FuncDeclaration::toThunkSymbol): Don't mark symbol as
|
||||
TREE_PRIVATE, just TREE_PUBLIC as false.
|
||||
(StructLiteralExp::toSymbol): Likewise.
|
||||
(ClassReferenceExp::toSymbol): Likewise.
|
||||
* d-objfile.cc (d_comdat_linkage): Likewise.
|
||||
(d_finish_symbol): Likewise.
|
||||
(build_moduleinfo): Likewise.
|
||||
|
||||
* config-lang.in: Add d-lang.cc to gtfiles.
|
||||
* d-irstate.h (IRState::varsInScope): Change from Array to vec<> type.
|
||||
(IRState::statementList_): Likewise.
|
||||
(IRState::scopes_): Likewise.
|
||||
(IRState::loops_): Likewise.
|
||||
(IRState::labels_): Likewise.
|
||||
* d-lang.h (d_bi_builtin_func): Remove declaration.
|
||||
(d_bi_builtin_type): Likewise.
|
||||
(d_keep_list): Likewise.
|
||||
* d-objfile.h (Symbol::thunks): Change from Array to vec<> type.
|
||||
(ModuleInfo::classes): Likewise.
|
||||
(ModuleInfo::ctors): Likewise.
|
||||
(ModuleInfo::dtors): Likewise.
|
||||
(ModuleInfo::ctorgates): Likewise.
|
||||
(ModuleInfo::sharedctors): Likewise.
|
||||
(ModuleInfo::shareddtors): Likewise.
|
||||
(ModuleInfo::sharedctorgates): Likewise.
|
||||
(ModuleInfo::unitTests): Likewise.
|
||||
(build_simple_function): Remove declaration.
|
||||
(build_call_function): Likewise.
|
||||
(build_ctor_function): Likewise.
|
||||
(build_dtor_function): Likewise.
|
||||
(build_unittest_function): Likewise.
|
||||
* d-builtins.c (bi_fn_list): Rename to gcc_builtins_functions.
|
||||
(bi_lib_list): Rename to gcc_builtins_libfuncs.
|
||||
(bi_type_list): Rename to gcc_builtins_types.
|
||||
(builtin_converted_types): Remove.
|
||||
(builtin_converted_decls): Change from Array to vec<> type.
|
||||
(gcc_type_to_d_type): Update.
|
||||
(d_bi_builtin_func): Remove and move to d_builtin_function.
|
||||
(d_bi_builtin_type): Remove and move to d_register_builtin_type.
|
||||
(d_gcc_magic_builtins_module): Update.
|
||||
* d-ctype.cc (TypeClass::toCtype): Remove unused var.
|
||||
* d-decls.cc (FuncDeclaration::toThunkSymbol): Update for change to
|
||||
vec<> type.
|
||||
* d-elem.cc (CatExp::toElem): Change stashed vars from Array to vec<>.
|
||||
(Expression::toElemDtor): Update for change to vec<> type.
|
||||
* d-irstate.cc (IRState::startFunction): Likewise.
|
||||
(IRState::endFunction): Likewise.
|
||||
(IRState::addExp): Likewise.
|
||||
(IRState::pushStatementList): Likewise.
|
||||
(IRState::popStatementList): Likewise.
|
||||
(IRState::getLabelBlock): Likewise.
|
||||
(IRState::getLoopForLabel): Likewise.
|
||||
(IRState::beginFlow): Likewise.
|
||||
(IRState::endFlow): Likewise.
|
||||
(IRState::startScope): Likewise.
|
||||
(IRState::pushLabel): Likewise.
|
||||
(IRState::checkGoto): Likewise.
|
||||
(IRState::checkPreviousGoto): Change from Array to Blocks type.
|
||||
* d-lang.cc (global_declarations): Change from Array to vec<> type.
|
||||
(d_add_global_declaration): Update for change to vec<> type.
|
||||
(d_write_global_declarations): Likewise.
|
||||
(d_keep_list): Make static to source file.
|
||||
* d-objfile.cc (static_ctor_list): Change from Array to vec<> type.
|
||||
(static_dtor_list): Likewise.
|
||||
(Module::genobjfile): Update for change to vec<> type.
|
||||
(d_finish_module): Likewise.
|
||||
(d_finish_function): Likewise.
|
||||
(deferred_thunks): Change from ArrayBase<> to vec<> type.
|
||||
(write_deferred_thunks): Update for change to vec<> type.
|
||||
(use_thunk): Likewise.
|
||||
(build_simple_function): Make static to source file.
|
||||
(build_call_function): Likewise.
|
||||
(build_ctor_function): Likewise.
|
||||
(build_dtor_function): Likewise.
|
||||
(build_unittest_function): Likewise.
|
||||
|
||||
2014-01-02 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-objfile.cc (setup_symbol_storage): Use output_module_p on template
|
||||
instantiating module to determine if symbol is externally compiled.
|
||||
(d_finish_function): Set function local if function body was compiled.
|
||||
* d-decls.cc (Dsymbol::toSymbolX): Use unsigned integer format for the
|
||||
prefix string length.
|
||||
|
||||
|
||||
Copyright (C) 2014 Free Software Foundation, Inc.
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved.
|
771
gcc/d/ChangeLog-2015
Normal file
771
gcc/d/ChangeLog-2015
Normal file
@ -0,0 +1,771 @@
|
||||
2015-10-07 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-decls.cc (StructLiteralExp::toSymbol): Use letter prefix for
|
||||
anonymous name. Don't set TREE_READONLY.
|
||||
(ClassReferenceExp::toSymbol): Likewise.
|
||||
|
||||
2015-10-06 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (build_struct_literal): New function.
|
||||
(layout_aggregate_members): Handle variables that are really tuples.
|
||||
* d-elem.cc (StructLiteralExp::toElem): Handle slicing void arrays.
|
||||
Use build_struct_literal to handle anonymous records.
|
||||
* d-lang.h (d_unknown_type_node): Rename to unknown_type_node, update
|
||||
in all files.
|
||||
|
||||
2015-10-03 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (build_two_field_type): Use DECL_FIELD_CONTEXT to access
|
||||
field context decl.
|
||||
(build_frame_type): Likewise.
|
||||
(lookup_anon_field): New function.
|
||||
(component_ref): Use it.
|
||||
(fixup_anonymous_offset): New function.
|
||||
(layout_aggregate_members): New function.
|
||||
(layout_aggregate_type): Move generation of fields into
|
||||
layout_aggregate_members.
|
||||
(insert_aggregate_field): Update signature, update all callers.
|
||||
(finish_aggregate_type): Likewise.
|
||||
* d-todt.cc (dt_container2): Use DECL_FIELD_CONTEXT to access field
|
||||
context decl.
|
||||
* types.cc (TypeVisitor::visit (TypeStruct)): Likewise.
|
||||
(TypeVisitor::visit (TypeClass)): Likewise.
|
||||
* d-tree.h (ANON_AGGR_TYPE_P): New type macro.
|
||||
|
||||
2015-08-25 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-builtins.cc (maybe_set_builtin_1): Remove va_list handling.
|
||||
(d_init_builtins): Don't represent static array va_list as reference.
|
||||
* d-codegen.cc (convert_for_argument): Handle va_list as a static array.
|
||||
(declaration_type): Likewise.
|
||||
(type_passed_as): Likewise.
|
||||
(decl_reference_p): Renamed to declaration_type_kind, update to return
|
||||
how type is represented internally, updated all callers.
|
||||
(arg_reference_p): Renamed to argument_type_kind, update to return how
|
||||
type is represented internally, updated all callers.
|
||||
* d-codegen.h (type_kind): Declare.
|
||||
|
||||
2015-08-22 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* toir.cc (IRVisitor::visit (TryCatchStatement)): Always emit call to
|
||||
LIBCALL_BEGIN_CATCH at the start of the catch.
|
||||
* d-elem.cc (AssertExp::toElem): Stabilize reference to class object
|
||||
before passing it to _d_invariant.
|
||||
|
||||
2015-08-20 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* toir.cc (IRVisitor::visit): Set input location in all visitors that
|
||||
either throw an ICE or sorry message.
|
||||
|
||||
2015-08-19 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* Make-lang.in: Replace uses of $(target_alias) with
|
||||
$(target_noncanonical).
|
||||
|
||||
2015-08-17 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* types.cc (TypeVisitor::visit (TypeEnum)): Set ENUM_IS_SCOPED on all
|
||||
enumeral types.
|
||||
* d-lang.cc (d_init_options_struct): Remove setting
|
||||
flag_evaluation_order.
|
||||
|
||||
2015-08-10 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-elem.cc (HaltExp::toElem): Use __builtin_trap to halt execution,
|
||||
rather than the library abort() call.
|
||||
|
||||
2015-08-07 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (build_closure): Update signature, update all callers.
|
||||
(build_vthis): Likewise.
|
||||
(get_frame_for_symbol): Likewise.
|
||||
(build_local_var): Likewise.
|
||||
(get_decl_tree): Likewise.
|
||||
(start_function): Likewise.
|
||||
* d-irstate.h (IRState): Move func, mod, sthis, deferred,
|
||||
statementList, and varsInScope fields to...
|
||||
* d-tree.h (language_function): Here, updated all uses.
|
||||
* d-irstate.h: Remove file.
|
||||
(IRState): Remove all uses everywhere.
|
||||
|
||||
2015-08-07 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* Make-lang.in (D_GLUE_OBJS): Remove d-irstate.o.
|
||||
* d-tree.h (d_label_use_entry): New structure.
|
||||
(d_label_entry): New structure.
|
||||
(binding_level): Add level_kind field.
|
||||
(language_function): Add hash table field for labels.
|
||||
(D_LABEL_VARIABLE_CASE): New macro.
|
||||
* d-codegen.cc (pop_binding_label): New function.
|
||||
(pop_label): New function.
|
||||
(push_binding_level): Update signature.
|
||||
(pop_binding_level): Update signature. Handle declared or used labels.
|
||||
(build_array_set): Update for push/pop binding changes.
|
||||
(check_goto): New function.
|
||||
(check_previous_goto): New function.
|
||||
(d_lookup_label): Remove function.
|
||||
(lookup_label): New function.
|
||||
(lookup_bc_label): New function.
|
||||
(define_label): New function.
|
||||
* d-objfile.cc (FuncDeclaration::toObjFile): Update for push/pop binding
|
||||
changes.
|
||||
* toir.cc (IRVisitor): Add break and continue label fields.
|
||||
(IRVisitor::IRVisitor): Initialize here.
|
||||
(IRVisitor::start_scope): Update signature.
|
||||
(IRVisitor::end_scope): Return the finished scope, updated all callers.
|
||||
(IRVisitor::push_break_label): New function.
|
||||
(IRVisitor::pop_break_label): New function.
|
||||
(IRVisitor::push_continue_label): New function.
|
||||
(IRVisitor::pop_continue_label): New function.
|
||||
(IRVisitor::start_condition): Remove function.
|
||||
(IRVisitor::start_else): Remove function.
|
||||
(IRVisitor::end_condition): Remove function.
|
||||
(IRVisitor::start_catches): Remove function.
|
||||
(IRVisitor::start_catch): Remove function.
|
||||
(IRVisitor::end_catch): Remove function.
|
||||
(IRVisitor::end_catches): Remove function.
|
||||
(IRVisitor::start_finally): Remove function.
|
||||
(IRVisitor::end_finally): Remove function.
|
||||
(IRVisitor::start_case): Remove function.
|
||||
(IRVisitor::end_case): Remove function.
|
||||
* d-irstate.cc: Remove.
|
||||
|
||||
2015-08-06 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* config-lang.in (gtfiles): Replace d-lang.h for d-tree.h
|
||||
* d-lang.h: Move all GTY structures to d-tree.h, updated all source
|
||||
header dependencies.
|
||||
* d-tree.h: New file.
|
||||
|
||||
2015-08-04 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* toir.cc (IRVisitor::start_condition): Don't cache condition.
|
||||
(IRVisitor::start_else): Return the then body, updated all callers.
|
||||
(IRVisitor::end_condition): Update signature.
|
||||
(IRVisitor::start_catches): Return the try body, updated all callers.
|
||||
(IRVisitor::start_catch): Don't cache catch type.
|
||||
(IRVisitor::end_catch): Update signature.
|
||||
(IRVisitor::end_catches): Update signature.
|
||||
(IRVisitor::start_finally): Return the try body, updated all callers.
|
||||
(IRVisitor::end_finally): Update signature.
|
||||
(IRVisitor::start_case): Don't cache the condition.
|
||||
(IRVisitor::end_case): Update signature.
|
||||
* d-codegen.cc (convert_for_assignment): Use size_type_node for index.
|
||||
* d-irstate.cc (IRState::beginFlow): Remove call to push_stmt_list.
|
||||
|
||||
2015-08-04 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (push_stmt_list): New function.
|
||||
(pop_stmt_list): New function.
|
||||
(add_stmt): New function.
|
||||
(start_function): New function.
|
||||
(end_function): New function.
|
||||
(expand_decl): Update to use new interface.
|
||||
(build_closure): Likewise.
|
||||
(push_binding_level): Moved from d-lang.cc.
|
||||
(pop_binding_level): Likewise.
|
||||
* d-lang.cc (d_init): Inline call to init_global_binding_level.
|
||||
(alloc_binding_level): Remove function.
|
||||
(push_binding_level): Remove function.
|
||||
(pop_binding_level): Remove function.
|
||||
(init_global_binding_level): Remove function.
|
||||
(set_decl_binding_chain): Remove function.
|
||||
* d-elem.cc (DeclarationExp::toElem): Likewise.
|
||||
* d-objfile.cc (VarDeclaration::toObjFile): Likewise.
|
||||
(FuncDeclaration::toObjFile): Likewise.
|
||||
* toir.cc (IRVisitor::start_scope): Moved from d-irstate.cc, updated
|
||||
all callers in IRVisitor.
|
||||
(IRVisitor::end_scope): Likewise.
|
||||
(IRVisitor::is_return_label): Likewise.
|
||||
(IRVisitor::do_label): Likewise.
|
||||
(IRVisitor::do_jump): Likewise.
|
||||
(IRVisitor::start_condition): Likewise.
|
||||
(IRVisitor::start_else): Likewise.
|
||||
(IRVisitor::end_condition): Likewise.
|
||||
(IRVisitor::start_catches): Likewise.
|
||||
(IRVisitor::start_catch): Likewise.
|
||||
(IRVisitor::end_catch): Likewise.
|
||||
(IRVisitor::end_catches): Likewise.
|
||||
(IRVisitor::start_finally): Likewise.
|
||||
(IRVisitor::end_finally): Likewise.
|
||||
(IRVisitor::end_loop): Likewise.
|
||||
(IRVisitor::start_case): Likewise.
|
||||
(IRVisitor::end_case): Likewise.
|
||||
(build_ir): Update signature.
|
||||
|
||||
2015-08-01 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* Make-lang.in (DMD_COMPILE): Declare as COMPILE with WARN_CXXFLAGS
|
||||
replaced with DMD_WARN_CXXFLAGS.
|
||||
(DMDGEN_COMPILE): Declare as DMD_COMPILE but with COMPILER replaced
|
||||
with COMPILER_FOR_BUILD.
|
||||
(d/idgen): Use LINKER_FOR_BUILD.
|
||||
(d/impcvgen): Likewise.
|
||||
(d/%.o): Use DMD_COMPILE and POSTCOMPILE.
|
||||
(d/%.dmdgen.o): Use DMDGEN_COMPILE and POSTCOMPILE.
|
||||
|
||||
2015-07-27 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (current_irstate): Remove.
|
||||
(d_build_call): Check cfun before dereferencing.
|
||||
* d-codegen.h (current_irstate): Redefine as macro.
|
||||
* d-irstate.cc (IRState::IRState): Remove.
|
||||
(IRState::startFunction): Initialize language-specific cfun field.
|
||||
(IRState::endFunction): Free language-specific cfun field.
|
||||
* d-lang.cc (d_parse_file): Don't initialize current_irstate.
|
||||
* d-lang.h (language_function): Add irs field.
|
||||
* d-objfile.cc (Dsymbol::toObjFile): Check cfun.
|
||||
(FuncDeclaration::toObjFile): Adjust start and end calls.
|
||||
|
||||
2015-07-26 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-irstate.cc (IRState::doArraySet): Remove function.
|
||||
* d-codegen.cc (build_array_set): New function.
|
||||
* d-elem.cc (AssignExp::toElem): Use build_array_set.
|
||||
(StructLiteralExp::toElem): Likewise.
|
||||
|
||||
* d-codegen.cc (build_array_set): Don't set this_block, update call to
|
||||
pop_binding_level.
|
||||
* d-irstate.cc (IRState::endFunction): Update assert.
|
||||
(IRState::startScope): Move IRState::startBindings here, clean-up.
|
||||
(IRState::endScope): Move IRState::endBindings here, clean-up.
|
||||
(IRState::startBindings): Remove function.
|
||||
(IRState::endBindings): Likewise.
|
||||
(IRState::currentScope): Likewise.
|
||||
(IRState::scopes_): Remove.
|
||||
* d-lang.cc (pop_binding_level): Update signature, clean-up.
|
||||
(d_pushdecl): Don't set names_end.
|
||||
(binding_level::names_end): Remove.
|
||||
(binding_level::this_block): Remove.
|
||||
(FuncDeclaration::toObjFile): Clean-up.
|
||||
|
||||
2015-07-24 Sebastien Alaiwan <sebastien.alaiwan@gmail.com>
|
||||
|
||||
* d-lang.cc (deps_write): Use StringTable instead of hash_set of string
|
||||
pointers.
|
||||
|
||||
2015-07-23 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-attribs.h: Adjust includes.
|
||||
* d-builtins.cc: Likewise.
|
||||
* d-codegen.cc: Likewise.
|
||||
* d-convert.cc: Likewise.
|
||||
* d-decls.cc: Likewise.
|
||||
* d-elem.cc: Likewise.
|
||||
* d-glue.cc: Likewise.
|
||||
* d-incpath.cc: Likewise.
|
||||
* d-irstate.cc: Likewise.
|
||||
* d-lang.cc: Likewise.
|
||||
* d-longdouble.cc: Likewise.
|
||||
* d-objfile.cc: Likewise.
|
||||
* d-port.cc: Likewise.
|
||||
* d-target.cc: Likewise.
|
||||
* d-todt.cc: Likewise.
|
||||
* toir.cc: Likewise.
|
||||
* types.cc: Likewise.
|
||||
|
||||
2015-07-22 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (convert_expr): Warn about casts between imaginary
|
||||
and non-imaginary types.
|
||||
* d-convert (d_convert_basic): Rename to convert, handle conversions
|
||||
between complex and imaginary types.
|
||||
(convert): Remove.
|
||||
(d_build_truthvalue_op): Update to call convert.
|
||||
(d_truthvalue_conversion): Likewise.
|
||||
|
||||
* d-builtins.cc (d_init_builtins): Build imaginary types as distinct
|
||||
floating point type nodes.
|
||||
* d-codegen.cc (build_float_modulus): Update to handle imaginary types.
|
||||
(d_array_type): Use the front-end equivalent of sizetype to represent
|
||||
the index type of arrays.
|
||||
(build_array_index): Likewise.
|
||||
(build_offset_op): Likewise.
|
||||
(expand_intrinsic): Only get the inner callee if it's an address.
|
||||
|
||||
* d-codegen.h (component_ref, modify_expr, vmodify_expr, build_vinit)
|
||||
(build_nop, build_vconvert, build_boolop, compound_expr)
|
||||
(vcompound_expr, real_part, imaginary_part): Move to d-codegen.cc,
|
||||
use fold build functions for codegen.
|
||||
* d-codeden.cc (build_address): Use build_fold_addr_expr_with_type,
|
||||
remove special handling of taking an address of an indirect ref.
|
||||
(return_expr): New function.
|
||||
(complex_expr): New function.
|
||||
(indirect_ref): Use fold build functions for codegen.
|
||||
(build_deref): Likewise.
|
||||
(build_array_index): Likewise.
|
||||
(build_offset_op): Likewise.
|
||||
(void_okay_p): Likewise.
|
||||
(build_binary_op): Likewise.
|
||||
(build_float_modulus): Likewise.
|
||||
* d-objfile.cc (FuncDeclaration::toObjFile): Likewise.
|
||||
* d-elem.cc (MinExp::toElem): Likewise.
|
||||
(AddExp::toElem): Likewise.
|
||||
(NotExp::toElem): Likewise.
|
||||
(ComExp::toElem): Likwise.
|
||||
(NegExp::toElem): Likewise.
|
||||
* d-irstate.cc (IRState::doLabel): Likewise.
|
||||
(IRState::doReturn): Likewise.
|
||||
(IRState::doJump): Likewise.
|
||||
|
||||
* d-attribs.c: Adjust includes for flags.h changes.
|
||||
* d-builtins.cc: Likewise.
|
||||
* d-codegen.cc: Likewise.
|
||||
* d-convert.cc: Likewise.
|
||||
* d-elem.cc: Likewise.
|
||||
* d-decls.cc: Likewise.
|
||||
* d-glue.cc: Likewise.
|
||||
* d-incpath.cc: Likewise.
|
||||
* d-irstate.cc: Likewise.
|
||||
* d-lang.cc: Likewise.
|
||||
* d-longdouble.cc: Likewise.
|
||||
* d-objfile.cc: Likewise.
|
||||
* d-port.cc: Likewise.
|
||||
* d-target.cc: Likewise.
|
||||
* d-todt.cc: Likewise.
|
||||
* toir.cc: Likewise.
|
||||
* types.cc: Likewise.
|
||||
|
||||
2015-07-20 Sebastien Alaiwan <sebastien.alaiwan@gmail.com>
|
||||
|
||||
* d-lang.cc (is_system_module): Extract function.
|
||||
(write_one_dep): Extract function.
|
||||
(deps_write): Eliminate duplicated dependencies, include
|
||||
indirect and private dependencies.
|
||||
|
||||
2015-07-19 Sebastien Alaiwan <sebastien.alaiwan@gmail.com>
|
||||
|
||||
* d-lang.cc (d_parse_file): Set ref flag on the module and make deps
|
||||
file handle.
|
||||
|
||||
2015-07-11 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (convert_for_assignment): Remove handling of zero
|
||||
initialising a structure using memset.
|
||||
(d_build_call): Removing handling of setting of return slot
|
||||
optimisation on in call expression.
|
||||
* d-elem.cc (AssignExp::toElem): Emit a memset to zero initialise
|
||||
structures here. Set return slot optimisation on construction of
|
||||
static arrays and structs only.
|
||||
|
||||
2015-07-07 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (expand_intrinsic_arith): Use build_deref to handle
|
||||
ref parameters being used for the 'overflow' parameter.
|
||||
|
||||
2015-07-03 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-elem.cc (StringExp::toElem): Zero-terminate all string literals
|
||||
types, except for static arrays.
|
||||
* d-objfile.cc (build_type_decl): Add TYPE_DECLs to global declarations,
|
||||
don't call rest_of_decl_declaration.
|
||||
(d_finish_compilation): Call rest_of_decl_declaration on TYPE_DECLs.
|
||||
(Dsymbol::toObjFile): Don't try to handle tuples when emitting import
|
||||
declarations to debug.
|
||||
* d-builtins.cc (builtin_sym): Use StructDeclaration for decl field.
|
||||
(build_dtype): Don't handle anonymous structs. Create a stub parent
|
||||
module for the declaration symbol.
|
||||
(d_build_builtins_module): Always override the parent module of
|
||||
converted struct declarations.
|
||||
(maybe_set_builtin_1): Convert all static array parameters to ref
|
||||
parameters, not just va_list.
|
||||
|
||||
2015-07-01 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-attribs.c (d_handle_section_attribute): Use VAR_P throughout.
|
||||
(d_handle_weak_attribute): Use VAR_OR_FUNCTION_DECL_P.
|
||||
* d-codegen.cc (convert_for_assignment): Use VAR_P.
|
||||
* d-lang.cc (pop_binding_level): Likewise.
|
||||
(d_types_compatible_p): Likewise.
|
||||
* d-objfile.cc (setup_symbol_storage): Likewise.
|
||||
(mark_needed): Likewise.
|
||||
(d_finish_compilation): Likewise.
|
||||
|
||||
2015-06-30 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* intrinsics.def: Added ADDS, ADDSL, ADDU, ADDUL, SUBS, SUBSL, NEGS,
|
||||
NEGSL, MULS, MULSL, MULU, and MULUL intrinsic definitions.
|
||||
* d-codegen.cc (expand_intrinsic_arith): New function.
|
||||
(expand_intrinsic): Add cases for core.checkedint functions adds, addu,
|
||||
subs, subu, negs, muls, and mulu intrinsics.
|
||||
|
||||
2015-06-27 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* Make-lang.in (D_DMD_H): Remove.
|
||||
(D_TREE_H): Likewise.
|
||||
(CFLAGS-d/d-spec.o): Declare extra CFLAGS for building driver.
|
||||
(d-warn): Declare default warning flags for compiler.
|
||||
(D_DMD_OBJS): Remove 'dmd' from the object file suffix.
|
||||
(D_GLUE_OBJS): Remove 'cglue' and 'glue' from object file suffix.
|
||||
(D_GENERATED_OBJS): Remove 'gen' from the object file suffix.
|
||||
(D_BORROWED_C_OBJS): Remove.
|
||||
(CFLAGS-d/id.o): Declare extra CFLAGS for building generated sources.
|
||||
(CFLAGS-d/impcnvtab.o): Likewise.
|
||||
* types.cc (TypeVisitor::visit (TypeClass)): Build a pointer type for
|
||||
classes, not a reference type.
|
||||
* types.cc (TypeVisitor::visit (TypeDelegate)): Don't build a
|
||||
METHOD_TYPE for delegates, as that requires knowing the underlying
|
||||
record type for the 'this' object parameter.
|
||||
(TypeVisitor::visit (TypeEnum): Don't call rest_of_type_compilation.
|
||||
(TypeVisitor::visit (TypeClass): Likewise.
|
||||
(TypeVisitor::visit (TypeStruct): Likewise.
|
||||
* d-decls.cc (TypeInfoDeclaration::toSymbol): Assert class is a pointer
|
||||
type, not a reference type.
|
||||
(FuncDeclaration::toSymbol): Don't convert nested functions into a
|
||||
METHOD_TYPE to be strictly compatible with delegates.
|
||||
* d-codegen.cc (convert_for_argument): Use correct accessors for array
|
||||
.ptr and .length properties.
|
||||
(expand_intrinsic_vaarg): Don't remove the va_list pointer reference,
|
||||
as the backend now assumes this is what the front-end sets up.
|
||||
(d_build_call): Remove assert as delegates and nested functions are no
|
||||
longer represented as METHOD_TYPE.
|
||||
(build_vthis_type): New function.
|
||||
(d_decl_context): Don't set static/__gshared declaration context as
|
||||
anything other than the enclosing module of the declaration.
|
||||
* toir.cc (IRVisitor::visit (ExtAsmStatement)): Support named labels by
|
||||
calling resolve_asm_operand_names.
|
||||
* d-builtins.cc (d_backend_init): Remove.
|
||||
(d_backend_term): Remove.
|
||||
* d-lang.cc (d_write_global_declarations): Remove langhook.
|
||||
(d_init): Move d_backend_init implementation here.
|
||||
(d_parse_file): Move d_write_global_declarations implementation here.
|
||||
(d_finish_compilation): Remove calls to finalize_compilation_unit,
|
||||
check_global_declarations, and emit_debug_global_declarations.
|
||||
(d-system.h): Remove file. Move all includes into local sources.
|
||||
|
||||
2015-06-22 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (d_build_call): Only apply CALL_EXPR_RETURN_SLOT_OPT to
|
||||
calls returning an aggregate.
|
||||
(expand_intrinsic): Use CALL_EXPR_FN and CALL_EXPR_ARG directly.
|
||||
(layout_aggregate_type): Update signature.
|
||||
(insert_aggregate_field): Likewise.
|
||||
(finish_aggregate_type): Likewise.
|
||||
* d-codegen.h (AggLayout): Remove helper class.
|
||||
(AddrOfExpr): Remove helper class.
|
||||
(CallExpr): Remove helper class.
|
||||
* d-elem.cc (InExp::toElem): Use build_address directly.
|
||||
(CatAssignExp::toElem): Likewise.
|
||||
(IndexExp::toElem): Likewise.
|
||||
(RemoveExp::toElem): Likewise.
|
||||
* types.cc (TypeVisitor::visit (TypeFunction)): Only apply
|
||||
TREE_ADDRESSABLE to function types returning an aggregate.
|
||||
(TypeVisitor::visit (TypeStruct)): Update for layout_aggregate_type and
|
||||
finish_aggregate_type changes.
|
||||
(TypeVisitor::visit (TypeClass)): Likewise.
|
||||
|
||||
2015-06-21 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-objfile.cc (setup_symbol_storage): Mark declarations as private or
|
||||
protected for the benefit of debug code.
|
||||
* d-elem.cc (ArrayLiteralExp::toElem): Only set a value at the given
|
||||
index in the array constructor if it is non-zero.
|
||||
(AssignExp::toElem): Use memset it assigning/initialising an array with
|
||||
all zeroes.
|
||||
(IndexExp::toElem): Simplify codegen to use a placeholder variable for
|
||||
the dollar length.
|
||||
(SliceExp::toElem): Likewise.
|
||||
* d-codegen.cc (ArrayScope): Remove helper class.
|
||||
* Make-lang.in (cc1d$(exeext)): Use link mutex.
|
||||
|
||||
2015-05-03 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* Make-lang.in (D_GLUE_OBJS): Rename d-ctype.cc to types.cc.
|
||||
(d-spec.o): Rename d-spec.cc to d-spec.c
|
||||
* types.cc (build_ctype): New function.
|
||||
(Type::toCtype): Convert toCtype methods to use Visitor interface.
|
||||
|
||||
2015-04-29 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* Make-lang.in (D_GLUE_OBJS): Add d-attribs.o. Remove d-gt.o.
|
||||
* d-attribs.c: New file.
|
||||
* d-builtins.cc: Move attribute handler functions to d-attribs.c
|
||||
* d-lang.cc: Likewise. Added include for gtype-d.h from d-gt.cc.
|
||||
* d-gt.cc: Remove file.
|
||||
|
||||
2015-04-27 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-builtins.cc, d-convert.cc, d-ctype.cc, d-decls.cc, d-elem.cc,
|
||||
d-glue.cc, d-incpath.cc, d-irstate.cc, d-longdouble.cc, d-port.cc,
|
||||
d-target.cc, d-typinf.cc, toir.cc: Re-order included headers.
|
||||
* d-codegen.h, d-dmd-gcc.h, d-irstate.h, d-lang.h, d-objfile.cc,
|
||||
d-system.h: Remove all includes from headers.
|
||||
* d-codegen.cc: Re-order included headers.
|
||||
(build_attributes): Use ctfeInterpret instead of optimize.
|
||||
* d-lang.cc: Re-order included headers.
|
||||
(d_init_options): Don't use tristate enum for flag_emit_templates.
|
||||
(d_handle_option): Likewise.
|
||||
* d-objfile.cc: Re-order included headers.
|
||||
(output_declaration_p): Update check for flag_emit_templates.
|
||||
(setup_symbol_storage): Likewise.
|
||||
* d-todt.cc: Re-order included headers.
|
||||
(ExpInitializer::toDt): Use ctfeInterpret instead of optimize.
|
||||
(TypeInfoTupleDeclaration::toDt): Likewise.
|
||||
|
||||
2015-04-20 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (build_exception_object): Remove.
|
||||
* runtime.def (BEGIN_CATCH): Declare runtime function __gdc_begin_catch.
|
||||
* toir.cc (IRVisitor::visit::TryCatchStatement): Use LIBCALL_BEGIN_CATCH
|
||||
to get the correct exception object for handler.
|
||||
|
||||
2015-04-18 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (d_build_call): Set CALL_EXPR_RETURN_SLOT_OPT on calls to
|
||||
functions that return an aggregate or array that returns in memory.
|
||||
(build_memref): New function.
|
||||
(get_object_method): Use build_memref instead of building a
|
||||
POINTER_PLUS_EXPR for vtable dereferences.
|
||||
* d-objfile.cc (FuncDeclaration::toObjFile): Support NRVO on
|
||||
ARRAY_TYPE's that may not return in registers.
|
||||
* d-ctype.cc (TypeFunction::toCtype): Don't mark TREE_ADDRESSABLE when
|
||||
returning non-POD types by reference.
|
||||
|
||||
2015-04-15 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-decls.cc (EnumDeclaration::toDebug): Remove.
|
||||
(ClassDeclaration::toDebug): Remove.
|
||||
(StructDeclaration::toDebug): Remove.
|
||||
* d-ctype.cc (TypeEnum::toCtype): Call rest_of_type_compilation here.
|
||||
(TypeClass::toCtype): Likewise.
|
||||
(TypeStruct::toCtype): Likewise.
|
||||
|
||||
2015-04-12 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-objfile.cc (get_decl_tree): Check and generate correct code for when
|
||||
a non-local 'this' is accessed through a closure pointer.
|
||||
(FuncDeclaration::toObjFile): Remove check for _arguments.
|
||||
* d-codegen.cc (build_local_var): Likewise.
|
||||
|
||||
2015-04-11 Johannes Pfau <johannespfau@gmail.com>
|
||||
|
||||
* d-objfile.cc (setup_symbol_storage): Mark functions without
|
||||
body as DECL_EXTERNAL.
|
||||
|
||||
2015-04-08 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.cc (get_decl_tree): Get correct non-local 'this' decl by
|
||||
constructing component reference through parent link of nested classes.
|
||||
* d-builtins.cc (DEF_FUNCTION_TYPE_VAR_8): Remove.
|
||||
(DEF_FUNCTION_TYPE_VAR_12): Likewise.
|
||||
(DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros.
|
||||
|
||||
2015-04-07 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-objfile.cc (output_declaration_p): Remove check for semanticRun.
|
||||
(FuncDeclaration::toObjFile): Name bool parameter force_p, allow it to
|
||||
override the initial output_declaration_p check. Force run all
|
||||
semantic passes for symbols that it routine is generating code for.
|
||||
(d_finish_function): Don't mark TREE_STATIC on functions that are
|
||||
really DECL_EXTERN.
|
||||
(finish_thunk): Force thunks referencing external methods to be
|
||||
expanded to gimple.
|
||||
* d-decls.cc (FuncDeclaration::toThunkSymbol): Call toObjFile on all
|
||||
thunk target functions.
|
||||
|
||||
2015-04-05 Johannes Pfau <johannespfau@gmail.com>
|
||||
|
||||
* d-lang.cc (d_handle_section_attribute): New function.
|
||||
* d-builtins.cc (handle_alias_attribute): Move to d-lang.cc to
|
||||
support attribute(alias) in user code.
|
||||
* d-lang.cc (d_handle_alias_attribute): Ditto.
|
||||
* d-lang.cc (d_handle_weak_attribute): New function.
|
||||
* d-decls.cc (FuncDeclaration::toSymbol): Do not set
|
||||
DECL_DECLARED_INLINE_P prematurely.
|
||||
|
||||
2015-03-21 Johannes Pfau <johannespfau@gmail.com>
|
||||
|
||||
* d-lang.cc (d_init): Add GNU_EMUTLS version.
|
||||
* d-objfile.cc (build_emutls_function): New function.
|
||||
* d-objfile.cc (VarDeclaration::toObjFile): Collect all TLS variables
|
||||
in a module into tlsVars array.
|
||||
* d-objfile.cc (genmoduleinfo): Add reference to __modtlsscan
|
||||
function generated by build_emutls_function to moduleinfo.
|
||||
|
||||
2015-02-02 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* config-lang.in: Remove lang_requires_boot_languages.
|
||||
* d-incpath.cc (iprefix): Remove global variable.
|
||||
(multilib_dir): Ditto.
|
||||
(prefixed_path): Add iprefix parameter.
|
||||
(add_import_paths): Add iprefix and imultilib parameter.
|
||||
Use cpp_include_defaults to get list of import paths.
|
||||
* d-lang.cc (iprefix_dir): New static variable to cache -iprefix switch.
|
||||
(imultilib_dir): New static variable to cache -imultilib switch.
|
||||
(d_init): Pass iprefix_dir and imultilib_dir to add_import_paths.
|
||||
(d_handle_option): Use new static variables.
|
||||
|
||||
2015-02-01 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-lang.cc: Remove d-confdef.h header.
|
||||
* d-incpath.cc: Ditto.
|
||||
* d-spec.cc: Ditto.
|
||||
|
||||
2015-01-31 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-incpath.cc (add_phobos_versyms): Remove function.
|
||||
* d-lang.cc (d_init): Remove call to add_phobos_versyms.
|
||||
|
||||
2015-01-28 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-builtins.cc (DEF_FUNCTION_TYPE_VAR_8)
|
||||
(DEF_FUNCTION_TYPE_VAR_12): New macros.
|
||||
|
||||
2015-01-24 Johannes Pfau <johannespfau@gmail.com>
|
||||
|
||||
* d-builtins.cc (d_build_builtins_module): Mark builtin functions
|
||||
as @nogc.
|
||||
|
||||
2015-01-18 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* Make-lang.in: Update for D frontend changes.
|
||||
* d-asmstmt.cc: Remove file.
|
||||
* d-builtins.cc (build_dtype): No longer set struct handle.
|
||||
(d_gcc_paint_type): Move to Target::paintAsType.
|
||||
* d-codegen.cc (convert_expr): No longer call getImpl on associative
|
||||
array conversions. Add case for converting void pointers to delegates.
|
||||
(unhandled_arrayop_p): Remove.
|
||||
(build_two_field_type): Use layout_type instead of building
|
||||
TYPE_STUB_DECL and calling rest_of_decl_compilation.
|
||||
(build_binop_assignment): New function.
|
||||
(libcall_ids): Remove static variable.
|
||||
(get_libcall): New function.
|
||||
(maybe_set_intrinsic): Remove druntime library call handling.
|
||||
(expand_intrinsic_vaarg): Dereference ref va_list parameters.
|
||||
(build_closure): New function.
|
||||
(WrappedExp::WrappedExp): Move to frontend sources.
|
||||
(WrappedExp::toCBuffer): Ditto.
|
||||
* d-codegen.h (LibCallFlag): New enum.
|
||||
(LibCall): Use runtime.def macro to define members.
|
||||
* d-ctype.cc (Type::toCParamtype): Remove function.
|
||||
(TypeTypedef::toCParamtype): Ditto.
|
||||
(TypeClass::toSymbol): Ditto.
|
||||
(TypeFunction::retStyle): Move to retStyle.
|
||||
(TypeSArray::toCParamtype): Ditto.
|
||||
(Type::toSymbol): Ditto.
|
||||
(Type::totym): Ditto.
|
||||
(TypeFunction::totym): Ditto.
|
||||
* d-decls.cc (Dsymbol::toSymbolX): Update for frontend changes.
|
||||
(Dsymbol::toImport): Ditto.
|
||||
(VarDeclaration::toSymbol): Ditto.
|
||||
(FuncDeclaration::toSymbol): Ditto.
|
||||
(InterfaceDeclaration::toSymbol): Use TREE_READONLY instead of
|
||||
(EnumDeclaration::toDebug): Only call rest_of_type_compilation on
|
||||
ENUMERAL_TYPE types.
|
||||
TREE_CONSTANT to declare that the symbol cannot be modified.
|
||||
(ClassDeclaration::toVtblSymbol): Ditto.
|
||||
(AggregateDeclaration::toInitializer): Ditto.
|
||||
(EnumDeclaration::toInitializer): Ditto.
|
||||
(TypedefDeclaration::toInitializer): Remove function.
|
||||
(TypedefDeclaration::toDebug): Ditto.
|
||||
(Dsymbol::cvMember): Remove stub function.
|
||||
(EnumDeclaration::cvMember): Ditto.
|
||||
(FuncDeclaration::cvMember): Ditto.
|
||||
(VarDeclaration::cvMember): Ditto.
|
||||
(TypedefDeclaration::cvMember): Ditto.
|
||||
* d-elem.cc (XorExp::toElem): Remove call to unhandled_arrayop_p.
|
||||
(OrExp::toElem): Ditto.
|
||||
(AndExp::toElem): Ditto.
|
||||
(UshrExp::toElem): Ditto.
|
||||
(ShrExp::toElem): Ditto.
|
||||
(ShlExp::toElem): Ditto.
|
||||
(ModExp::toElem): Ditto.
|
||||
(DivExp::toElem): Ditto.
|
||||
(MulExp::toElem): Ditto.
|
||||
(MinExp::toElem): Ditto.
|
||||
(AddExp::toElem): Ditto.
|
||||
(XorAssignExp::toElem): Ditto.
|
||||
(OrAssignExp::toElem): Ditto.
|
||||
(AndAssignExp::toElem): Ditto.
|
||||
(UshrAssignExp::toElem): Ditto.
|
||||
(ShrAssignExp::toElem): Ditto.
|
||||
(ShlAssignExp::toElem): Ditto.
|
||||
(ModAssignExp::toElem): Ditto.
|
||||
(DivAssignExp::toElem): Ditto.
|
||||
(MulAssignExp::toElem): Ditto.
|
||||
(PowAssignExp::toElem): Ditto.
|
||||
(MinAssignExp::toElem): Ditto.
|
||||
(AddAssignExp::toElem): Ditto.
|
||||
(BinExp::toElemBin): Move to build_binop_assignment.
|
||||
(AssignExp::toElem): Update for frontend changes.
|
||||
(DelegatePtrExp::toElem): New function.
|
||||
(DelegateFuncptrExp::toElem): New function.
|
||||
(DelegateExp::toElem): Update for frontend changes.
|
||||
(FuncExp::toElem): Ditto.
|
||||
(NewExp::toElem): Ditto.
|
||||
(StringExp::toElem): Don't set TREE_READONLY on string literals.
|
||||
(AssocArrayLiteralExp::toElem): Remove codegen rewrite for new
|
||||
associative array implementation.
|
||||
* d-glue.cc (Global::isSpeculativeGagging): Remove function.
|
||||
(Dsymbol::ungagSpeculative): Ditto.
|
||||
(Ungag::~Ungag): Ditto.
|
||||
(Loc::toChars): Update for new column diagnostic support.
|
||||
(Loc::Loc): Ditto.
|
||||
(Loc::equals): Ditto.
|
||||
(error): Ditto.
|
||||
(binary): Remove function.
|
||||
(asmSemantic): New function.
|
||||
(retStyle): New function.
|
||||
(FuncDeclaration::isBuiltin): Rename to isBuiltin.
|
||||
* d-intrinsics.def: Rename to intrinsics.def.
|
||||
* d-irstate.cc (IRState::addExp): Remove old warning to catch statements
|
||||
with no side effects. Now handled in frontend.
|
||||
* d-lang.cc (d_init_options): Update for frontend changes.
|
||||
(d_initialize_diagnostics): Remove function.
|
||||
(d_add_builtin_version): Update for frontend changes.
|
||||
(d_init): Ditto.
|
||||
(d_handle_option): Ditto.
|
||||
(d_post_options): Ditto.
|
||||
(d_parse_file): Ditto.
|
||||
* d-objfile.cc (Nspace::toObjFile): New function.
|
||||
(StructDeclaration::toObjFile): Update for frontend changes.
|
||||
(TypedefDeclaration::toObjFile): Remove function.
|
||||
(TemplateInstance::toObjFile): Update for frontend changes.
|
||||
(TemplateMixin::toObjFile): Ditto.
|
||||
(unnest_function): New function.
|
||||
(output_declaration_p): Update for frontend changes.
|
||||
(FuncDeclaration::toObjFile): Ditto.
|
||||
(FuncDeclaration::buildClosure): Move to buildClosure.
|
||||
(get_linemap): Update for frontend changes.
|
||||
(build_simple_function): Ditto.
|
||||
(build_call_function): Ditto.
|
||||
* d-target.cc (Target::va_listType): New function.
|
||||
(Target::paintAsType): Ditto.
|
||||
* d-todt.cc (dt_container2): Do not set TREE_READONLY on initialisers.
|
||||
(dt_container): Ditto.
|
||||
(ClassReferenceExp::toDt2): Update for C++ class support.
|
||||
(ClassReferenceExp::toInstanceDt): Ditto.
|
||||
(TypeTypedef::toDt): Remove function.
|
||||
(TypeInfoTypedefDeclaration::toDt): Ditto.
|
||||
(TypeInfoAssociativeArrayDeclaration::toDt): Update typeinfo size.
|
||||
(TypeInfoAssociativeArrayDeclaration::toDt): Remove reference to impl
|
||||
field in TypeInfo struct.
|
||||
(TypeInfoStructDeclaration::toDt): Update for frontend changes.
|
||||
* d-typinf.cc (Type::getTypeInfo): Update for frontend changes.
|
||||
(TypeTypedef::getTypeInfoDeclaration): Remove function.
|
||||
(createTypeInfoArray): Remove function.
|
||||
* runtime.def: New file.
|
||||
* toir.cc (IRVisitor::visit::DtorExpStatement): Remove function.
|
||||
(IRVisitor::visit::ExtAsmStatement): Update for frontend changes.
|
||||
|
||||
2015-01-17 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-elem.cc (UshrAssignExp::toElem): Remove integer promotion on left
|
||||
hand side of unsigned right shift expression.
|
||||
|
||||
2015-01-13 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-system.h: Include hash-set.h, machmode.h, vec.h, double-int.h,
|
||||
input.h, alias.h, symtab.h and inchash.h due to flattening of tree.h.
|
||||
* d-gt.cc: Ditto.
|
||||
|
||||
2015-01-02 Iain Buclaw <ibuclaw@gdcproject.org>
|
||||
|
||||
* d-codegen.h (build_boolop): Don't eagerly fold comparison expressions.
|
||||
|
||||
|
||||
Copyright (C) 2015 Free Software Foundation, Inc.
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved.
|
1262
gcc/d/ChangeLog-2016
Normal file
1262
gcc/d/ChangeLog-2016
Normal file
File diff suppressed because it is too large
Load Diff
1175
gcc/d/ChangeLog-2017
Normal file
1175
gcc/d/ChangeLog-2017
Normal file
File diff suppressed because it is too large
Load Diff
337
gcc/d/Make-lang.in
Normal file
337
gcc/d/Make-lang.in
Normal file
@ -0,0 +1,337 @@
|
||||
# Make-lang.in -- Top level -*- makefile -*- fragment for the D frontend.
|
||||
# Copyright (C) 2006-2018 Free Software Foundation, Inc.
|
||||
|
||||
# GCC is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# GCC is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GCC; see the file COPYING3. If not see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
|
||||
# This file provides the language dependent support in the main Makefile.
|
||||
|
||||
# Installation name.
|
||||
|
||||
D_INSTALL_NAME = $(shell echo gdc|sed '$(program_transform_name)')
|
||||
D_TARGET_INSTALL_NAME = $(target_noncanonical)-$(shell echo gdc|sed '$(program_transform_name)')
|
||||
|
||||
# Name of phobos library
|
||||
D_LIBPHOBOS = -DLIBPHOBOS=\"gphobos\"
|
||||
|
||||
# The name for selecting d in LANGUAGES.
|
||||
d: d21$(exeext)
|
||||
|
||||
# Tell GNU make to ignore these if they exist.
|
||||
.PHONY: d
|
||||
|
||||
# Create the compiler driver for D.
|
||||
CFLAGS-d/d-spec.o += $(DRIVER_DEFINES) $(D_LIBPHOBOS)
|
||||
|
||||
GDC_OBJS = $(GCC_OBJS) d/d-spec.o
|
||||
gdc$(exeext): $(GDC_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBDEPS)
|
||||
+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
|
||||
$(GDC_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \
|
||||
$(EXTRA_GCC_LIBS) $(LIBS)
|
||||
|
||||
# Create a version of the gdc driver which calls the cross-compiler.
|
||||
gdc-cross$(exeext): gdc$(exeext)
|
||||
-rm -f gdc-cross$(exeext)
|
||||
cp gdc$(exeext) gdc-cross$(exeext)
|
||||
|
||||
# Filter out pedantic and virtual overload warnings.
|
||||
d-warn = $(filter-out -pedantic -Woverloaded-virtual, $(STRICT_WARN))
|
||||
|
||||
# Also filter out warnings for missing format attributes in the D Frontend.
|
||||
DMD_WARN_CXXFLAGS = $(filter-out -Wmissing-format-attribute, $(WARN_CXXFLAGS))
|
||||
DMD_COMPILE = $(subst $(WARN_CXXFLAGS), $(DMD_WARN_CXXFLAGS), $(COMPILE))
|
||||
DMDGEN_COMPILE = $(subst $(COMPILER), $(COMPILER_FOR_BUILD), $(DMD_COMPILE))
|
||||
|
||||
# D Frontend object files.
|
||||
D_FRONTEND_OBJS = \
|
||||
d/aav.o \
|
||||
d/access.o \
|
||||
d/aliasthis.o \
|
||||
d/apply.o \
|
||||
d/argtypes.o \
|
||||
d/arrayop.o \
|
||||
d/attrib.o \
|
||||
d/blockexit.o \
|
||||
d/canthrow.o \
|
||||
d/checkedint.o \
|
||||
d/clone.o \
|
||||
d/cond.o \
|
||||
d/constfold.o \
|
||||
d/cppmangle.o \
|
||||
d/ctfeexpr.o \
|
||||
d/dcast.o \
|
||||
d/dclass.o \
|
||||
d/declaration.o \
|
||||
d/delegatize.o \
|
||||
d/denum.o \
|
||||
d/dimport.o \
|
||||
d/dinterpret.o \
|
||||
d/dmacro.o \
|
||||
d/dmangle.o \
|
||||
d/dmodule.o \
|
||||
d/doc.o \
|
||||
d/dscope.o \
|
||||
d/dstruct.o \
|
||||
d/dsymbol.o \
|
||||
d/dtemplate.o \
|
||||
d/dversion.o \
|
||||
d/entity.o \
|
||||
d/escape.o \
|
||||
d/expression.o \
|
||||
d/expressionsem.o \
|
||||
d/file.o \
|
||||
d/filename.o \
|
||||
d/func.o \
|
||||
d/hdrgen.o \
|
||||
d/iasm.o \
|
||||
d/iasmgcc.o \
|
||||
d/identifier.o \
|
||||
d/imphint.o \
|
||||
d/init.o \
|
||||
d/initsem.o \
|
||||
d/intrange.o \
|
||||
d/json.o \
|
||||
d/lexer.o \
|
||||
d/mtype.o \
|
||||
d/nogc.o \
|
||||
d/nspace.o \
|
||||
d/objc.o \
|
||||
d/opover.o \
|
||||
d/optimize.o \
|
||||
d/outbuffer.o \
|
||||
d/parse.o \
|
||||
d/rmem.o \
|
||||
d/rootobject.o \
|
||||
d/safe.o \
|
||||
d/sapply.o \
|
||||
d/sideeffect.o \
|
||||
d/speller.o \
|
||||
d/statement.o \
|
||||
d/statementsem.o \
|
||||
d/staticassert.o \
|
||||
d/staticcond.o \
|
||||
d/stringtable.o \
|
||||
d/tokens.o \
|
||||
d/traits.o \
|
||||
d/typesem.o \
|
||||
d/utf.o \
|
||||
d/utils.o
|
||||
|
||||
# D Frontend generated files.
|
||||
D_GENERATED_SRCS = d/id.c d/id.h d/impcnvtab.c
|
||||
D_GENERATED_OBJS = d/id.o d/impcnvtab.o
|
||||
|
||||
# Language-specific object files for D.
|
||||
D_OBJS = \
|
||||
d/d-attribs.o d/d-builtins.o d/d-codegen.o d/d-convert.o \
|
||||
d/d-diagnostic.o d/d-frontend.o d/d-incpath.o d/d-lang.o \
|
||||
d/d-longdouble.o d/d-target.o d/decl.o d/expr.o d/imports.o \
|
||||
d/intrinsics.o d/modules.o d/runtime.o d/toir.o d/typeinfo.o d/types.o
|
||||
|
||||
# All language-specific object files for D.
|
||||
D_ALL_OBJS = $(D_FRONTEND_OBJS) $(D_GENERATED_OBJS) $(D_OBJS) $(D_TARGET_OBJS)
|
||||
|
||||
d_OBJS = $(D_ALL_OBJS) d/d-spec.o
|
||||
|
||||
d21$(exeext): $(D_ALL_OBJS) attribs.o $(BACKEND) $(LIBDEPS)
|
||||
+$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
|
||||
$(D_ALL_OBJS) attribs.o $(BACKEND) $(LIBS) $(BACKENDLIBS)
|
||||
|
||||
# Documentation.
|
||||
|
||||
D_TEXI_FILES = \
|
||||
d/gdc.texi \
|
||||
$(gcc_docdir)/include/fdl.texi \
|
||||
$(gcc_docdir)/include/gpl_v3.texi \
|
||||
$(gcc_docdir)/include/gcc-common.texi \
|
||||
gcc-vers.texi
|
||||
|
||||
doc/gdc.info: $(D_TEXI_FILES)
|
||||
if test "x$(BUILD_INFO)" = xinfo; then \
|
||||
rm -f doc/gdc.info*; \
|
||||
$(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \
|
||||
-I $(gcc_docdir)/include -o $@ $<; \
|
||||
else true; fi
|
||||
|
||||
doc/gdc.dvi: $(D_TEXI_FILES)
|
||||
$(TEXI2DVI) -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
|
||||
|
||||
doc/gdc.pdf: $(D_TEXI_FILES)
|
||||
$(TEXI2PDF) -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
|
||||
|
||||
$(build_htmldir)/d/index.html: $(D_TEXI_FILES)
|
||||
$(mkinstalldirs) $(@D)
|
||||
rm -f $(@D)/*
|
||||
$(TEXI2HTML) -I $(gcc_docdir) -I $(gcc_docdir)/include \
|
||||
-I $(srcdir)/d -o $(@D) $<
|
||||
|
||||
.INTERMEDIATE: gdc.pod
|
||||
|
||||
gdc.pod: d/gdc.texi
|
||||
-$(TEXI2POD) -D gdc < $< > $@
|
||||
|
||||
# Build hooks.
|
||||
|
||||
d.all.cross: gdc-cross$(exeext)
|
||||
d.start.encap: gdc$(exeext)
|
||||
d.rest.encap:
|
||||
d.info: doc/gdc.info
|
||||
d.dvi: doc/gdc.dvi
|
||||
d.pdf: doc/gdc.pdf
|
||||
d.html: $(build_htmldir)/d/index.html
|
||||
d.srcinfo: doc/gdc.info
|
||||
-cp -p $^ $(srcdir)/doc
|
||||
d.srcextra:
|
||||
|
||||
d.tags: force
|
||||
cd $(srcdir)/d; \
|
||||
etags -o TAGS.sub *.c *.cc *.h dmd/*.c dmd/*.h dmd/root/*.h dmd/root/*.c; \
|
||||
etags --include TAGS.sub --include ../TAGS.sub
|
||||
|
||||
d.man: doc/gdc.1
|
||||
d.srcman: doc/gdc.1
|
||||
-cp -p $^ $(srcdir)/doc
|
||||
|
||||
# 'make check' in gcc/ looks for check-d, as do all toplevel D-related
|
||||
# check targets. However, our DejaGNU framework requires 'check-gdc' as its
|
||||
# entry point. We feed the former to the latter here.
|
||||
check-d: check-gdc
|
||||
lang_checks += check-gdc
|
||||
lang_checks_parallelized += check-gdc
|
||||
check_gdc_parallelize = 10
|
||||
|
||||
# No D-specific selftests.
|
||||
selftest-d:
|
||||
|
||||
# Install hooks.
|
||||
|
||||
d.install-common: installdirs
|
||||
-rm -f $(DESTDIR)$(bindir)/$(D_INSTALL_NAME)$(exeext)
|
||||
$(INSTALL_PROGRAM) gdc$(exeext) $(DESTDIR)$(bindir)/$(D_INSTALL_NAME)$(exeext)
|
||||
-if test -f d21$(exeext); then \
|
||||
if test -f gdc-cross$(exeext); then \
|
||||
:; \
|
||||
else \
|
||||
rm -f $(DESTDIR)$(bindir)/$(D_TARGET_INSTALL_NAME)$(exeext); \
|
||||
( cd $(DESTDIR)$(bindir) && \
|
||||
$(LN) $(D_INSTALL_NAME)$(exeext) $(D_TARGET_INSTALL_NAME)$(exeext) ); \
|
||||
fi; \
|
||||
fi
|
||||
|
||||
d.install-plugin:
|
||||
|
||||
d.install-info: $(DESTDIR)$(infodir)/gdc.info
|
||||
|
||||
d.install-pdf: doc/gdc.pdf
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(pdfdir)" || $(mkinstalldirs) "$(DESTDIR)$(pdfdir)/gcc"
|
||||
@for p in doc/gdc.pdf; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(pdf__strip_dir) \
|
||||
echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/gcc/$$f'"; \
|
||||
$(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/gcc/$$f"; \
|
||||
done
|
||||
|
||||
d.install-html: $(build_htmldir)/d
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(htmldir)" || $(mkinstalldirs) "$(DESTDIR)$(htmldir)"
|
||||
@for p in $(build_htmldir)/d; do \
|
||||
if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
|
||||
f=$(html__strip_dir) \
|
||||
if test -d "$$d$$p"; then \
|
||||
echo " $(mkinstalldirs) '$(DESTDIR)$(htmldir)/$$f'"; \
|
||||
$(mkinstalldirs) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
|
||||
echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
|
||||
$(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
|
||||
else \
|
||||
echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
|
||||
$(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
d.install-man: $(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext)
|
||||
|
||||
$(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext): doc/gdc.1 installdirs
|
||||
-rm -f $@
|
||||
-$(INSTALL_DATA) $< $@
|
||||
-chmod a-x $@
|
||||
|
||||
d.uninstall:
|
||||
-rm -rf $(DESTDIR)$(bindir)/$(D_INSTALL_NAME)$(exeext)
|
||||
-rm -rf $(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext)
|
||||
-rm -rf $(DESTDIR)$(bindir)/$(D_TARGET_INSTALL_NAME)$(exeext)
|
||||
-rm -rf $(DESTDIR)$(infodir)/gdc.info*
|
||||
|
||||
# Clean hooks.
|
||||
|
||||
d.mostlyclean:
|
||||
-rm -f d/*$(objext)
|
||||
-rm -f d/*$(coverageexts)
|
||||
-rm -f $(D_GENERATED_SRCS)
|
||||
-rm -f d/gdc$(exeext) gdc-cross$(exeext) d/d21$(exeext)
|
||||
d.clean:
|
||||
d.distclean:
|
||||
d.maintainer-clean:
|
||||
-rm -f $(docobjdir)/gdc.1
|
||||
|
||||
# Stage hooks.
|
||||
|
||||
d.stage1: stage1-start
|
||||
-mv d/*$(objext) stage1/d
|
||||
d.stage2: stage2-start
|
||||
-mv d/*$(objext) stage2/d
|
||||
d.stage3: stage3-start
|
||||
-mv d/*$(objext) stage3/d
|
||||
d.stage4: stage4-start
|
||||
-mv d/*$(objext) stage4/d
|
||||
d.stageprofile: stageprofile-start
|
||||
-mv d/*$(objext) stageprofile/d
|
||||
d.stagefeedback: stagefeedback-start
|
||||
-mv d/*$(objext) stagefeedback/d
|
||||
|
||||
# Include the dfrontend and build directories for headers.
|
||||
D_INCLUDES = -I$(srcdir)/d -I$(srcdir)/d/dmd -Id
|
||||
|
||||
CFLAGS-d/id.o += $(D_INCLUDES)
|
||||
CFLAGS-d/impcnvtab.o += $(D_INCLUDES)
|
||||
|
||||
# Override build rules for D frontend.
|
||||
d/%.o: d/dmd/%.c $(D_GENERATED_SRCS)
|
||||
$(DMD_COMPILE) $(D_INCLUDES) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
d/%.o: d/dmd/root/%.c $(D_GENERATED_SRCS)
|
||||
$(DMD_COMPILE) $(D_INCLUDES) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
# Generated programs.
|
||||
d/idgen: d/idgen.dmdgen.o
|
||||
+$(LINKER_FOR_BUILD) $(BUILD_LINKER_FLAGS) $(BUILD_LDFLAGS) -o $@ $^
|
||||
|
||||
d/impcvgen: d/impcnvgen.dmdgen.o
|
||||
+$(LINKER_FOR_BUILD) $(BUILD_LINKER_FLAGS) $(BUILD_LDFLAGS) -o $@ $^
|
||||
|
||||
# Generated sources.
|
||||
d/id.c: d/idgen
|
||||
cd d && ./idgen
|
||||
|
||||
# idgen also generates id.h; just verify it exists.
|
||||
d/id.h: d/id.c
|
||||
|
||||
d/impcnvtab.c: d/impcvgen
|
||||
cd d && ./impcvgen
|
||||
|
||||
d/%.dmdgen.o: $(srcdir)/d/dmd/%.c
|
||||
$(DMDGEN_COMPILE) $(D_INCLUDES) $<
|
||||
$(POSTCOMPILE)
|
33
gcc/d/config-lang.in
Normal file
33
gcc/d/config-lang.in
Normal file
@ -0,0 +1,33 @@
|
||||
# config-lang.in -- Top level configure fragment for gcc D frontend.
|
||||
# Copyright (C) 2006-2018 Free Software Foundation, Inc.
|
||||
|
||||
# GCC is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# GCC is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GCC; see the file COPYING3. If not see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Configure looks for the existence of this file to auto-config each language.
|
||||
# We define several parameters used by configure:
|
||||
#
|
||||
# language - name of language as it would appear in $(LANGUAGES)
|
||||
# compilers - value to add to $(COMPILERS)
|
||||
|
||||
language="d"
|
||||
|
||||
compilers="d21\$(exeext)"
|
||||
|
||||
target_libs="target-libphobos target-zlib target-libbacktrace"
|
||||
|
||||
gtfiles="\$(srcdir)/d/d-tree.h \$(srcdir)/d/d-builtins.cc \$(srcdir)/d/d-lang.cc \$(srcdir)/d/modules.cc \$(srcdir)/d/typeinfo.cc"
|
||||
|
||||
# Do not build by default.
|
||||
build_by_default="no"
|
835
gcc/d/d-attribs.cc
Normal file
835
gcc/d/d-attribs.cc
Normal file
@ -0,0 +1,835 @@
|
||||
/* d-attribs.c -- D attributes handling.
|
||||
Copyright (C) 2015-2018 Free Software Foundation, Inc.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Implementation of attribute handlers for user defined attributes and
|
||||
internal built-in functions. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
|
||||
#include "dmd/declaration.h"
|
||||
#include "dmd/mtype.h"
|
||||
|
||||
#include "tree.h"
|
||||
#include "diagnostic.h"
|
||||
#include "tm.h"
|
||||
#include "cgraph.h"
|
||||
#include "toplev.h"
|
||||
#include "target.h"
|
||||
#include "common/common-target.h"
|
||||
#include "stringpool.h"
|
||||
#include "attribs.h"
|
||||
#include "varasm.h"
|
||||
|
||||
#include "d-tree.h"
|
||||
|
||||
|
||||
/* Internal attribute handlers for built-in functions. */
|
||||
static tree handle_noreturn_attribute (tree *, tree, tree, int, bool *);
|
||||
static tree handle_leaf_attribute (tree *, tree, tree, int, bool *);
|
||||
static tree handle_const_attribute (tree *, tree, tree, int, bool *);
|
||||
static tree handle_malloc_attribute (tree *, tree, tree, int, bool *);
|
||||
static tree handle_pure_attribute (tree *, tree, tree, int, bool *);
|
||||
static tree handle_novops_attribute (tree *, tree, tree, int, bool *);
|
||||
static tree handle_nonnull_attribute (tree *, tree, tree, int, bool *);
|
||||
static tree handle_nothrow_attribute (tree *, tree, tree, int, bool *);
|
||||
static tree handle_type_generic_attribute (tree *, tree, tree, int, bool *);
|
||||
static tree handle_transaction_pure_attribute (tree *, tree, tree, int, bool *);
|
||||
static tree handle_returns_twice_attribute (tree *, tree, tree, int, bool *);
|
||||
static tree handle_fnspec_attribute (tree *, tree, tree, int, bool *);
|
||||
|
||||
/* D attribute handlers for user defined attributes. */
|
||||
static tree d_handle_noinline_attribute (tree *, tree, tree, int, bool *);
|
||||
static tree d_handle_forceinline_attribute (tree *, tree, tree, int, bool *);
|
||||
static tree d_handle_flatten_attribute (tree *, tree, tree, int, bool *);
|
||||
static tree d_handle_target_attribute (tree *, tree, tree, int, bool *);
|
||||
static tree d_handle_noclone_attribute (tree *, tree, tree, int, bool *);
|
||||
static tree d_handle_section_attribute (tree *, tree, tree, int, bool *);
|
||||
static tree d_handle_alias_attribute (tree *, tree, tree, int, bool *);
|
||||
static tree d_handle_weak_attribute (tree *, tree, tree, int, bool *) ;
|
||||
|
||||
/* Helper to define attribute exclusions. */
|
||||
#define ATTR_EXCL(name, function, type, variable) \
|
||||
{ name, function, type, variable }
|
||||
|
||||
/* Define attributes that are mutually exclusive with one another. */
|
||||
static const struct attribute_spec::exclusions attr_noreturn_exclusions[] =
|
||||
{
|
||||
ATTR_EXCL ("const", true, true, true),
|
||||
ATTR_EXCL ("malloc", true, true, true),
|
||||
ATTR_EXCL ("pure", true, true, true),
|
||||
ATTR_EXCL ("returns_twice", true, true, true),
|
||||
ATTR_EXCL (NULL, false, false, false),
|
||||
};
|
||||
|
||||
static const struct attribute_spec::exclusions attr_returns_twice_exclusions[] =
|
||||
{
|
||||
ATTR_EXCL ("noreturn", true, true, true),
|
||||
ATTR_EXCL (NULL, false, false, false),
|
||||
};
|
||||
|
||||
static const struct attribute_spec::exclusions attr_const_pure_exclusions[] =
|
||||
{
|
||||
ATTR_EXCL ("const", true, true, true),
|
||||
ATTR_EXCL ("noreturn", true, true, true),
|
||||
ATTR_EXCL ("pure", true, true, true),
|
||||
ATTR_EXCL (NULL, false, false, false)
|
||||
};
|
||||
|
||||
static const struct attribute_spec::exclusions attr_inline_exclusions[] =
|
||||
{
|
||||
ATTR_EXCL ("noinline", true, true, true),
|
||||
ATTR_EXCL (NULL, false, false, false),
|
||||
};
|
||||
|
||||
static const struct attribute_spec::exclusions attr_noinline_exclusions[] =
|
||||
{
|
||||
ATTR_EXCL ("forceinline", true, true, true),
|
||||
ATTR_EXCL (NULL, false, false, false),
|
||||
};
|
||||
|
||||
/* Helper to define an attribute. */
|
||||
#define ATTR_SPEC(name, min_len, max_len, decl_req, type_req, fn_type_req, \
|
||||
affects_type_identity, handler, exclude) \
|
||||
{ name, min_len, max_len, decl_req, type_req, fn_type_req, \
|
||||
affects_type_identity, handler, exclude }
|
||||
|
||||
/* Table of machine-independent attributes.
|
||||
For internal use (marking of built-ins) only. */
|
||||
const attribute_spec d_langhook_common_attribute_table[] =
|
||||
{
|
||||
ATTR_SPEC ("noreturn", 0, 0, true, false, false, false,
|
||||
handle_noreturn_attribute, attr_noreturn_exclusions),
|
||||
ATTR_SPEC ("leaf", 0, 0, true, false, false, false,
|
||||
handle_leaf_attribute, NULL),
|
||||
ATTR_SPEC ("const", 0, 0, true, false, false, false,
|
||||
handle_const_attribute, attr_const_pure_exclusions),
|
||||
ATTR_SPEC ("malloc", 0, 0, true, false, false, false,
|
||||
handle_malloc_attribute, NULL),
|
||||
ATTR_SPEC ("returns_twice", 0, 0, true, false, false, false,
|
||||
handle_returns_twice_attribute, attr_returns_twice_exclusions),
|
||||
ATTR_SPEC ("pure", 0, 0, true, false, false, false,
|
||||
handle_pure_attribute, attr_const_pure_exclusions),
|
||||
ATTR_SPEC ("nonnull", 0, -1, false, true, true, false,
|
||||
handle_nonnull_attribute, NULL),
|
||||
ATTR_SPEC ("nothrow", 0, 0, true, false, false, false,
|
||||
handle_nothrow_attribute, NULL),
|
||||
ATTR_SPEC ("transaction_pure", 0, 0, false, true, true, false,
|
||||
handle_transaction_pure_attribute, NULL),
|
||||
ATTR_SPEC ("no vops", 0, 0, true, false, false, false,
|
||||
handle_novops_attribute, NULL),
|
||||
ATTR_SPEC ("type generic", 0, 0, false, true, true, false,
|
||||
handle_type_generic_attribute, NULL),
|
||||
ATTR_SPEC ("fn spec", 1, 1, false, true, true, false,
|
||||
handle_fnspec_attribute, NULL),
|
||||
ATTR_SPEC (NULL, 0, 0, false, false, false, false, NULL, NULL),
|
||||
};
|
||||
|
||||
/* Table of D language attributes exposed by `gcc.attribute' UDAs. */
|
||||
const attribute_spec d_langhook_attribute_table[] =
|
||||
{
|
||||
ATTR_SPEC ("noinline", 0, 0, true, false, false, false,
|
||||
d_handle_noinline_attribute, attr_noinline_exclusions),
|
||||
ATTR_SPEC ("forceinline", 0, 0, true, false, false, false,
|
||||
d_handle_forceinline_attribute, attr_inline_exclusions),
|
||||
ATTR_SPEC ("flatten", 0, 0, true, false, false, false,
|
||||
d_handle_flatten_attribute, NULL),
|
||||
ATTR_SPEC ("target", 1, -1, true, false, false, false,
|
||||
d_handle_target_attribute, NULL),
|
||||
ATTR_SPEC ("noclone", 0, 0, true, false, false, false,
|
||||
d_handle_noclone_attribute, NULL),
|
||||
ATTR_SPEC ("section", 1, 1, true, false, false, false,
|
||||
d_handle_section_attribute, NULL),
|
||||
ATTR_SPEC ("alias", 1, 1, true, false, false, false,
|
||||
d_handle_alias_attribute, NULL),
|
||||
ATTR_SPEC ("weak", 0, 0, true, false, false, false,
|
||||
d_handle_weak_attribute, NULL),
|
||||
ATTR_SPEC (NULL, 0, 0, false, false, false, false, NULL, NULL),
|
||||
};
|
||||
|
||||
|
||||
/* Insert the type attribute ATTRNAME with value VALUE into TYPE.
|
||||
Returns a new variant of the original type declaration. */
|
||||
|
||||
tree
|
||||
insert_type_attribute (tree type, const char *attrname, tree value)
|
||||
{
|
||||
tree ident = get_identifier (attrname);
|
||||
|
||||
if (value)
|
||||
value = tree_cons (NULL_TREE, value, NULL_TREE);
|
||||
|
||||
tree attribs = merge_attributes (TYPE_ATTRIBUTES (type),
|
||||
tree_cons (ident, value, NULL_TREE));
|
||||
|
||||
return build_type_attribute_variant (type, attribs);
|
||||
}
|
||||
|
||||
/* Insert the decl attribute ATTRNAME with value VALUE into DECL. */
|
||||
|
||||
tree
|
||||
insert_decl_attribute (tree decl, const char *attrname, tree value)
|
||||
{
|
||||
tree ident = get_identifier (attrname);
|
||||
|
||||
if (value)
|
||||
value = tree_cons (NULL_TREE, value, NULL_TREE);
|
||||
|
||||
tree attribs = merge_attributes (DECL_ATTRIBUTES (decl),
|
||||
tree_cons (ident, value, NULL_TREE));
|
||||
|
||||
return build_decl_attribute_variant (decl, attribs);
|
||||
}
|
||||
|
||||
/* Returns TRUE if NAME is an attribute recognized as being handled by
|
||||
the `gcc.attribute' module. */
|
||||
|
||||
static bool
|
||||
uda_attribute_p (const char *name)
|
||||
{
|
||||
tree ident = get_identifier (name);
|
||||
|
||||
/* Search both our language, and target attribute tables.
|
||||
Common and format attributes are kept internal. */
|
||||
for (const attribute_spec *p = d_langhook_attribute_table; p->name; p++)
|
||||
{
|
||||
if (get_identifier (p->name) == ident)
|
||||
return true;
|
||||
}
|
||||
|
||||
for (const attribute_spec *p = targetm.attribute_table; p->name; p++)
|
||||
{
|
||||
if (get_identifier (p->name) == ident)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* [attribute/uda]
|
||||
|
||||
User Defined Attributes (UDA) are compile time expressions that can be
|
||||
attached to a declaration. These attributes can then be queried, extracted,
|
||||
and manipulated at compile-time. There is no run-time component to them.
|
||||
|
||||
Expand and merge all UDAs found in the EATTRS list that are of type
|
||||
`gcc.attribute.Attribute'. This symbol is internally recognized by the
|
||||
compiler and maps them to their equivalent GCC attribute. */
|
||||
|
||||
tree
|
||||
build_attributes (Expressions *eattrs)
|
||||
{
|
||||
if (!eattrs)
|
||||
return NULL_TREE;
|
||||
|
||||
expandTuples (eattrs);
|
||||
|
||||
tree attribs = NULL_TREE;
|
||||
|
||||
for (size_t i = 0; i < eattrs->dim; i++)
|
||||
{
|
||||
Expression *attr = (*eattrs)[i];
|
||||
Dsymbol *sym = attr->type->toDsymbol (0);
|
||||
|
||||
if (!sym)
|
||||
continue;
|
||||
|
||||
/* Attribute symbol must come from the `gcc.attribute' module. */
|
||||
Dsymbol *mod = (Dsymbol*) sym->getModule ();
|
||||
if (!(strcmp (mod->toChars (), "attribute") == 0
|
||||
&& mod->parent != NULL
|
||||
&& strcmp (mod->parent->toChars (), "gcc") == 0
|
||||
&& !mod->parent->parent))
|
||||
continue;
|
||||
|
||||
/* Get the result of the attribute if it hasn't already been folded. */
|
||||
if (attr->op == TOKcall)
|
||||
attr = attr->ctfeInterpret ();
|
||||
|
||||
/* Should now have a struct `Attribute("attrib", "value", ...)'
|
||||
initializer list. */
|
||||
gcc_assert (attr->op == TOKstructliteral);
|
||||
Expressions *elems = ((StructLiteralExp*) attr)->elements;
|
||||
Expression *e0 = (*elems)[0];
|
||||
|
||||
if (e0->op != TOKstring)
|
||||
{
|
||||
error ("expected string attribute, not %qs", e0->toChars ());
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
StringExp *se = (StringExp*) e0;
|
||||
gcc_assert (se->sz == 1);
|
||||
|
||||
/* Empty string attribute, just ignore it. */
|
||||
if (se->len == 0)
|
||||
continue;
|
||||
|
||||
/* Check if the attribute is recognized and handled.
|
||||
Done here to report the diagnostic at the right location. */
|
||||
const char *name = (const char *)(se->len ? se->string : "");
|
||||
if (!uda_attribute_p (name))
|
||||
{
|
||||
warning_at (make_location_t (e0->loc), OPT_Wattributes,
|
||||
"unknown attribute %qs", name);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
/* Chain all attribute arguments together. */
|
||||
tree args = NULL_TREE;
|
||||
|
||||
for (size_t j = 1; j < elems->dim; j++)
|
||||
{
|
||||
Expression *e = (*elems)[j];
|
||||
tree t;
|
||||
if (e->op == TOKstring && ((StringExp *) e)->sz == 1)
|
||||
{
|
||||
StringExp *s = (StringExp *) e;
|
||||
const char *string = (const char *)(s->len ? s->string : "");
|
||||
t = build_string (s->len, string);
|
||||
}
|
||||
else
|
||||
t = build_expr (e);
|
||||
|
||||
args = chainon (args, build_tree_list (0, t));
|
||||
}
|
||||
|
||||
tree list = build_tree_list (get_identifier (name), args);
|
||||
attribs = chainon (attribs, list);
|
||||
}
|
||||
|
||||
return attribs;
|
||||
}
|
||||
|
||||
/* Built-in attribute handlers. */
|
||||
|
||||
/* Handle a "noreturn" attribute; arguments as in
|
||||
struct attribute_spec.handler. */
|
||||
|
||||
static tree
|
||||
handle_noreturn_attribute (tree *node, tree ARG_UNUSED (name),
|
||||
tree ARG_UNUSED (args), int ARG_UNUSED (flags),
|
||||
bool * ARG_UNUSED (no_add_attrs))
|
||||
{
|
||||
tree type = TREE_TYPE (*node);
|
||||
|
||||
if (TREE_CODE (*node) == FUNCTION_DECL)
|
||||
TREE_THIS_VOLATILE (*node) = 1;
|
||||
else if (TREE_CODE (type) == POINTER_TYPE
|
||||
&& TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE)
|
||||
TREE_TYPE (*node)
|
||||
= build_pointer_type
|
||||
(build_type_variant (TREE_TYPE (type),
|
||||
TYPE_READONLY (TREE_TYPE (type)), 1));
|
||||
else
|
||||
gcc_unreachable ();
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Handle a "leaf" attribute; arguments as in
|
||||
struct attribute_spec.handler. */
|
||||
|
||||
static tree
|
||||
handle_leaf_attribute (tree *node, tree name,
|
||||
tree ARG_UNUSED (args),
|
||||
int ARG_UNUSED (flags), bool *no_add_attrs)
|
||||
{
|
||||
if (TREE_CODE (*node) != FUNCTION_DECL)
|
||||
{
|
||||
warning (OPT_Wattributes, "%qE attribute ignored", name);
|
||||
*no_add_attrs = true;
|
||||
}
|
||||
if (!TREE_PUBLIC (*node))
|
||||
{
|
||||
warning (OPT_Wattributes, "%qE attribute has no effect", name);
|
||||
*no_add_attrs = true;
|
||||
}
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Handle a "const" attribute; arguments as in
|
||||
struct attribute_spec.handler. */
|
||||
|
||||
static tree
|
||||
handle_const_attribute (tree *node, tree ARG_UNUSED (name),
|
||||
tree ARG_UNUSED (args), int ARG_UNUSED (flags),
|
||||
bool * ARG_UNUSED (no_add_attrs))
|
||||
{
|
||||
tree type = TREE_TYPE (*node);
|
||||
|
||||
if (TREE_CODE (*node) == FUNCTION_DECL)
|
||||
TREE_READONLY (*node) = 1;
|
||||
else if (TREE_CODE (type) == POINTER_TYPE
|
||||
&& TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE)
|
||||
TREE_TYPE (*node)
|
||||
= build_pointer_type
|
||||
(build_type_variant (TREE_TYPE (type), 1,
|
||||
TREE_THIS_VOLATILE (TREE_TYPE (type))));
|
||||
else
|
||||
gcc_unreachable ();
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Handle a "malloc" attribute; arguments as in
|
||||
struct attribute_spec.handler. */
|
||||
|
||||
tree
|
||||
handle_malloc_attribute (tree *node, tree ARG_UNUSED (name),
|
||||
tree ARG_UNUSED (args), int ARG_UNUSED (flags),
|
||||
bool * ARG_UNUSED (no_add_attrs))
|
||||
{
|
||||
gcc_assert (TREE_CODE (*node) == FUNCTION_DECL
|
||||
&& POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (*node))));
|
||||
DECL_IS_MALLOC (*node) = 1;
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Handle a "pure" attribute; arguments as in
|
||||
struct attribute_spec.handler. */
|
||||
|
||||
static tree
|
||||
handle_pure_attribute (tree *node, tree ARG_UNUSED (name),
|
||||
tree ARG_UNUSED (args), int ARG_UNUSED (flags),
|
||||
bool * ARG_UNUSED (no_add_attrs))
|
||||
{
|
||||
gcc_assert (TREE_CODE (*node) == FUNCTION_DECL);
|
||||
DECL_PURE_P (*node) = 1;
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Handle a "no vops" attribute; arguments as in
|
||||
struct attribute_spec.handler. */
|
||||
|
||||
static tree
|
||||
handle_novops_attribute (tree *node, tree ARG_UNUSED (name),
|
||||
tree ARG_UNUSED (args), int ARG_UNUSED (flags),
|
||||
bool * ARG_UNUSED (no_add_attrs))
|
||||
{
|
||||
gcc_assert (TREE_CODE (*node) == FUNCTION_DECL);
|
||||
DECL_IS_NOVOPS (*node) = 1;
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Helper for nonnull attribute handling; fetch the operand number
|
||||
from the attribute argument list. */
|
||||
|
||||
static bool
|
||||
get_nonnull_operand (tree arg_num_expr, unsigned HOST_WIDE_INT *valp)
|
||||
{
|
||||
/* Verify the arg number is a constant. */
|
||||
if (!tree_fits_uhwi_p (arg_num_expr))
|
||||
return false;
|
||||
|
||||
*valp = TREE_INT_CST_LOW (arg_num_expr);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Handle the "nonnull" attribute. */
|
||||
|
||||
static tree
|
||||
handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name),
|
||||
tree args, int ARG_UNUSED (flags),
|
||||
bool * ARG_UNUSED (no_add_attrs))
|
||||
{
|
||||
tree type = *node;
|
||||
|
||||
/* If no arguments are specified, all pointer arguments should be
|
||||
non-null. Verify a full prototype is given so that the arguments
|
||||
will have the correct types when we actually check them later.
|
||||
Avoid diagnosing type-generic built-ins since those have no
|
||||
prototype. */
|
||||
if (!args)
|
||||
{
|
||||
gcc_assert (prototype_p (type)
|
||||
|| !TYPE_ATTRIBUTES (type)
|
||||
|| lookup_attribute ("type generic", TYPE_ATTRIBUTES (type)));
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Argument list specified. Verify that each argument number references
|
||||
a pointer argument. */
|
||||
for (; args; args = TREE_CHAIN (args))
|
||||
{
|
||||
tree argument;
|
||||
unsigned HOST_WIDE_INT arg_num = 0, ck_num;
|
||||
|
||||
if (!get_nonnull_operand (TREE_VALUE (args), &arg_num))
|
||||
gcc_unreachable ();
|
||||
|
||||
argument = TYPE_ARG_TYPES (type);
|
||||
if (argument)
|
||||
{
|
||||
for (ck_num = 1; ; ck_num++)
|
||||
{
|
||||
if (!argument || ck_num == arg_num)
|
||||
break;
|
||||
argument = TREE_CHAIN (argument);
|
||||
}
|
||||
|
||||
gcc_assert (argument
|
||||
&& TREE_CODE (TREE_VALUE (argument)) == POINTER_TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Handle a "nothrow" attribute; arguments as in
|
||||
struct attribute_spec.handler. */
|
||||
|
||||
static tree
|
||||
handle_nothrow_attribute (tree *node, tree ARG_UNUSED (name),
|
||||
tree ARG_UNUSED (args), int ARG_UNUSED (flags),
|
||||
bool * ARG_UNUSED (no_add_attrs))
|
||||
{
|
||||
gcc_assert (TREE_CODE (*node) == FUNCTION_DECL);
|
||||
TREE_NOTHROW (*node) = 1;
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Handle a "type_generic" attribute. */
|
||||
|
||||
static tree
|
||||
handle_type_generic_attribute (tree *node, tree ARG_UNUSED (name),
|
||||
tree ARG_UNUSED (args), int ARG_UNUSED (flags),
|
||||
bool * ARG_UNUSED (no_add_attrs))
|
||||
{
|
||||
/* Ensure we have a function type. */
|
||||
gcc_assert (TREE_CODE (*node) == FUNCTION_TYPE);
|
||||
|
||||
/* Ensure we have a variadic function. */
|
||||
gcc_assert (!prototype_p (*node) || stdarg_p (*node));
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Handle a "transaction_pure" attribute. */
|
||||
|
||||
static tree
|
||||
handle_transaction_pure_attribute (tree *node, tree ARG_UNUSED (name),
|
||||
tree ARG_UNUSED (args),
|
||||
int ARG_UNUSED (flags),
|
||||
bool * ARG_UNUSED (no_add_attrs))
|
||||
{
|
||||
/* Ensure we have a function type. */
|
||||
gcc_assert (TREE_CODE (*node) == FUNCTION_TYPE);
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Handle a "returns_twice" attribute. */
|
||||
|
||||
static tree
|
||||
handle_returns_twice_attribute (tree *node, tree ARG_UNUSED (name),
|
||||
tree ARG_UNUSED (args),
|
||||
int ARG_UNUSED (flags),
|
||||
bool * ARG_UNUSED (no_add_attrs))
|
||||
{
|
||||
gcc_assert (TREE_CODE (*node) == FUNCTION_DECL);
|
||||
|
||||
DECL_IS_RETURNS_TWICE (*node) = 1;
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Handle a "fn spec" attribute; arguments as in
|
||||
struct attribute_spec.handler. */
|
||||
|
||||
tree
|
||||
handle_fnspec_attribute (tree *node ATTRIBUTE_UNUSED, tree ARG_UNUSED (name),
|
||||
tree args, int ARG_UNUSED (flags),
|
||||
bool *no_add_attrs ATTRIBUTE_UNUSED)
|
||||
{
|
||||
gcc_assert (args
|
||||
&& TREE_CODE (TREE_VALUE (args)) == STRING_CST
|
||||
&& !TREE_CHAIN (args));
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Language specific attribute handlers. */
|
||||
|
||||
/* Handle a "noinline" attribute. */
|
||||
|
||||
static tree
|
||||
d_handle_noinline_attribute (tree *node, tree name,
|
||||
tree ARG_UNUSED (args),
|
||||
int ARG_UNUSED (flags), bool *no_add_attrs)
|
||||
{
|
||||
Type *t = TYPE_LANG_FRONTEND (TREE_TYPE (*node));
|
||||
|
||||
if (t->ty == Tfunction)
|
||||
DECL_UNINLINABLE (*node) = 1;
|
||||
else
|
||||
{
|
||||
warning (OPT_Wattributes, "%qE attribute ignored", name);
|
||||
*no_add_attrs = true;
|
||||
}
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Handle a "forceinline" attribute. */
|
||||
|
||||
static tree
|
||||
d_handle_forceinline_attribute (tree *node, tree name,
|
||||
tree ARG_UNUSED (args),
|
||||
int ARG_UNUSED (flags),
|
||||
bool *no_add_attrs)
|
||||
{
|
||||
Type *t = TYPE_LANG_FRONTEND (TREE_TYPE (*node));
|
||||
|
||||
if (t->ty == Tfunction)
|
||||
{
|
||||
tree attributes = DECL_ATTRIBUTES (*node);
|
||||
|
||||
/* Push attribute always_inline. */
|
||||
if (! lookup_attribute ("always_inline", attributes))
|
||||
DECL_ATTRIBUTES (*node) = tree_cons (get_identifier ("always_inline"),
|
||||
NULL_TREE, attributes);
|
||||
|
||||
DECL_DECLARED_INLINE_P (*node) = 1;
|
||||
DECL_NO_INLINE_WARNING_P (*node) = 1;
|
||||
DECL_DISREGARD_INLINE_LIMITS (*node) = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
warning (OPT_Wattributes, "%qE attribute ignored", name);
|
||||
*no_add_attrs = true;
|
||||
}
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Handle a "flatten" attribute. */
|
||||
|
||||
static tree
|
||||
d_handle_flatten_attribute (tree *node, tree name,
|
||||
tree args ATTRIBUTE_UNUSED,
|
||||
int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
|
||||
{
|
||||
Type *t = TYPE_LANG_FRONTEND (TREE_TYPE (*node));
|
||||
|
||||
if (t->ty != Tfunction)
|
||||
{
|
||||
warning (OPT_Wattributes, "%qE attribute ignored", name);
|
||||
*no_add_attrs = true;
|
||||
}
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Handle a "target" attribute. */
|
||||
|
||||
static tree
|
||||
d_handle_target_attribute (tree *node, tree name, tree args, int flags,
|
||||
bool *no_add_attrs)
|
||||
{
|
||||
Type *t = TYPE_LANG_FRONTEND (TREE_TYPE (*node));
|
||||
|
||||
/* Ensure we have a function type. */
|
||||
if (t->ty != Tfunction)
|
||||
{
|
||||
warning (OPT_Wattributes, "%qE attribute ignored", name);
|
||||
*no_add_attrs = true;
|
||||
}
|
||||
else if (! targetm.target_option.valid_attribute_p (*node, name, args, flags))
|
||||
*no_add_attrs = true;
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Handle a "noclone" attribute. */
|
||||
|
||||
static tree
|
||||
d_handle_noclone_attribute (tree *node, tree name,
|
||||
tree ARG_UNUSED (args),
|
||||
int ARG_UNUSED (flags),
|
||||
bool *no_add_attrs)
|
||||
{
|
||||
Type *t = TYPE_LANG_FRONTEND (TREE_TYPE (*node));
|
||||
|
||||
if (t->ty == Tfunction)
|
||||
{
|
||||
tree attributes = DECL_ATTRIBUTES (*node);
|
||||
|
||||
/* Push attribute noclone. */
|
||||
if (! lookup_attribute ("noclone", attributes))
|
||||
DECL_ATTRIBUTES (*node) = tree_cons (get_identifier ("noclone"),
|
||||
NULL_TREE, attributes);
|
||||
}
|
||||
else
|
||||
{
|
||||
warning (OPT_Wattributes, "%qE attribute ignored", name);
|
||||
*no_add_attrs = true;
|
||||
}
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Handle a "section" attribute; arguments as in
|
||||
struct attribute_spec.handler. */
|
||||
|
||||
static tree
|
||||
d_handle_section_attribute (tree *node, tree ARG_UNUSED (name), tree args,
|
||||
int ARG_UNUSED (flags), bool *no_add_attrs)
|
||||
{
|
||||
tree decl = *node;
|
||||
|
||||
if (targetm_common.have_named_sections)
|
||||
{
|
||||
if (VAR_OR_FUNCTION_DECL_P (decl)
|
||||
&& TREE_CODE (TREE_VALUE (args)) == STRING_CST)
|
||||
{
|
||||
if (VAR_P (decl)
|
||||
&& current_function_decl != NULL_TREE
|
||||
&& !TREE_STATIC (decl))
|
||||
{
|
||||
error_at (DECL_SOURCE_LOCATION (decl),
|
||||
"section attribute cannot be specified for "
|
||||
"local variables");
|
||||
*no_add_attrs = true;
|
||||
}
|
||||
|
||||
/* The decl may have already been given a section attribute
|
||||
from a previous declaration. Ensure they match. */
|
||||
else if (DECL_SECTION_NAME (decl) != NULL
|
||||
&& strcmp (DECL_SECTION_NAME (decl),
|
||||
TREE_STRING_POINTER (TREE_VALUE (args))) != 0)
|
||||
{
|
||||
error ("section of %q+D conflicts with previous declaration",
|
||||
*node);
|
||||
*no_add_attrs = true;
|
||||
}
|
||||
else if (VAR_P (decl)
|
||||
&& !targetm.have_tls && targetm.emutls.tmpl_section
|
||||
&& DECL_THREAD_LOCAL_P (decl))
|
||||
{
|
||||
error ("section of %q+D cannot be overridden", *node);
|
||||
*no_add_attrs = true;
|
||||
}
|
||||
else
|
||||
set_decl_section_name (decl,
|
||||
TREE_STRING_POINTER (TREE_VALUE (args)));
|
||||
}
|
||||
else
|
||||
{
|
||||
error ("section attribute not allowed for %q+D", *node);
|
||||
*no_add_attrs = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error_at (DECL_SOURCE_LOCATION (*node),
|
||||
"section attributes are not supported for this target");
|
||||
*no_add_attrs = true;
|
||||
}
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Handle an "alias" attribute; arguments as in
|
||||
struct attribute_spec.handler. */
|
||||
|
||||
static tree
|
||||
d_handle_alias_attribute (tree *node, tree ARG_UNUSED (name),
|
||||
tree args, int ARG_UNUSED (flags),
|
||||
bool *no_add_attrs ATTRIBUTE_UNUSED)
|
||||
{
|
||||
tree decl = *node;
|
||||
|
||||
if (TREE_CODE (decl) != FUNCTION_DECL
|
||||
&& TREE_CODE (decl) != VAR_DECL)
|
||||
{
|
||||
warning (OPT_Wattributes, "%qE attribute ignored", name);
|
||||
*no_add_attrs = true;
|
||||
return NULL_TREE;
|
||||
}
|
||||
else if ((TREE_CODE (decl) == FUNCTION_DECL && DECL_INITIAL (decl))
|
||||
|| (TREE_CODE (decl) != FUNCTION_DECL
|
||||
&& TREE_PUBLIC (decl) && !DECL_EXTERNAL (decl))
|
||||
/* A static variable declaration is always a tentative definition,
|
||||
but the alias is a non-tentative definition which overrides. */
|
||||
|| (TREE_CODE (decl) != FUNCTION_DECL
|
||||
&& ! TREE_PUBLIC (decl) && DECL_INITIAL (decl)))
|
||||
{
|
||||
error ("%q+D defined both normally and as %qE attribute", decl, name);
|
||||
*no_add_attrs = true;
|
||||
return NULL_TREE;
|
||||
}
|
||||
else if (decl_function_context (decl))
|
||||
{
|
||||
error ("%q+D alias functions must be global", name);
|
||||
*no_add_attrs = true;
|
||||
return NULL_TREE;
|
||||
}
|
||||
else
|
||||
{
|
||||
tree id;
|
||||
|
||||
id = TREE_VALUE (args);
|
||||
if (TREE_CODE (id) != STRING_CST)
|
||||
{
|
||||
error ("attribute %qE argument not a string", name);
|
||||
*no_add_attrs = true;
|
||||
return NULL_TREE;
|
||||
}
|
||||
id = get_identifier (TREE_STRING_POINTER (id));
|
||||
/* This counts as a use of the object pointed to. */
|
||||
TREE_USED (id) = 1;
|
||||
|
||||
if (TREE_CODE (decl) == FUNCTION_DECL)
|
||||
DECL_INITIAL (decl) = error_mark_node;
|
||||
else
|
||||
TREE_STATIC (decl) = 1;
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Handle a "weak" attribute; arguments as in
|
||||
struct attribute_spec.handler. */
|
||||
|
||||
static tree
|
||||
d_handle_weak_attribute (tree *node, tree name,
|
||||
tree ARG_UNUSED (args),
|
||||
int ARG_UNUSED (flags),
|
||||
bool * ARG_UNUSED (no_add_attrs))
|
||||
{
|
||||
if (TREE_CODE (*node) == FUNCTION_DECL
|
||||
&& DECL_DECLARED_INLINE_P (*node))
|
||||
{
|
||||
warning (OPT_Wattributes, "inline function %q+D declared weak", *node);
|
||||
*no_add_attrs = true;
|
||||
}
|
||||
else if (VAR_OR_FUNCTION_DECL_P (*node))
|
||||
{
|
||||
struct symtab_node *n = symtab_node::get (*node);
|
||||
if (n && n->refuse_visibility_changes)
|
||||
error ("%q+D declared weak after being used", *node);
|
||||
declare_weak (*node);
|
||||
}
|
||||
else
|
||||
warning (OPT_Wattributes, "%qE attribute ignored", name);
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
1169
gcc/d/d-builtins.cc
Normal file
1169
gcc/d/d-builtins.cc
Normal file
File diff suppressed because it is too large
Load Diff
2660
gcc/d/d-codegen.cc
Normal file
2660
gcc/d/d-codegen.cc
Normal file
File diff suppressed because it is too large
Load Diff
805
gcc/d/d-convert.cc
Normal file
805
gcc/d/d-convert.cc
Normal file
@ -0,0 +1,805 @@
|
||||
/* d-convert.cc -- Data type conversion routines.
|
||||
Copyright (C) 2006-2018 Free Software Foundation, Inc.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
|
||||
#include "dmd/aggregate.h"
|
||||
#include "dmd/declaration.h"
|
||||
#include "dmd/expression.h"
|
||||
#include "dmd/mtype.h"
|
||||
|
||||
#include "tree.h"
|
||||
#include "fold-const.h"
|
||||
#include "diagnostic.h"
|
||||
#include "langhooks.h"
|
||||
#include "target.h"
|
||||
#include "convert.h"
|
||||
#include "stor-layout.h"
|
||||
|
||||
#include "d-tree.h"
|
||||
|
||||
|
||||
/* Build CODE expression with operands OP0 and OP1.
|
||||
Helper function for d_truthvalue_conversion, so assumes bool result. */
|
||||
|
||||
static tree
|
||||
d_build_truthvalue_op (tree_code code, tree op0, tree op1)
|
||||
{
|
||||
tree type0, type1;
|
||||
|
||||
tree result_type = NULL_TREE;
|
||||
|
||||
type0 = TREE_TYPE (op0);
|
||||
type1 = TREE_TYPE (op1);
|
||||
|
||||
/* Strip NON_LVALUE_EXPRs, etc., since we aren't using as an lvalue. */
|
||||
STRIP_TYPE_NOPS (op0);
|
||||
STRIP_TYPE_NOPS (op1);
|
||||
|
||||
/* Also need to convert pointer/int comparison. */
|
||||
if (POINTER_TYPE_P (type0) && TREE_CODE (op1) == INTEGER_CST
|
||||
&& integer_zerop (op1))
|
||||
{
|
||||
result_type = type0;
|
||||
}
|
||||
else if (POINTER_TYPE_P (type1) && TREE_CODE (op0) == INTEGER_CST
|
||||
&& integer_zerop (op0))
|
||||
{
|
||||
result_type = type1;
|
||||
}
|
||||
/* If integral, need to convert unsigned/signed comparison.
|
||||
Will also need to convert if type precisions differ. */
|
||||
else if (INTEGRAL_TYPE_P (type0) && INTEGRAL_TYPE_P (type1))
|
||||
{
|
||||
if (TYPE_PRECISION (type0) > TYPE_PRECISION (type1))
|
||||
result_type = type0;
|
||||
else if (TYPE_PRECISION (type0) < TYPE_PRECISION (type1))
|
||||
result_type = type1;
|
||||
else if (TYPE_UNSIGNED (type0) != TYPE_UNSIGNED (type1))
|
||||
result_type = TYPE_UNSIGNED (type0) ? type0 : type1;
|
||||
}
|
||||
|
||||
if (result_type)
|
||||
{
|
||||
if (TREE_TYPE (op0) != result_type)
|
||||
op0 = convert (result_type, op0);
|
||||
if (TREE_TYPE (op1) != result_type)
|
||||
op1 = convert (result_type, op1);
|
||||
}
|
||||
|
||||
return fold_build2 (code, d_bool_type, op0, op1);
|
||||
}
|
||||
|
||||
/* Return whether EXPR is a declaration whose address can never be NULL. */
|
||||
|
||||
bool
|
||||
decl_with_nonnull_addr_p (const_tree expr)
|
||||
{
|
||||
return (DECL_P (expr)
|
||||
&& (TREE_CODE (expr) == PARM_DECL
|
||||
|| TREE_CODE (expr) == LABEL_DECL
|
||||
|| !DECL_WEAK (expr)));
|
||||
}
|
||||
|
||||
/* Convert EXPR to be a truth-value, validating its type for this purpose. */
|
||||
|
||||
tree
|
||||
d_truthvalue_conversion (tree expr)
|
||||
{
|
||||
switch (TREE_CODE (expr))
|
||||
{
|
||||
case EQ_EXPR: case NE_EXPR: case LE_EXPR:
|
||||
case GE_EXPR: case LT_EXPR: case GT_EXPR:
|
||||
if (TREE_TYPE (expr) == d_bool_type)
|
||||
return expr;
|
||||
return build2 (TREE_CODE (expr), d_bool_type,
|
||||
TREE_OPERAND (expr, 0), TREE_OPERAND (expr, 1));
|
||||
|
||||
case TRUTH_ANDIF_EXPR:
|
||||
case TRUTH_ORIF_EXPR:
|
||||
case TRUTH_AND_EXPR:
|
||||
case TRUTH_OR_EXPR:
|
||||
case TRUTH_XOR_EXPR:
|
||||
if (TREE_TYPE (expr) == d_bool_type)
|
||||
return expr;
|
||||
return build2 (TREE_CODE (expr), d_bool_type,
|
||||
d_truthvalue_conversion (TREE_OPERAND (expr, 0)),
|
||||
d_truthvalue_conversion (TREE_OPERAND (expr, 1)));
|
||||
|
||||
case TRUTH_NOT_EXPR:
|
||||
if (TREE_TYPE (expr) == d_bool_type)
|
||||
return expr;
|
||||
return build1 (TREE_CODE (expr), d_bool_type,
|
||||
d_truthvalue_conversion (TREE_OPERAND (expr, 0)));
|
||||
|
||||
case ERROR_MARK:
|
||||
return expr;
|
||||
|
||||
case INTEGER_CST:
|
||||
return integer_zerop (expr) ? boolean_false_node
|
||||
: boolean_true_node;
|
||||
|
||||
case REAL_CST:
|
||||
return real_compare (NE_EXPR, &TREE_REAL_CST (expr), &dconst0)
|
||||
? boolean_true_node
|
||||
: boolean_false_node;
|
||||
|
||||
case ADDR_EXPR:
|
||||
/* If we are taking the address of a decl that can never be null,
|
||||
then the return result is always true. */
|
||||
if (decl_with_nonnull_addr_p (TREE_OPERAND (expr, 0)))
|
||||
{
|
||||
warning (OPT_Waddress,
|
||||
"the address of %qD will always evaluate as %<true%>",
|
||||
TREE_OPERAND (expr, 0));
|
||||
return boolean_true_node;
|
||||
}
|
||||
break;
|
||||
|
||||
case COMPLEX_EXPR:
|
||||
return d_build_truthvalue_op ((TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 1))
|
||||
? TRUTH_OR_EXPR : TRUTH_ORIF_EXPR),
|
||||
d_truthvalue_conversion (TREE_OPERAND (expr, 0)),
|
||||
d_truthvalue_conversion (TREE_OPERAND (expr, 1)));
|
||||
|
||||
case NEGATE_EXPR:
|
||||
case ABS_EXPR:
|
||||
case FLOAT_EXPR:
|
||||
/* These don't change whether an object is nonzero or zero. */
|
||||
return d_truthvalue_conversion (TREE_OPERAND (expr, 0));
|
||||
|
||||
case LROTATE_EXPR:
|
||||
case RROTATE_EXPR:
|
||||
/* These don't change whether an object is zero or nonzero, but
|
||||
we can't ignore them if their second arg has side-effects. */
|
||||
if (TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 1)))
|
||||
{
|
||||
return build2 (COMPOUND_EXPR, d_bool_type, TREE_OPERAND (expr, 1),
|
||||
d_truthvalue_conversion (TREE_OPERAND (expr, 0)));
|
||||
}
|
||||
else
|
||||
return d_truthvalue_conversion (TREE_OPERAND (expr, 0));
|
||||
|
||||
case COND_EXPR:
|
||||
/* Distribute the conversion into the arms of a COND_EXPR. */
|
||||
return fold_build3 (COND_EXPR, d_bool_type, TREE_OPERAND (expr, 0),
|
||||
d_truthvalue_conversion (TREE_OPERAND (expr, 1)),
|
||||
d_truthvalue_conversion (TREE_OPERAND (expr, 2)));
|
||||
|
||||
case CONVERT_EXPR:
|
||||
/* Don't cancel the effect of a CONVERT_EXPR from a REFERENCE_TYPE,
|
||||
since that affects how `default_conversion' will behave. */
|
||||
if (TREE_CODE (TREE_TYPE (expr)) == REFERENCE_TYPE
|
||||
|| TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) == REFERENCE_TYPE)
|
||||
break;
|
||||
/* Fall through. */
|
||||
|
||||
case NOP_EXPR:
|
||||
/* If this isn't narrowing the argument, we can ignore it. */
|
||||
if (TYPE_PRECISION (TREE_TYPE (expr))
|
||||
>= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (expr, 0))))
|
||||
return d_truthvalue_conversion (TREE_OPERAND (expr, 0));
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (TREE_CODE (TREE_TYPE (expr)) == COMPLEX_TYPE)
|
||||
{
|
||||
tree t = save_expr (expr);
|
||||
return d_build_truthvalue_op ((TREE_SIDE_EFFECTS (expr)
|
||||
? TRUTH_OR_EXPR : TRUTH_ORIF_EXPR),
|
||||
d_truthvalue_conversion (real_part (t)),
|
||||
d_truthvalue_conversion (imaginary_part (t)));
|
||||
}
|
||||
else
|
||||
return d_build_truthvalue_op (NE_EXPR, expr,
|
||||
build_zero_cst (TREE_TYPE (expr)));
|
||||
}
|
||||
|
||||
|
||||
/* Creates an expression whose value is that of EXPR, converted to type TYPE.
|
||||
This function implements all reasonable scalar conversions. */
|
||||
|
||||
tree
|
||||
convert (tree type, tree expr)
|
||||
{
|
||||
tree e = expr;
|
||||
tree_code code = TREE_CODE (type);
|
||||
|
||||
if (type == error_mark_node
|
||||
|| expr == error_mark_node
|
||||
|| TREE_TYPE (expr) == error_mark_node)
|
||||
return error_mark_node;
|
||||
|
||||
const char *invalid_conv_diag
|
||||
= targetm.invalid_conversion (TREE_TYPE (expr), type);
|
||||
|
||||
if (invalid_conv_diag)
|
||||
{
|
||||
error ("%s", invalid_conv_diag);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
if (type == TREE_TYPE (expr))
|
||||
return expr;
|
||||
|
||||
if (TREE_CODE (type) == ARRAY_TYPE
|
||||
&& TREE_CODE (TREE_TYPE (expr)) == ARRAY_TYPE
|
||||
&& TYPE_DOMAIN (type) == TYPE_DOMAIN (TREE_TYPE (expr)))
|
||||
return expr;
|
||||
|
||||
tree ret = targetm.convert_to_type (type, expr);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
STRIP_TYPE_NOPS (e);
|
||||
tree etype = TREE_TYPE (e);
|
||||
|
||||
if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (TREE_TYPE (expr)))
|
||||
return fold_convert (type, expr);
|
||||
if (TREE_CODE (TREE_TYPE (expr)) == ERROR_MARK)
|
||||
return error_mark_node;
|
||||
if (TREE_CODE (TREE_TYPE (expr)) == VOID_TYPE)
|
||||
{
|
||||
error ("void value not ignored as it ought to be");
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
switch (code)
|
||||
{
|
||||
case VOID_TYPE:
|
||||
return fold_convert (type, e);
|
||||
|
||||
case INTEGER_TYPE:
|
||||
case ENUMERAL_TYPE:
|
||||
if (TREE_CODE (etype) == POINTER_TYPE
|
||||
|| TREE_CODE (etype) == REFERENCE_TYPE)
|
||||
{
|
||||
if (integer_zerop (e))
|
||||
return build_int_cst (type, 0);
|
||||
|
||||
/* Convert to an unsigned integer of the correct width first, and
|
||||
from there widen/truncate to the required type. */
|
||||
tree utype = lang_hooks.types.type_for_size (TYPE_PRECISION (etype),
|
||||
1);
|
||||
ret = fold_build1 (CONVERT_EXPR, utype, e);
|
||||
return fold_convert (type, ret);
|
||||
}
|
||||
|
||||
return fold (convert_to_integer (type, e));
|
||||
|
||||
case BOOLEAN_TYPE:
|
||||
return fold_convert (type, d_truthvalue_conversion (expr));
|
||||
|
||||
case POINTER_TYPE:
|
||||
case REFERENCE_TYPE:
|
||||
return fold (convert_to_pointer (type, e));
|
||||
|
||||
case REAL_TYPE:
|
||||
if (TREE_CODE (etype) == COMPLEX_TYPE && TYPE_IMAGINARY_FLOAT (type))
|
||||
e = build1 (IMAGPART_EXPR, TREE_TYPE (etype), e);
|
||||
|
||||
return fold (convert_to_real (type, e));
|
||||
|
||||
case COMPLEX_TYPE:
|
||||
if (TREE_CODE (etype) == REAL_TYPE && TYPE_IMAGINARY_FLOAT (etype))
|
||||
return fold_build2 (COMPLEX_EXPR, type,
|
||||
build_zero_cst (TREE_TYPE (type)),
|
||||
convert (TREE_TYPE (type), expr));
|
||||
|
||||
return fold (convert_to_complex (type, e));
|
||||
|
||||
case VECTOR_TYPE:
|
||||
return fold (convert_to_vector (type, e));
|
||||
|
||||
case RECORD_TYPE:
|
||||
case UNION_TYPE:
|
||||
if (lang_hooks.types_compatible_p (type, TREE_TYPE (expr)))
|
||||
return fold_build1 (VIEW_CONVERT_EXPR, type, expr);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
error ("conversion to non-scalar type requested");
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
/* Return expression EXP, whose type has been converted to TYPE. */
|
||||
|
||||
tree
|
||||
d_convert (tree type, tree exp)
|
||||
{
|
||||
/* Check this first before retrieving frontend type. */
|
||||
if (error_operand_p (type) || error_operand_p (exp))
|
||||
return error_mark_node;
|
||||
|
||||
Type *totype = TYPE_LANG_FRONTEND (type);
|
||||
Type *etype = TYPE_LANG_FRONTEND (TREE_TYPE (exp));
|
||||
|
||||
if (totype && etype)
|
||||
return convert_expr (exp, etype, totype);
|
||||
|
||||
return convert (type, exp);
|
||||
}
|
||||
|
||||
/* Return expression EXP, whose type has been convert from ETYPE to TOTYPE. */
|
||||
|
||||
tree
|
||||
convert_expr (tree exp, Type *etype, Type *totype)
|
||||
{
|
||||
tree result = NULL_TREE;
|
||||
|
||||
gcc_assert (etype && totype);
|
||||
Type *ebtype = etype->toBasetype ();
|
||||
Type *tbtype = totype->toBasetype ();
|
||||
|
||||
if (same_type_p (etype, totype))
|
||||
return exp;
|
||||
|
||||
if (error_operand_p (exp))
|
||||
return exp;
|
||||
|
||||
switch (ebtype->ty)
|
||||
{
|
||||
case Tdelegate:
|
||||
if (tbtype->ty == Tdelegate)
|
||||
{
|
||||
exp = d_save_expr (exp);
|
||||
return build_delegate_cst (delegate_method (exp),
|
||||
delegate_object (exp), totype);
|
||||
}
|
||||
else if (tbtype->ty == Tpointer)
|
||||
{
|
||||
/* The front-end converts <delegate>.ptr to cast (void *)<delegate>.
|
||||
Maybe should only allow void* ? */
|
||||
exp = delegate_object (exp);
|
||||
}
|
||||
else
|
||||
{
|
||||
error ("can't convert a delegate expression to %qs",
|
||||
totype->toChars ());
|
||||
return error_mark_node;
|
||||
}
|
||||
break;
|
||||
|
||||
case Tstruct:
|
||||
if (tbtype->ty == Tstruct)
|
||||
{
|
||||
if (totype->size () == etype->size ())
|
||||
{
|
||||
/* Allowed to cast to structs with same type size. */
|
||||
result = build_vconvert (build_ctype (totype), exp);
|
||||
}
|
||||
else
|
||||
{
|
||||
error ("can't convert struct %qs to %qs",
|
||||
etype->toChars (), totype->toChars ());
|
||||
return error_mark_node;
|
||||
}
|
||||
}
|
||||
/* else, default conversion, which should produce an error. */
|
||||
break;
|
||||
|
||||
case Tclass:
|
||||
if (tbtype->ty == Tclass)
|
||||
{
|
||||
ClassDeclaration *cdfrom = ebtype->isClassHandle ();
|
||||
ClassDeclaration *cdto = tbtype->isClassHandle ();
|
||||
int offset;
|
||||
|
||||
if (cdto->isBaseOf (cdfrom, &offset) && offset != OFFSET_RUNTIME)
|
||||
{
|
||||
/* Casting up the inheritance tree: Don't do anything special.
|
||||
Cast to an implemented interface: Handle at compile-time. */
|
||||
if (offset)
|
||||
{
|
||||
/* Forward references should not leak from the frontend. */
|
||||
gcc_assert (offset != OFFSET_FWDREF);
|
||||
|
||||
tree type = build_ctype (totype);
|
||||
exp = d_save_expr (exp);
|
||||
|
||||
tree cond = build_boolop (NE_EXPR, exp, null_pointer_node);
|
||||
tree object = build_offset (exp, size_int (offset));
|
||||
|
||||
return build_condition (build_ctype (totype), cond,
|
||||
build_nop (type, object),
|
||||
build_nop (type, null_pointer_node));
|
||||
}
|
||||
|
||||
/* d_convert will make a no-op cast. */
|
||||
break;
|
||||
}
|
||||
else if (cdfrom->isCPPclass ())
|
||||
{
|
||||
/* Downcasting in C++ is a no-op. */
|
||||
if (cdto->isCPPclass ())
|
||||
break;
|
||||
|
||||
/* Casting from a C++ interface to a class/non-C++ interface
|
||||
always results in null as there is no run-time information,
|
||||
and no way one can derive from the other. */
|
||||
warning (OPT_Wcast_result, "cast to %qs will produce null result",
|
||||
totype->toChars ());
|
||||
result = d_convert (build_ctype (totype), null_pointer_node);
|
||||
|
||||
/* Make sure the expression is still evaluated if necessary. */
|
||||
if (TREE_SIDE_EFFECTS (exp))
|
||||
result = compound_expr (exp, result);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
/* The offset can only be determined at run-time, do dynamic cast. */
|
||||
libcall_fn libcall = cdfrom->isInterfaceDeclaration ()
|
||||
? LIBCALL_INTERFACE_CAST : LIBCALL_DYNAMIC_CAST;
|
||||
|
||||
return build_libcall (libcall, totype, 2, exp,
|
||||
build_address (get_classinfo_decl (cdto)));
|
||||
}
|
||||
/* else default conversion. */
|
||||
break;
|
||||
|
||||
case Tsarray:
|
||||
if (tbtype->ty == Tpointer)
|
||||
{
|
||||
result = build_nop (build_ctype (totype), build_address (exp));
|
||||
}
|
||||
else if (tbtype->ty == Tarray)
|
||||
{
|
||||
dinteger_t dim = ((TypeSArray *) ebtype)->dim->toInteger ();
|
||||
dinteger_t esize = ebtype->nextOf ()->size ();
|
||||
dinteger_t tsize = tbtype->nextOf ()->size ();
|
||||
|
||||
tree ptrtype = build_ctype (tbtype->nextOf ()->pointerTo ());
|
||||
|
||||
if ((dim * esize) % tsize != 0)
|
||||
{
|
||||
error ("cannot cast %qs to %qs since sizes don't line up",
|
||||
etype->toChars (), totype->toChars ());
|
||||
return error_mark_node;
|
||||
}
|
||||
dim = (dim * esize) / tsize;
|
||||
|
||||
/* Assumes casting to dynamic array of same type or void. */
|
||||
return d_array_value (build_ctype (totype), size_int (dim),
|
||||
build_nop (ptrtype, build_address (exp)));
|
||||
}
|
||||
else if (tbtype->ty == Tsarray)
|
||||
{
|
||||
/* D allows casting a static array to any static array type. */
|
||||
return build_nop (build_ctype (totype), exp);
|
||||
}
|
||||
else if (tbtype->ty == Tstruct)
|
||||
{
|
||||
/* And allows casting a static array to any struct type too.
|
||||
Type sizes should have already been checked by the frontend. */
|
||||
gcc_assert (totype->size () == etype->size ());
|
||||
result = build_vconvert (build_ctype (totype), exp);
|
||||
}
|
||||
else
|
||||
{
|
||||
error ("cannot cast expression of type %qs to type %qs",
|
||||
etype->toChars (), totype->toChars ());
|
||||
return error_mark_node;
|
||||
}
|
||||
break;
|
||||
|
||||
case Tarray:
|
||||
if (tbtype->ty == Tpointer)
|
||||
{
|
||||
return d_convert (build_ctype (totype), d_array_ptr (exp));
|
||||
}
|
||||
else if (tbtype->ty == Tarray)
|
||||
{
|
||||
/* Assume tvoid->size() == 1. */
|
||||
d_uns64 fsize = ebtype->nextOf ()->toBasetype ()->size ();
|
||||
d_uns64 tsize = tbtype->nextOf ()->toBasetype ()->size ();
|
||||
|
||||
if (fsize != tsize)
|
||||
{
|
||||
/* Conversion requires a reinterpret cast of array. */
|
||||
return build_libcall (LIBCALL_ARRAYCAST, totype, 3,
|
||||
size_int (tsize), size_int (fsize), exp);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Convert from void[] or elements are the same size
|
||||
-- don't change length. */
|
||||
return build_vconvert (build_ctype (totype), exp);
|
||||
}
|
||||
}
|
||||
else if (tbtype->ty == Tsarray)
|
||||
{
|
||||
/* Strings are treated as dynamic arrays in D2. */
|
||||
if (ebtype->isString () && tbtype->isString ())
|
||||
return indirect_ref (build_ctype (totype), d_array_ptr (exp));
|
||||
}
|
||||
else
|
||||
{
|
||||
error ("cannot cast expression of type %qs to %qs",
|
||||
etype->toChars (), totype->toChars ());
|
||||
return error_mark_node;
|
||||
}
|
||||
break;
|
||||
|
||||
case Taarray:
|
||||
if (tbtype->ty == Taarray)
|
||||
return build_vconvert (build_ctype (totype), exp);
|
||||
/* Can convert associative arrays to void pointers. */
|
||||
else if (tbtype->ty == Tpointer && tbtype->nextOf ()->ty == Tvoid)
|
||||
return build_vconvert (build_ctype (totype), exp);
|
||||
/* Else, default conversion, which should product an error. */
|
||||
break;
|
||||
|
||||
case Tpointer:
|
||||
/* Can convert void pointers to associative arrays too. */
|
||||
if (tbtype->ty == Taarray && ebtype->nextOf ()->ty == Tvoid)
|
||||
return build_vconvert (build_ctype (totype), exp);
|
||||
break;
|
||||
|
||||
case Tnull:
|
||||
/* Casting from typeof(null) is represented as all zeros. */
|
||||
if (tbtype->ty == Tarray)
|
||||
{
|
||||
tree ptrtype = build_ctype (tbtype->nextOf ()->pointerTo ());
|
||||
return d_array_value (build_ctype (totype), size_int (0),
|
||||
build_nop (ptrtype, exp));
|
||||
}
|
||||
else if (tbtype->ty == Taarray)
|
||||
return build_constructor (build_ctype (totype), NULL);
|
||||
else if (tbtype->ty == Tdelegate)
|
||||
return build_delegate_cst (exp, null_pointer_node, totype);
|
||||
|
||||
return build_zero_cst (build_ctype (totype));
|
||||
|
||||
case Tvector:
|
||||
if (tbtype->ty == Tsarray)
|
||||
{
|
||||
if (tbtype->size () == ebtype->size ())
|
||||
return build_vconvert (build_ctype (totype), exp);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/* All casts between imaginary and non-imaginary result in 0.0,
|
||||
except for casts between complex and imaginary types. */
|
||||
if (!ebtype->iscomplex () && !tbtype->iscomplex ()
|
||||
&& (ebtype->isimaginary () != tbtype->isimaginary ()))
|
||||
{
|
||||
warning (OPT_Wcast_result,
|
||||
"cast from %qs to %qs will produce zero result",
|
||||
ebtype->toChars (), tbtype->toChars ());
|
||||
|
||||
return compound_expr (exp, build_zero_cst (build_ctype (tbtype)));
|
||||
}
|
||||
|
||||
exp = fold_convert (build_ctype (etype), exp);
|
||||
gcc_assert (TREE_CODE (exp) != STRING_CST);
|
||||
break;
|
||||
}
|
||||
|
||||
return result ? result : convert (build_ctype (totype), exp);
|
||||
}
|
||||
|
||||
|
||||
/* Apply semantics of assignment to a value of type TOTYPE to EXPR
|
||||
(e.g., pointer = array -> pointer = &array[0])
|
||||
|
||||
Return a TREE representation of EXPR implicitly converted to TOTYPE
|
||||
for use in assignment expressions MODIFY_EXPR, INIT_EXPR. */
|
||||
|
||||
tree
|
||||
convert_for_assignment (tree expr, Type *etype, Type *totype)
|
||||
{
|
||||
Type *ebtype = etype->toBasetype ();
|
||||
Type *tbtype = totype->toBasetype ();
|
||||
|
||||
/* Assuming this only has to handle converting a non Tsarray type to
|
||||
arbitrarily dimensioned Tsarrays. */
|
||||
if (tbtype->ty == Tsarray)
|
||||
{
|
||||
Type *telem = tbtype->nextOf ()->baseElemOf ();
|
||||
|
||||
if (same_type_p (telem, ebtype))
|
||||
{
|
||||
TypeSArray *sa_type = (TypeSArray *) tbtype;
|
||||
uinteger_t count = sa_type->dim->toUInteger ();
|
||||
|
||||
tree ctor = build_constructor (build_ctype (totype), NULL);
|
||||
if (count)
|
||||
{
|
||||
vec<constructor_elt, va_gc> *ce = NULL;
|
||||
tree index = build2 (RANGE_EXPR, build_ctype (Type::tsize_t),
|
||||
size_zero_node, size_int (count - 1));
|
||||
tree value = convert_for_assignment (expr, etype, sa_type->next);
|
||||
|
||||
/* Can't use VAR_DECLs in CONSTRUCTORS. */
|
||||
if (VAR_P (value))
|
||||
{
|
||||
value = DECL_INITIAL (value);
|
||||
gcc_assert (value);
|
||||
}
|
||||
|
||||
CONSTRUCTOR_APPEND_ELT (ce, index, value);
|
||||
CONSTRUCTOR_ELTS (ctor) = ce;
|
||||
}
|
||||
TREE_READONLY (ctor) = 1;
|
||||
TREE_CONSTANT (ctor) = 1;
|
||||
return ctor;
|
||||
}
|
||||
}
|
||||
|
||||
/* D Front end uses IntegerExp(0) to mean zero-init an array or structure. */
|
||||
if ((tbtype->ty == Tsarray || tbtype->ty == Tstruct)
|
||||
&& ebtype->isintegral ())
|
||||
{
|
||||
if (!integer_zerop (expr))
|
||||
gcc_unreachable ();
|
||||
|
||||
return expr;
|
||||
}
|
||||
|
||||
return convert_expr (expr, etype, totype);
|
||||
}
|
||||
|
||||
/* Return a TREE representation of EXPR converted to represent
|
||||
the parameter type ARG. */
|
||||
|
||||
tree
|
||||
convert_for_argument (tree expr, Parameter *arg)
|
||||
{
|
||||
/* Lazy arguments: expr should already be a delegate. */
|
||||
if (arg->storageClass & STClazy)
|
||||
return expr;
|
||||
|
||||
if (valist_array_p (arg->type))
|
||||
{
|
||||
/* Do nothing if the va_list has already been decayed to a pointer. */
|
||||
if (!POINTER_TYPE_P (TREE_TYPE (expr)))
|
||||
return build_address (expr);
|
||||
}
|
||||
else if (argument_reference_p (arg))
|
||||
{
|
||||
/* Front-end shouldn't automatically take the address. */
|
||||
return convert (type_passed_as (arg), build_address (expr));
|
||||
}
|
||||
|
||||
return expr;
|
||||
}
|
||||
|
||||
/* Perform default promotions for data used in expressions.
|
||||
Arrays and functions are converted to pointers;
|
||||
enumeral types or short or char, to int.
|
||||
In addition, manifest constants symbols are replaced by their values.
|
||||
|
||||
Return truth-value conversion of expression EXPR from value type TYPE. */
|
||||
|
||||
tree
|
||||
convert_for_condition (tree expr, Type *type)
|
||||
{
|
||||
tree result = NULL_TREE;
|
||||
|
||||
switch (type->toBasetype ()->ty)
|
||||
{
|
||||
case Taarray:
|
||||
/* Checks that aa.ptr !is null. */
|
||||
result = component_ref (expr, TYPE_FIELDS (TREE_TYPE (expr)));
|
||||
break;
|
||||
|
||||
case Tarray:
|
||||
{
|
||||
/* Checks (arr.length || arr.ptr) (i.e arr !is null). */
|
||||
expr = d_save_expr (expr);
|
||||
tree len = d_array_length (expr);
|
||||
tree ptr = d_array_ptr (expr);
|
||||
if (TYPE_MODE (TREE_TYPE (len)) == TYPE_MODE (TREE_TYPE (ptr)))
|
||||
{
|
||||
result = build2 (BIT_IOR_EXPR, TREE_TYPE (len), len,
|
||||
d_convert (TREE_TYPE (len), ptr));
|
||||
}
|
||||
else
|
||||
{
|
||||
len = d_truthvalue_conversion (len);
|
||||
ptr = d_truthvalue_conversion (ptr);
|
||||
/* Probably not worth using TRUTH_OROR here. */
|
||||
result = build2 (TRUTH_OR_EXPR, TREE_TYPE (len), len, ptr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case Tdelegate:
|
||||
{
|
||||
/* Checks (function || object), but what good is it if there is
|
||||
a null function pointer? */
|
||||
tree obj, func;
|
||||
if (METHOD_CALL_EXPR (expr))
|
||||
extract_from_method_call (expr, obj, func);
|
||||
else
|
||||
{
|
||||
expr = d_save_expr (expr);
|
||||
obj = delegate_object (expr);
|
||||
func = delegate_method (expr);
|
||||
}
|
||||
|
||||
obj = d_truthvalue_conversion (obj);
|
||||
func = d_truthvalue_conversion (func);
|
||||
/* Probably not worth using TRUTH_ORIF here. */
|
||||
result = build2 (BIT_IOR_EXPR, TREE_TYPE (obj), obj, func);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
result = expr;
|
||||
break;
|
||||
}
|
||||
|
||||
return d_truthvalue_conversion (result);
|
||||
}
|
||||
|
||||
|
||||
/* Convert EXP to a dynamic array.
|
||||
EXP must be a static array or dynamic array. */
|
||||
|
||||
tree
|
||||
d_array_convert (Expression *exp)
|
||||
{
|
||||
Type *tb = exp->type->toBasetype ();
|
||||
|
||||
if (tb->ty == Tarray)
|
||||
return build_expr (exp);
|
||||
|
||||
if (tb->ty == Tsarray)
|
||||
{
|
||||
Type *totype = tb->nextOf ()->arrayOf ();
|
||||
return convert_expr (build_expr (exp), exp->type, totype);
|
||||
}
|
||||
|
||||
/* Invalid type passed. */
|
||||
gcc_unreachable ();
|
||||
}
|
||||
|
||||
/* Convert EXP to a dynamic array, where ETYPE is the element type.
|
||||
Similar to above, except that EXP is allowed to be an element of an array.
|
||||
Temporary variables that need some kind of BIND_EXPR are pushed to VARS. */
|
||||
|
||||
tree
|
||||
d_array_convert (Type *etype, Expression *exp, vec<tree, va_gc> **vars)
|
||||
{
|
||||
Type *tb = exp->type->toBasetype ();
|
||||
|
||||
if ((tb->ty != Tarray && tb->ty != Tsarray) || same_type_p (tb, etype))
|
||||
{
|
||||
/* Convert single element to an array. */
|
||||
tree var = NULL_TREE;
|
||||
tree expr = maybe_temporary_var (build_expr (exp), &var);
|
||||
|
||||
if (var != NULL_TREE)
|
||||
vec_safe_push (*vars, var);
|
||||
|
||||
return d_array_value (build_ctype (exp->type->arrayOf ()),
|
||||
size_int (1), build_address (expr));
|
||||
}
|
||||
else
|
||||
return d_array_convert (exp);
|
||||
}
|
358
gcc/d/d-diagnostic.cc
Normal file
358
gcc/d/d-diagnostic.cc
Normal file
@ -0,0 +1,358 @@
|
||||
/* d-diagnostics.cc -- D frontend interface to gcc diagnostics.
|
||||
Copyright (C) 2017-2018 Free Software Foundation, Inc.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
|
||||
#include "dmd/globals.h"
|
||||
#include "dmd/errors.h"
|
||||
|
||||
#include "tree.h"
|
||||
#include "options.h"
|
||||
#include "diagnostic.h"
|
||||
|
||||
#include "d-tree.h"
|
||||
|
||||
|
||||
/* Rewrite the format string FORMAT to deal with any format extensions not
|
||||
supported by pp_format().
|
||||
|
||||
The following format specifiers are handled:
|
||||
`...`: text within backticks gets quoted as '%<...%>'.
|
||||
%-10s: left-justify format flag is removed leaving '%s' remaining.
|
||||
%02x: zero-padding format flag is removed leaving '%x' remaining.
|
||||
%X: uppercase unsigned hexadecimals are rewritten as '%x'.
|
||||
|
||||
The result should be freed by the caller. */
|
||||
|
||||
static char *
|
||||
expand_d_format (const char *format)
|
||||
{
|
||||
OutBuffer buf;
|
||||
bool inbacktick = false;
|
||||
|
||||
for (const char *p = format; *p;)
|
||||
{
|
||||
while (*p != '\0' && *p != '%' && *p != '`')
|
||||
{
|
||||
buf.writeByte (*p);
|
||||
p++;
|
||||
}
|
||||
|
||||
if (*p == '\0')
|
||||
break;
|
||||
|
||||
if (*p == '`')
|
||||
{
|
||||
/* Text enclosed by `...` are translated as a quoted string. */
|
||||
if (inbacktick)
|
||||
{
|
||||
buf.writestring ("%>");
|
||||
inbacktick = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
buf.writestring ("%<");
|
||||
inbacktick = true;
|
||||
}
|
||||
p++;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Check the conversion specification for unhandled flags. */
|
||||
buf.writeByte (*p);
|
||||
p++;
|
||||
|
||||
Lagain:
|
||||
switch (*p)
|
||||
{
|
||||
case '\0':
|
||||
/* Malformed format string. */
|
||||
gcc_unreachable ();
|
||||
|
||||
case '-':
|
||||
/* Remove whitespace formatting. */
|
||||
p++;
|
||||
while (ISDIGIT (*p))
|
||||
p++;
|
||||
goto Lagain;
|
||||
|
||||
case '0':
|
||||
/* Remove zero padding from format string. */
|
||||
while (ISDIGIT (*p))
|
||||
p++;
|
||||
goto Lagain;
|
||||
|
||||
case 'X':
|
||||
/* Hex format only supports lower-case. */
|
||||
buf.writeByte ('x');
|
||||
p++;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gcc_assert (!inbacktick);
|
||||
return buf.extractString ();
|
||||
}
|
||||
|
||||
/* Helper routine for all error routines. Reports a diagnostic specified by
|
||||
KIND at the explicit location LOC. The message FORMAT comes from the dmd
|
||||
front-end, which does not get translated by the gcc diagnostic routines. */
|
||||
|
||||
static void ATTRIBUTE_GCC_DIAG(3,0)
|
||||
d_diagnostic_report_diagnostic (const Loc& loc, int opt, const char *format,
|
||||
va_list ap, diagnostic_t kind, bool verbatim)
|
||||
{
|
||||
va_list argp;
|
||||
va_copy (argp, ap);
|
||||
|
||||
if (loc.filename || !verbatim)
|
||||
{
|
||||
rich_location rich_loc (line_table, make_location_t (loc));
|
||||
diagnostic_info diagnostic;
|
||||
char *xformat = expand_d_format (format);
|
||||
|
||||
diagnostic_set_info_translated (&diagnostic, xformat, &argp,
|
||||
&rich_loc, kind);
|
||||
if (opt != 0)
|
||||
diagnostic.option_index = opt;
|
||||
|
||||
diagnostic_report_diagnostic (global_dc, &diagnostic);
|
||||
free (xformat);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Write verbatim messages with no location direct to stream. */
|
||||
text_info text;
|
||||
text.err_no = errno;
|
||||
text.args_ptr = &argp;
|
||||
text.format_spec = expand_d_format (format);
|
||||
text.x_data = NULL;
|
||||
|
||||
pp_format_verbatim (global_dc->printer, &text);
|
||||
pp_newline_and_flush (global_dc->printer);
|
||||
}
|
||||
|
||||
va_end (argp);
|
||||
}
|
||||
|
||||
/* Print a hard error message with explicit location LOC with an optional
|
||||
message prefix PREFIX1 and PREFIX2, increasing the global or gagged
|
||||
error count. */
|
||||
|
||||
void ATTRIBUTE_GCC_DIAG(2,3)
|
||||
error (const Loc& loc, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start (ap, format);
|
||||
verror (loc, format, ap);
|
||||
va_end (ap);
|
||||
}
|
||||
|
||||
void ATTRIBUTE_GCC_DIAG(2,0)
|
||||
verror (const Loc& loc, const char *format, va_list ap,
|
||||
const char *prefix1, const char *prefix2, const char *)
|
||||
{
|
||||
if (!global.gag || global.params.showGaggedErrors)
|
||||
{
|
||||
char *xformat;
|
||||
|
||||
/* Build string and emit. */
|
||||
if (prefix2 != NULL)
|
||||
xformat = xasprintf ("%s %s %s", prefix1, prefix2, format);
|
||||
else if (prefix1 != NULL)
|
||||
xformat = xasprintf ("%s %s", prefix1, format);
|
||||
else
|
||||
xformat = xasprintf ("%s", format);
|
||||
|
||||
d_diagnostic_report_diagnostic (loc, 0, xformat, ap,
|
||||
global.gag ? DK_ANACHRONISM : DK_ERROR,
|
||||
false);
|
||||
free (xformat);
|
||||
}
|
||||
|
||||
if (global.gag)
|
||||
global.gaggedErrors++;
|
||||
|
||||
global.errors++;
|
||||
}
|
||||
|
||||
/* Print supplementary message about the last error with explicit location LOC.
|
||||
This doesn't increase the global error count. */
|
||||
|
||||
void ATTRIBUTE_GCC_DIAG(2,3)
|
||||
errorSupplemental (const Loc& loc, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start (ap, format);
|
||||
verrorSupplemental (loc, format, ap);
|
||||
va_end (ap);
|
||||
}
|
||||
|
||||
void ATTRIBUTE_GCC_DIAG(2,0)
|
||||
verrorSupplemental (const Loc& loc, const char *format, va_list ap)
|
||||
{
|
||||
if (global.gag && !global.params.showGaggedErrors)
|
||||
return;
|
||||
|
||||
d_diagnostic_report_diagnostic (loc, 0, format, ap, DK_NOTE, false);
|
||||
}
|
||||
|
||||
/* Print a warning message with explicit location LOC, increasing the
|
||||
global warning count. */
|
||||
|
||||
void ATTRIBUTE_GCC_DIAG(2,3)
|
||||
warning (const Loc& loc, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start (ap, format);
|
||||
vwarning (loc, format, ap);
|
||||
va_end (ap);
|
||||
}
|
||||
|
||||
void ATTRIBUTE_GCC_DIAG(2,0)
|
||||
vwarning (const Loc& loc, const char *format, va_list ap)
|
||||
{
|
||||
if (!global.gag && global.params.warnings != DIAGNOSTICoff)
|
||||
{
|
||||
/* Warnings don't count if not treated as errors. */
|
||||
if (global.params.warnings == DIAGNOSTICerror)
|
||||
global.warnings++;
|
||||
|
||||
d_diagnostic_report_diagnostic (loc, 0, format, ap, DK_WARNING, false);
|
||||
}
|
||||
}
|
||||
|
||||
/* Print supplementary message about the last warning with explicit location
|
||||
LOC. This doesn't increase the global warning count. */
|
||||
|
||||
void ATTRIBUTE_GCC_DIAG(2,3)
|
||||
warningSupplemental (const Loc& loc, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start (ap, format);
|
||||
vwarningSupplemental (loc, format, ap);
|
||||
va_end (ap);
|
||||
}
|
||||
|
||||
void ATTRIBUTE_GCC_DIAG(2,0)
|
||||
vwarningSupplemental (const Loc& loc, const char *format, va_list ap)
|
||||
{
|
||||
if (global.params.warnings == DIAGNOSTICoff || global.gag)
|
||||
return;
|
||||
|
||||
d_diagnostic_report_diagnostic (loc, 0, format, ap, DK_NOTE, false);
|
||||
}
|
||||
|
||||
/* Print a deprecation message with explicit location LOC with an optional
|
||||
message prefix PREFIX1 and PREFIX2, increasing the global warning or
|
||||
error count depending on how deprecations are treated. */
|
||||
|
||||
void ATTRIBUTE_GCC_DIAG(2,3)
|
||||
deprecation (const Loc& loc, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start (ap, format);
|
||||
vdeprecation (loc, format, ap);
|
||||
va_end (ap);
|
||||
}
|
||||
|
||||
void ATTRIBUTE_GCC_DIAG(2,0)
|
||||
vdeprecation (const Loc& loc, const char *format, va_list ap,
|
||||
const char *prefix1, const char *prefix2)
|
||||
{
|
||||
if (global.params.useDeprecated == DIAGNOSTICerror)
|
||||
verror (loc, format, ap, prefix1, prefix2);
|
||||
else if (global.params.useDeprecated == DIAGNOSTICinform && !global.gag)
|
||||
{
|
||||
char *xformat;
|
||||
|
||||
/* Build string and emit. */
|
||||
if (prefix2 != NULL)
|
||||
xformat = xasprintf ("%s %s %s", prefix1, prefix2, format);
|
||||
else if (prefix1 != NULL)
|
||||
xformat = xasprintf ("%s %s", prefix1, format);
|
||||
else
|
||||
xformat = xasprintf ("%s", format);
|
||||
|
||||
d_diagnostic_report_diagnostic (loc, OPT_Wdeprecated, xformat, ap,
|
||||
DK_WARNING, false);
|
||||
free (xformat);
|
||||
}
|
||||
}
|
||||
|
||||
/* Print supplementary message about the last deprecation with explicit
|
||||
location LOC. This does not increase the global error count. */
|
||||
|
||||
void ATTRIBUTE_GCC_DIAG(2,3)
|
||||
deprecationSupplemental (const Loc& loc, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start (ap, format);
|
||||
vdeprecationSupplemental (loc, format, ap);
|
||||
va_end (ap);
|
||||
}
|
||||
|
||||
void ATTRIBUTE_GCC_DIAG(2,0)
|
||||
vdeprecationSupplemental (const Loc& loc, const char *format, va_list ap)
|
||||
{
|
||||
if (global.params.useDeprecated == DIAGNOSTICerror)
|
||||
verrorSupplemental (loc, format, ap);
|
||||
else if (global.params.useDeprecated == DIAGNOSTICinform && !global.gag)
|
||||
d_diagnostic_report_diagnostic (loc, 0, format, ap, DK_NOTE, false);
|
||||
}
|
||||
|
||||
/* Print a verbose message with explicit location LOC. */
|
||||
|
||||
void ATTRIBUTE_GCC_DIAG(2, 3)
|
||||
message (const Loc& loc, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start (ap, format);
|
||||
vmessage (loc, format, ap);
|
||||
va_end (ap);
|
||||
}
|
||||
|
||||
void ATTRIBUTE_GCC_DIAG(2,0)
|
||||
vmessage (const Loc& loc, const char *format, va_list ap)
|
||||
{
|
||||
d_diagnostic_report_diagnostic (loc, 0, format, ap, DK_NOTE, true);
|
||||
}
|
||||
|
||||
/* Same as above, but doesn't take a location argument. */
|
||||
|
||||
void ATTRIBUTE_GCC_DIAG(1, 2)
|
||||
message (const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start (ap, format);
|
||||
vmessage (Loc (), format, ap);
|
||||
va_end (ap);
|
||||
}
|
||||
|
||||
/* Call this after printing out fatal error messages to clean up and
|
||||
exit the compiler. */
|
||||
|
||||
void
|
||||
fatal (void)
|
||||
{
|
||||
exit (FATAL_EXIT_CODE);
|
||||
}
|
628
gcc/d/d-frontend.cc
Normal file
628
gcc/d/d-frontend.cc
Normal file
@ -0,0 +1,628 @@
|
||||
/* d-frontend.cc -- D frontend interface to the gcc back-end.
|
||||
Copyright (C) 2013-2018 Free Software Foundation, Inc.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
|
||||
#include "dmd/aggregate.h"
|
||||
#include "dmd/compiler.h"
|
||||
#include "dmd/declaration.h"
|
||||
#include "dmd/errors.h"
|
||||
#include "dmd/expression.h"
|
||||
#include "dmd/identifier.h"
|
||||
#include "dmd/module.h"
|
||||
#include "dmd/mtype.h"
|
||||
#include "dmd/scope.h"
|
||||
#include "dmd/statement.h"
|
||||
#include "dmd/target.h"
|
||||
|
||||
#include "tree.h"
|
||||
#include "options.h"
|
||||
#include "fold-const.h"
|
||||
#include "diagnostic.h"
|
||||
#include "stor-layout.h"
|
||||
|
||||
#include "d-tree.h"
|
||||
|
||||
|
||||
/* Implements the Global interface defined by the frontend.
|
||||
Used for managing the state of the current compilation. */
|
||||
|
||||
Global global;
|
||||
|
||||
void
|
||||
Global::_init (void)
|
||||
{
|
||||
this->mars_ext = "d";
|
||||
this->hdr_ext = "di";
|
||||
this->doc_ext = "html";
|
||||
this->ddoc_ext = "ddoc";
|
||||
this->json_ext = "json";
|
||||
this->obj_ext = "o";
|
||||
|
||||
this->run_noext = true;
|
||||
this->version = "v"
|
||||
#include "verstr.h"
|
||||
;
|
||||
|
||||
this->stdmsg = stderr;
|
||||
this->errorLimit = flag_max_errors;
|
||||
}
|
||||
|
||||
/* Start gagging. Return the current number of gagged errors. */
|
||||
|
||||
unsigned
|
||||
Global::startGagging (void)
|
||||
{
|
||||
this->gag++;
|
||||
return this->gaggedErrors;
|
||||
}
|
||||
|
||||
/* End gagging, restoring the old gagged state. Return true if errors
|
||||
occured while gagged. */
|
||||
|
||||
bool
|
||||
Global::endGagging (unsigned oldGagged)
|
||||
{
|
||||
bool anyErrs = (this->gaggedErrors != oldGagged);
|
||||
this->gag--;
|
||||
|
||||
/* Restore the original state of gagged errors; set total errors
|
||||
to be original errors + new ungagged errors. */
|
||||
this->errors -= (this->gaggedErrors - oldGagged);
|
||||
this->gaggedErrors = oldGagged;
|
||||
|
||||
return anyErrs;
|
||||
}
|
||||
|
||||
/* Increment the error count to record that an error has occured in the
|
||||
current context. An error message may or may not have been printed. */
|
||||
|
||||
void
|
||||
Global::increaseErrorCount (void)
|
||||
{
|
||||
if (gag)
|
||||
this->gaggedErrors++;
|
||||
|
||||
this->errors++;
|
||||
}
|
||||
|
||||
|
||||
/* Implements the Loc interface defined by the frontend.
|
||||
Used for keeping track of current file/line position in code. */
|
||||
|
||||
Loc::Loc (const char *filename, unsigned linnum, unsigned charnum)
|
||||
{
|
||||
this->linnum = linnum;
|
||||
this->charnum = charnum;
|
||||
this->filename = filename;
|
||||
}
|
||||
|
||||
const char *
|
||||
Loc::toChars (void) const
|
||||
{
|
||||
OutBuffer buf;
|
||||
|
||||
if (this->filename)
|
||||
buf.printf ("%s", this->filename);
|
||||
|
||||
if (this->linnum)
|
||||
{
|
||||
buf.printf (":%u", this->linnum);
|
||||
if (this->charnum)
|
||||
buf.printf (":%u", this->charnum);
|
||||
}
|
||||
|
||||
return buf.extractString ();
|
||||
}
|
||||
|
||||
bool
|
||||
Loc::equals (const Loc& loc)
|
||||
{
|
||||
if (this->linnum != loc.linnum || this->charnum != loc.charnum)
|
||||
return false;
|
||||
|
||||
if (!FileName::equals (this->filename, loc.filename))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* Implements the Port interface defined by the frontend.
|
||||
A mini library for doing compiler/system specific things. */
|
||||
|
||||
/* Compare the first N bytes of S1 and S2 without regard to the case. */
|
||||
|
||||
int
|
||||
Port::memicmp (const char *s1, const char *s2, size_t n)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
for (size_t i = 0; i < n; i++)
|
||||
{
|
||||
char c1 = s1[i];
|
||||
char c2 = s2[i];
|
||||
|
||||
result = c1 - c2;
|
||||
if (result)
|
||||
{
|
||||
result = TOUPPER (c1) - TOUPPER (c2);
|
||||
if (result)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Convert all characters in S to uppercase. */
|
||||
|
||||
char *
|
||||
Port::strupr (char *s)
|
||||
{
|
||||
char *t = s;
|
||||
|
||||
while (*s)
|
||||
{
|
||||
*s = TOUPPER (*s);
|
||||
s++;
|
||||
}
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
/* Return true if the real_t value from string BUFFER overflows
|
||||
as a result of rounding down to float mode. */
|
||||
|
||||
bool
|
||||
Port::isFloat32LiteralOutOfRange (const char *buffer)
|
||||
{
|
||||
real_t r;
|
||||
|
||||
real_from_string3 (&r.rv (), buffer, TYPE_MODE (float_type_node));
|
||||
|
||||
return r == Target::RealProperties::infinity;
|
||||
}
|
||||
|
||||
/* Return true if the real_t value from string BUFFER overflows
|
||||
as a result of rounding down to double mode. */
|
||||
|
||||
bool
|
||||
Port::isFloat64LiteralOutOfRange (const char *buffer)
|
||||
{
|
||||
real_t r;
|
||||
|
||||
real_from_string3 (&r.rv (), buffer, TYPE_MODE (double_type_node));
|
||||
|
||||
return r == Target::RealProperties::infinity;
|
||||
}
|
||||
|
||||
/* Fetch a little-endian 16-bit value from BUFFER. */
|
||||
|
||||
unsigned
|
||||
Port::readwordLE (void *buffer)
|
||||
{
|
||||
unsigned char *p = (unsigned char*) buffer;
|
||||
|
||||
return ((unsigned) p[1] << 8) | (unsigned) p[0];
|
||||
}
|
||||
|
||||
/* Fetch a big-endian 16-bit value from BUFFER. */
|
||||
|
||||
unsigned
|
||||
Port::readwordBE (void *buffer)
|
||||
{
|
||||
unsigned char *p = (unsigned char*) buffer;
|
||||
|
||||
return ((unsigned) p[0] << 8) | (unsigned) p[1];
|
||||
}
|
||||
|
||||
/* Fetch a little-endian 32-bit value from BUFFER. */
|
||||
|
||||
unsigned
|
||||
Port::readlongLE (void *buffer)
|
||||
{
|
||||
unsigned char *p = (unsigned char*) buffer;
|
||||
|
||||
return (((unsigned) p[3] << 24)
|
||||
| ((unsigned) p[2] << 16)
|
||||
| ((unsigned) p[1] << 8)
|
||||
| (unsigned) p[0]);
|
||||
}
|
||||
|
||||
/* Fetch a big-endian 32-bit value from BUFFER. */
|
||||
|
||||
unsigned
|
||||
Port::readlongBE (void *buffer)
|
||||
{
|
||||
unsigned char *p = (unsigned char*) buffer;
|
||||
|
||||
return (((unsigned) p[0] << 24)
|
||||
| ((unsigned) p[1] << 16)
|
||||
| ((unsigned) p[2] << 8)
|
||||
| (unsigned) p[3]);
|
||||
}
|
||||
|
||||
/* Write an SZ-byte sized VALUE to BUFFER, ignoring endian-ness. */
|
||||
|
||||
void
|
||||
Port::valcpy (void *buffer, uint64_t value, size_t sz)
|
||||
{
|
||||
switch (sz)
|
||||
{
|
||||
case 1:
|
||||
*(uint8_t *) buffer = (uint8_t) value;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
*(uint16_t *) buffer = (uint16_t) value;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
*(uint32_t *) buffer = (uint32_t) value;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
*(uint64_t *) buffer = (uint64_t) value;
|
||||
break;
|
||||
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Implements the CTFloat interface defined by the frontend.
|
||||
Compile-time floating-pointer helper functions. */
|
||||
|
||||
/* Return the absolute value of R. */
|
||||
|
||||
real_t
|
||||
CTFloat::fabs (real_t r)
|
||||
{
|
||||
real_t x;
|
||||
real_arithmetic (&x.rv (), ABS_EXPR, &r.rv (), NULL);
|
||||
return x.normalize ();
|
||||
}
|
||||
|
||||
/* Return the value of R * 2 ^^ EXP. */
|
||||
|
||||
real_t
|
||||
CTFloat::ldexp (real_t r, int exp)
|
||||
{
|
||||
real_t x;
|
||||
real_ldexp (&x.rv (), &r.rv (), exp);
|
||||
return x.normalize ();
|
||||
}
|
||||
|
||||
/* Return true if longdouble value X is identical to Y. */
|
||||
|
||||
bool
|
||||
CTFloat::isIdentical (real_t x, real_t y)
|
||||
{
|
||||
real_value rx = x.rv ();
|
||||
real_value ry = y.rv ();
|
||||
return (REAL_VALUE_ISNAN (rx) && REAL_VALUE_ISNAN (ry))
|
||||
|| real_identical (&rx, &ry);
|
||||
}
|
||||
|
||||
/* Return true if real_t value R is NaN. */
|
||||
|
||||
bool
|
||||
CTFloat::isNaN (real_t r)
|
||||
{
|
||||
return REAL_VALUE_ISNAN (r.rv ());
|
||||
}
|
||||
|
||||
/* Same as isNaN, but also check if is signalling. */
|
||||
|
||||
bool
|
||||
CTFloat::isSNaN (real_t r)
|
||||
{
|
||||
return REAL_VALUE_ISSIGNALING_NAN (r.rv ());
|
||||
}
|
||||
|
||||
/* Return true if real_t value is +Inf. */
|
||||
|
||||
bool
|
||||
CTFloat::isInfinity (real_t r)
|
||||
{
|
||||
return REAL_VALUE_ISINF (r.rv ());
|
||||
}
|
||||
|
||||
/* Return a real_t value from string BUFFER rounded to long double mode. */
|
||||
|
||||
real_t
|
||||
CTFloat::parse (const char *buffer, bool *overflow)
|
||||
{
|
||||
real_t r;
|
||||
real_from_string3 (&r.rv (), buffer, TYPE_MODE (long_double_type_node));
|
||||
|
||||
/* Front-end checks overflow to see if the value is representable. */
|
||||
if (overflow && r == Target::RealProperties::infinity)
|
||||
*overflow = true;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Format the real_t value R to string BUFFER as a decimal or hexadecimal,
|
||||
converting the result to uppercase if FMT requests it. */
|
||||
|
||||
int
|
||||
CTFloat::sprint (char *buffer, char fmt, real_t r)
|
||||
{
|
||||
if (fmt == 'a' || fmt == 'A')
|
||||
{
|
||||
/* Converting to a hexadecimal string. */
|
||||
real_to_hexadecimal (buffer, &r.rv (), 32, 0, 1);
|
||||
int buflen;
|
||||
|
||||
switch (fmt)
|
||||
{
|
||||
case 'A':
|
||||
buflen = strlen (buffer);
|
||||
for (int i = 0; i < buflen; i++)
|
||||
buffer[i] = TOUPPER (buffer[i]);
|
||||
|
||||
return buflen;
|
||||
|
||||
case 'a':
|
||||
return strlen (buffer);
|
||||
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Note: restricting the precision of significant digits to 18. */
|
||||
real_to_decimal (buffer, &r.rv (), 32, 18, 1);
|
||||
return strlen (buffer);
|
||||
}
|
||||
}
|
||||
|
||||
/* Return a hash value for real_t value R. */
|
||||
|
||||
size_t
|
||||
CTFloat::hash (real_t r)
|
||||
{
|
||||
return real_hash (&r.rv ());
|
||||
}
|
||||
|
||||
/* Implements the Compiler interface used by the frontend. */
|
||||
|
||||
/* Generate C main() in response to seeing D main(). This used to be in
|
||||
libdruntime, but contained a reference to _Dmain which didn't work when
|
||||
druntime was made into a shared library and was linked to a program, such
|
||||
as a C++ program, that didn't have a _Dmain. */
|
||||
|
||||
void
|
||||
Compiler::genCmain (Scope *sc)
|
||||
{
|
||||
static bool initialized = false;
|
||||
|
||||
if (initialized)
|
||||
return;
|
||||
|
||||
/* The D code to be generated is provided by __entrypoint.di, try to load it,
|
||||
but don't fail if unfound. */
|
||||
unsigned errors = global.startGagging ();
|
||||
Module *m = Module::load (Loc (), NULL, Identifier::idPool ("__entrypoint"));
|
||||
|
||||
if (global.endGagging (errors))
|
||||
m = NULL;
|
||||
|
||||
if (m != NULL)
|
||||
{
|
||||
m->importedFrom = m;
|
||||
m->importAll (NULL);
|
||||
m->semantic (NULL);
|
||||
m->semantic2 (NULL);
|
||||
m->semantic3 (NULL);
|
||||
d_add_entrypoint_module (m, sc->_module);
|
||||
}
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
/* Perform a reinterpret cast of EXPR to type TYPE for use in CTFE.
|
||||
The front end should have already ensured that EXPR is a constant,
|
||||
so we just lower the value to GCC and return the converted CST. */
|
||||
|
||||
Expression *
|
||||
Compiler::paintAsType (Expression *expr, Type *type)
|
||||
{
|
||||
/* We support up to 512-bit values. */
|
||||
unsigned char buffer[64];
|
||||
tree cst;
|
||||
|
||||
Type *tb = type->toBasetype ();
|
||||
|
||||
if (expr->type->isintegral ())
|
||||
cst = build_integer_cst (expr->toInteger (), build_ctype (expr->type));
|
||||
else if (expr->type->isfloating ())
|
||||
cst = build_float_cst (expr->toReal (), expr->type);
|
||||
else if (expr->op == TOKarrayliteral)
|
||||
{
|
||||
/* Build array as VECTOR_CST, assumes EXPR is constant. */
|
||||
Expressions *elements = ((ArrayLiteralExp *) expr)->elements;
|
||||
vec<constructor_elt, va_gc> *elms = NULL;
|
||||
|
||||
vec_safe_reserve (elms, elements->dim);
|
||||
for (size_t i = 0; i < elements->dim; i++)
|
||||
{
|
||||
Expression *e = (*elements)[i];
|
||||
if (e->type->isintegral ())
|
||||
{
|
||||
tree value = build_integer_cst (e->toInteger (),
|
||||
build_ctype (e->type));
|
||||
CONSTRUCTOR_APPEND_ELT (elms, size_int (i), value);
|
||||
}
|
||||
else if (e->type->isfloating ())
|
||||
{
|
||||
tree value = build_float_cst (e->toReal (), e->type);
|
||||
CONSTRUCTOR_APPEND_ELT (elms, size_int (i), value);
|
||||
}
|
||||
else
|
||||
gcc_unreachable ();
|
||||
}
|
||||
|
||||
/* Build vector type. */
|
||||
int nunits = ((TypeSArray *) expr->type)->dim->toUInteger ();
|
||||
Type *telem = expr->type->nextOf ();
|
||||
tree vectype = build_vector_type (build_ctype (telem), nunits);
|
||||
|
||||
cst = build_vector_from_ctor (vectype, elms);
|
||||
}
|
||||
else
|
||||
gcc_unreachable ();
|
||||
|
||||
/* Encode CST to buffer. */
|
||||
int len = native_encode_expr (cst, buffer, sizeof (buffer));
|
||||
|
||||
if (tb->ty == Tsarray)
|
||||
{
|
||||
/* Interpret value as a vector of the same size,
|
||||
then return the array literal. */
|
||||
int nunits = ((TypeSArray *) type)->dim->toUInteger ();
|
||||
Type *elem = type->nextOf ();
|
||||
tree vectype = build_vector_type (build_ctype (elem), nunits);
|
||||
|
||||
cst = native_interpret_expr (vectype, buffer, len);
|
||||
|
||||
Expression *e = d_eval_constant_expression (cst);
|
||||
gcc_assert (e != NULL && e->op == TOKvector);
|
||||
|
||||
return ((VectorExp *) e)->e1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Normal interpret cast. */
|
||||
cst = native_interpret_expr (build_ctype (type), buffer, len);
|
||||
|
||||
Expression *e = d_eval_constant_expression (cst);
|
||||
gcc_assert (e != NULL);
|
||||
|
||||
return e;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check imported module M for any special processing.
|
||||
Modules we look out for are:
|
||||
- object: For D runtime type information.
|
||||
- gcc.builtins: For all gcc builtins.
|
||||
- core.stdc.*: For all gcc library builtins. */
|
||||
|
||||
void
|
||||
Compiler::loadModule (Module *m)
|
||||
{
|
||||
ModuleDeclaration *md = m->md;
|
||||
|
||||
if (!md || !md->id || !md->packages)
|
||||
{
|
||||
Identifier *id = (md && md->id) ? md->id : m->ident;
|
||||
if (!strcmp (id->toChars (), "object"))
|
||||
create_tinfo_types (m);
|
||||
}
|
||||
else if (md->packages->dim == 1)
|
||||
{
|
||||
if (!strcmp ((*md->packages)[0]->toChars (), "gcc")
|
||||
&& !strcmp (md->id->toChars (), "builtins"))
|
||||
d_build_builtins_module (m);
|
||||
}
|
||||
else if (md->packages->dim == 2)
|
||||
{
|
||||
if (!strcmp ((*md->packages)[0]->toChars (), "core")
|
||||
&& !strcmp ((*md->packages)[1]->toChars (), "stdc"))
|
||||
d_add_builtin_module (m);
|
||||
}
|
||||
}
|
||||
|
||||
/* Implements back-end specific interfaces used by the frontend. */
|
||||
|
||||
/* Determine return style of function - whether in registers or through a
|
||||
hidden pointer to the caller's stack. */
|
||||
|
||||
RET
|
||||
retStyle (TypeFunction *)
|
||||
{
|
||||
/* Need the backend type to determine this, but this is called from the
|
||||
frontend before semantic processing is finished. An accurate value
|
||||
is not currently needed anyway. */
|
||||
return RETstack;
|
||||
}
|
||||
|
||||
/* Determine if function FD is a builtin one that we can evaluate in CTFE. */
|
||||
|
||||
BUILTIN
|
||||
isBuiltin (FuncDeclaration *fd)
|
||||
{
|
||||
if (fd->builtin != BUILTINunknown)
|
||||
return fd->builtin;
|
||||
|
||||
maybe_set_intrinsic (fd);
|
||||
|
||||
return fd->builtin;
|
||||
}
|
||||
|
||||
/* Evaluate builtin D function FD whose argument list is ARGUMENTS.
|
||||
Return result; NULL if cannot evaluate it. */
|
||||
|
||||
Expression *
|
||||
eval_builtin (Loc loc, FuncDeclaration *fd, Expressions *arguments)
|
||||
{
|
||||
if (fd->builtin != BUILTINyes)
|
||||
return NULL;
|
||||
|
||||
tree decl = get_symbol_decl (fd);
|
||||
gcc_assert (fndecl_built_in_p (decl)
|
||||
|| DECL_INTRINSIC_CODE (decl) != INTRINSIC_NONE);
|
||||
|
||||
TypeFunction *tf = (TypeFunction *) fd->type;
|
||||
Expression *e = NULL;
|
||||
input_location = make_location_t (loc);
|
||||
|
||||
tree result = d_build_call (tf, decl, NULL, arguments);
|
||||
result = fold (result);
|
||||
|
||||
/* Builtin should be successfully evaluated.
|
||||
Will only return NULL if we can't convert it. */
|
||||
if (TREE_CONSTANT (result) && TREE_CODE (result) != CALL_EXPR)
|
||||
e = d_eval_constant_expression (result);
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
/* Build and return typeinfo type for TYPE. */
|
||||
|
||||
Type *
|
||||
getTypeInfoType (Type *type, Scope *sc)
|
||||
{
|
||||
gcc_assert (type->ty != Terror);
|
||||
create_typeinfo (type, sc ? sc->_module->importedFrom : NULL);
|
||||
return type->vtinfo->type;
|
||||
}
|
||||
|
||||
/* Return an inlined copy of a default argument for a function parameter. */
|
||||
|
||||
Expression *
|
||||
inlineCopy (Expression *e, Scope *)
|
||||
{
|
||||
return e->copy ();
|
||||
}
|
195
gcc/d/d-incpath.cc
Normal file
195
gcc/d/d-incpath.cc
Normal file
@ -0,0 +1,195 @@
|
||||
/* d-incpath.cc -- Set up combined import paths for the D frontend.
|
||||
Copyright (C) 2006-2018 Free Software Foundation, Inc.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
|
||||
#include "dmd/globals.h"
|
||||
|
||||
#include "cppdefault.h"
|
||||
|
||||
/* Look for directories that start with the standard prefix.
|
||||
"Translate" them, i.e: replace /usr/local/lib/gcc with
|
||||
IPREFIX and search them first. Based on incpath.c. */
|
||||
|
||||
static char *
|
||||
prefixed_path (const char *path, const char *iprefix)
|
||||
{
|
||||
size_t len;
|
||||
|
||||
if (cpp_relocated () && (len = cpp_PREFIX_len) != 0)
|
||||
{
|
||||
if (!strncmp (path, cpp_PREFIX, len))
|
||||
{
|
||||
static const char *relocated_prefix;
|
||||
/* If this path starts with the configure-time prefix,
|
||||
but the compiler has been relocated, replace it
|
||||
with the run-time prefix. */
|
||||
if (!relocated_prefix)
|
||||
{
|
||||
/* Make relative prefix expects the first argument
|
||||
to be a program, not a directory. */
|
||||
char *dummy = concat (gcc_exec_prefix, "dummy", NULL);
|
||||
relocated_prefix
|
||||
= make_relative_prefix (dummy,
|
||||
cpp_EXEC_PREFIX,
|
||||
cpp_PREFIX);
|
||||
free (dummy);
|
||||
}
|
||||
|
||||
return concat (relocated_prefix, path + len, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (iprefix && (len = cpp_GCC_INCLUDE_DIR_len) != 0)
|
||||
{
|
||||
if (!strncmp (path, cpp_GCC_INCLUDE_DIR, len))
|
||||
return concat (iprefix, path + len, NULL);
|
||||
}
|
||||
|
||||
return xstrdup (path);
|
||||
}
|
||||
|
||||
/* Add PATHS to the global import lookup path. */
|
||||
|
||||
static void
|
||||
add_globalpaths (Strings *paths)
|
||||
{
|
||||
if (paths)
|
||||
{
|
||||
if (!global.path)
|
||||
global.path = new Strings ();
|
||||
|
||||
for (size_t i = 0; i < paths->dim; i++)
|
||||
{
|
||||
const char *path = (*paths)[i];
|
||||
const char *target = FileName::canonicalName (path);
|
||||
|
||||
if (target == NULL || !FileName::exists (target))
|
||||
{
|
||||
if (target)
|
||||
free (CONST_CAST (char *, target));
|
||||
continue;
|
||||
}
|
||||
|
||||
global.path->push (target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Add PATHS to the global file import lookup path. */
|
||||
|
||||
static void
|
||||
add_filepaths (Strings *paths)
|
||||
{
|
||||
if (paths)
|
||||
{
|
||||
if (!global.filePath)
|
||||
global.filePath = new Strings ();
|
||||
|
||||
for (size_t i = 0; i < paths->dim; i++)
|
||||
{
|
||||
const char *path = (*paths)[i];
|
||||
const char *target = FileName::canonicalName (path);
|
||||
|
||||
if (!FileName::exists (target))
|
||||
{
|
||||
free (CONST_CAST (char *, target));
|
||||
continue;
|
||||
}
|
||||
|
||||
global.filePath->push (target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Add all search directories to compiler runtime.
|
||||
if STDINC, also include standard library paths. */
|
||||
|
||||
void
|
||||
add_import_paths (const char *iprefix, const char *imultilib, bool stdinc)
|
||||
{
|
||||
if (stdinc)
|
||||
{
|
||||
for (const default_include *p = cpp_include_defaults; p->fname; p++)
|
||||
{
|
||||
char *path;
|
||||
|
||||
/* Ignore C++ paths. */
|
||||
if (p->cplusplus)
|
||||
continue;
|
||||
|
||||
if (!p->add_sysroot)
|
||||
path = prefixed_path (p->fname, iprefix);
|
||||
else
|
||||
path = xstrdup (p->fname);
|
||||
|
||||
/* Add D-specific suffix. */
|
||||
path = concat (path, "/d", NULL);
|
||||
|
||||
/* Ignore duplicate entries. */
|
||||
bool found = false;
|
||||
for (size_t i = 0; i < global.params.imppath->dim; i++)
|
||||
{
|
||||
if (strcmp (path, (*global.params.imppath)[i]) == 0)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found)
|
||||
{
|
||||
free (path);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Multilib support. */
|
||||
if (imultilib)
|
||||
{
|
||||
char *target_path = concat (path, "/", imultilib, NULL);
|
||||
global.params.imppath->shift (target_path);
|
||||
}
|
||||
|
||||
global.params.imppath->shift (path);
|
||||
}
|
||||
}
|
||||
|
||||
/* Add import search paths. */
|
||||
if (global.params.imppath)
|
||||
{
|
||||
for (size_t i = 0; i < global.params.imppath->dim; i++)
|
||||
{
|
||||
const char *path = (*global.params.imppath)[i];
|
||||
if (path)
|
||||
add_globalpaths (FileName::splitPath (path));
|
||||
}
|
||||
}
|
||||
|
||||
/* Add string import search paths. */
|
||||
if (global.params.fileImppath)
|
||||
{
|
||||
for (size_t i = 0; i < global.params.fileImppath->dim; i++)
|
||||
{
|
||||
const char *path = (*global.params.fileImppath)[i];
|
||||
if (path)
|
||||
add_filepaths (FileName::splitPath (path));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
1797
gcc/d/d-lang.cc
Normal file
1797
gcc/d/d-lang.cc
Normal file
File diff suppressed because it is too large
Load Diff
204
gcc/d/d-longdouble.cc
Normal file
204
gcc/d/d-longdouble.cc
Normal file
@ -0,0 +1,204 @@
|
||||
/* d-longdouble.cc -- Software floating-point emulation for the frontend.
|
||||
Copyright (C) 2006-2018 Free Software Foundation, Inc.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
|
||||
#include "dmd/mtype.h"
|
||||
|
||||
#include "tree.h"
|
||||
#include "fold-const.h"
|
||||
#include "diagnostic.h"
|
||||
#include "stor-layout.h"
|
||||
|
||||
#include "d-tree.h"
|
||||
#include "longdouble.h"
|
||||
|
||||
|
||||
/* Constant real values 0, 1, -1 and 0.5. */
|
||||
real_t CTFloat::zero;
|
||||
real_t CTFloat::one;
|
||||
real_t CTFloat::minusone;
|
||||
real_t CTFloat::half;
|
||||
|
||||
/* Truncate longdouble to the highest precision supported by target. */
|
||||
|
||||
longdouble
|
||||
longdouble::normalize (void)
|
||||
{
|
||||
const machine_mode mode = TYPE_MODE (long_double_type_node);
|
||||
real_convert (&this->rv (), mode, &this->rv ());
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* Assign a real_value to a longdouble type. */
|
||||
|
||||
void
|
||||
longdouble::set (real_value& d)
|
||||
{
|
||||
real_convert (&this->rv (), TYPE_MODE (long_double_type_node), &d);
|
||||
}
|
||||
|
||||
/* Conversion routines between longdouble and integer types. */
|
||||
|
||||
void
|
||||
longdouble::set (int32_t d)
|
||||
{
|
||||
real_from_integer (&this->rv (), TYPE_MODE (double_type_node), d, SIGNED);
|
||||
}
|
||||
|
||||
void
|
||||
longdouble::set (int64_t d)
|
||||
{
|
||||
real_from_integer (&this->rv (), TYPE_MODE (long_double_type_node), d,
|
||||
SIGNED);
|
||||
}
|
||||
|
||||
int64_t
|
||||
longdouble::to_int (void) const
|
||||
{
|
||||
bool overflow;
|
||||
wide_int wi = real_to_integer (&this->rv (), &overflow, 64);
|
||||
return wi.to_shwi ();
|
||||
}
|
||||
|
||||
/* Unsigned variants of the same conversion routines. */
|
||||
|
||||
void
|
||||
longdouble::set (uint32_t d)
|
||||
{
|
||||
real_from_integer (&this->rv (), TYPE_MODE (double_type_node), d, UNSIGNED);
|
||||
}
|
||||
|
||||
void
|
||||
longdouble::set (uint64_t d)
|
||||
{
|
||||
real_from_integer (&this->rv (), TYPE_MODE (long_double_type_node), d,
|
||||
UNSIGNED);
|
||||
}
|
||||
|
||||
uint64_t
|
||||
longdouble::to_uint (void) const
|
||||
{
|
||||
bool overflow;
|
||||
wide_int wi = real_to_integer (&this->rv (), &overflow, 64);
|
||||
return wi.to_uhwi ();
|
||||
}
|
||||
|
||||
/* For conversion between boolean, only need to check if is zero. */
|
||||
|
||||
void
|
||||
longdouble::set (bool d)
|
||||
{
|
||||
this->rv () = (d == false) ? dconst0 : dconst1;
|
||||
}
|
||||
|
||||
bool
|
||||
longdouble::to_bool (void) const
|
||||
{
|
||||
return this->rv ().cl != rvc_zero;
|
||||
}
|
||||
|
||||
/* Overload numeric operators for longdouble types. */
|
||||
|
||||
longdouble
|
||||
longdouble::add (const longdouble& r) const
|
||||
{
|
||||
longdouble x;
|
||||
real_arithmetic (&x.rv (), PLUS_EXPR, &this->rv (), &r.rv ());
|
||||
return x.normalize ();
|
||||
}
|
||||
|
||||
longdouble
|
||||
longdouble::sub (const longdouble& r) const
|
||||
{
|
||||
longdouble x;
|
||||
real_arithmetic (&x.rv (), MINUS_EXPR, &this->rv (), &r.rv ());
|
||||
return x.normalize ();
|
||||
}
|
||||
|
||||
longdouble
|
||||
longdouble::mul (const longdouble& r) const
|
||||
{
|
||||
longdouble x;
|
||||
real_arithmetic (&x.rv (), MULT_EXPR, &this->rv (), &r.rv ());
|
||||
return x.normalize ();
|
||||
}
|
||||
|
||||
longdouble
|
||||
longdouble::div (const longdouble& r) const
|
||||
{
|
||||
longdouble x;
|
||||
real_arithmetic (&x.rv (), RDIV_EXPR, &this->rv (), &r.rv ());
|
||||
return x.normalize ();
|
||||
}
|
||||
|
||||
longdouble
|
||||
longdouble::mod (const longdouble& r) const
|
||||
{
|
||||
longdouble x;
|
||||
real_value q;
|
||||
|
||||
if (r.rv ().cl == rvc_zero || REAL_VALUE_ISINF (this->rv ()))
|
||||
{
|
||||
real_nan (&x.rv (), "", 1, TYPE_MODE (long_double_type_node));
|
||||
return x;
|
||||
}
|
||||
|
||||
if (this->rv ().cl == rvc_zero)
|
||||
return *this;
|
||||
|
||||
if (REAL_VALUE_ISINF (r.rv ()))
|
||||
return *this;
|
||||
|
||||
/* Need to check for NaN? */
|
||||
real_arithmetic (&q, RDIV_EXPR, &this->rv (), &r.rv ());
|
||||
real_arithmetic (&q, FIX_TRUNC_EXPR, &q, NULL);
|
||||
real_arithmetic (&q, MULT_EXPR, &q, &r.rv ());
|
||||
real_arithmetic (&x.rv (), MINUS_EXPR, &this->rv (), &q);
|
||||
|
||||
return x.normalize ();
|
||||
}
|
||||
|
||||
longdouble
|
||||
longdouble::neg (void) const
|
||||
{
|
||||
longdouble x;
|
||||
real_arithmetic (&x.rv (), NEGATE_EXPR, &this->rv (), NULL);
|
||||
return x.normalize ();
|
||||
}
|
||||
|
||||
/* Overload equality operators for longdouble types. */
|
||||
|
||||
int
|
||||
longdouble::cmp (const longdouble& r) const
|
||||
{
|
||||
if (real_compare (LT_EXPR, &this->rv (), &r.rv ()))
|
||||
return -1;
|
||||
|
||||
if (real_compare (GT_EXPR, &this->rv (), &r.rv ()))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
longdouble::equals (const longdouble& r) const
|
||||
{
|
||||
return real_compare (EQ_EXPR, &this->rv (), &r.rv ());
|
||||
}
|
503
gcc/d/d-spec.cc
Normal file
503
gcc/d/d-spec.cc
Normal file
@ -0,0 +1,503 @@
|
||||
/* d-spec.c -- Specific flags and argument handling of the D front end.
|
||||
Copyright (C) 2006-2018 Free Software Foundation, Inc.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "opt-suggestions.h"
|
||||
#include "gcc.h"
|
||||
#include "tm.h"
|
||||
#include "opts.h"
|
||||
|
||||
/* This bit is set if the arguments is a D source file. */
|
||||
#define DSOURCE (1<<1)
|
||||
/* This bit is set if they did `-lstdc++'. */
|
||||
#define WITHLIBCXX (1<<2)
|
||||
/* Skip this option. */
|
||||
#define SKIPOPT (1<<3)
|
||||
|
||||
#ifndef LIBSTDCXX
|
||||
#define LIBSTDCXX "stdc++"
|
||||
#endif
|
||||
#ifndef LIBSTDCXX_PROFILE
|
||||
#define LIBSTDCXX_PROFILE LIBSTDCXX
|
||||
#endif
|
||||
|
||||
#ifndef LIBPHOBOS
|
||||
#define LIBPHOBOS "gphobos"
|
||||
#endif
|
||||
#ifndef LIBPHOBOS_PROFILE
|
||||
#define LIBPHOBOS_PROFILE LIBPHOBOS
|
||||
#endif
|
||||
|
||||
#ifndef LIBDRUNTIME
|
||||
#define LIBDRUNTIME "gdruntime"
|
||||
#endif
|
||||
#ifndef LIBDRUNTIME_PROFILE
|
||||
#define LIBDRUNTIME_PROFILE LIBDRUNTIME
|
||||
#endif
|
||||
|
||||
/* What do with libgphobos. */
|
||||
enum phobos_action
|
||||
{
|
||||
/* libgphobos should not be linked in. */
|
||||
PHOBOS_NOLINK = -1,
|
||||
/* libgphobos should be linked in if it is needed. */
|
||||
PHOBOS_DEFAULT = 0,
|
||||
/* libgphobos is needed and should be linked in. */
|
||||
PHOBOS_LINK,
|
||||
/* libgphobos is needed and should be linked statically. */
|
||||
PHOBOS_STATIC,
|
||||
/* libgphobos is needed and should be linked dynamically. */
|
||||
PHOBOS_DYNAMIC,
|
||||
};
|
||||
|
||||
static phobos_action phobos_library = PHOBOS_DEFAULT;
|
||||
|
||||
/* If true, use the standard D runtime library when linking with
|
||||
standard libraries. */
|
||||
static bool need_phobos = true;
|
||||
|
||||
void
|
||||
lang_specific_driver (cl_decoded_option **in_decoded_options,
|
||||
unsigned int *in_decoded_options_count,
|
||||
int *in_added_libraries)
|
||||
{
|
||||
unsigned int i, j;
|
||||
|
||||
/* If nonzero, the user gave us the `-p' or `-pg' flag. */
|
||||
int saw_profile_flag = 0;
|
||||
|
||||
/* If true, the user gave `-g'. Used by -debuglib. */
|
||||
bool saw_debug_flag = false;
|
||||
|
||||
/* The new argument list will be contained in this. */
|
||||
cl_decoded_option *new_decoded_options;
|
||||
|
||||
/* "-lstdc++" if it appears on the command line. */
|
||||
const cl_decoded_option *saw_libcxx = 0;
|
||||
|
||||
/* Whether we need the C++ STD library. */
|
||||
bool need_stdcxx = false;
|
||||
|
||||
/* True if we saw -static. */
|
||||
bool static_link = false;
|
||||
|
||||
/* True if we should add -shared-libgcc to the command-line. */
|
||||
bool shared_libgcc = true;
|
||||
|
||||
/* What default library to use instead of phobos. */
|
||||
const char *defaultlib = NULL;
|
||||
|
||||
/* What debug library to use instead of phobos. */
|
||||
const char *debuglib = NULL;
|
||||
|
||||
/* The total number of arguments with the new stuff. */
|
||||
unsigned int num_args = 1;
|
||||
|
||||
/* "-fonly" if it appears on the command line. */
|
||||
const char *only_source_option = 0;
|
||||
|
||||
/* Whether the -o option was used. */
|
||||
bool saw_opt_o = false;
|
||||
|
||||
/* Whether the -c option was used. Also used for -E, -fsyntax-only,
|
||||
in general anything which implies only compilation and not linking. */
|
||||
bool saw_opt_c = false;
|
||||
|
||||
/* Whether the -S option was used. */
|
||||
bool saw_opt_S = false;
|
||||
|
||||
/* The first input file with an extension of .d. */
|
||||
const char *first_d_file = NULL;
|
||||
|
||||
/* The total number of arguments with the new stuff. */
|
||||
unsigned int argc = *in_decoded_options_count;
|
||||
|
||||
/* The argument list. */
|
||||
cl_decoded_option *decoded_options = *in_decoded_options;
|
||||
|
||||
/* The number of libraries added in. */
|
||||
int added_libraries = *in_added_libraries;
|
||||
|
||||
/* An array used to flag each argument that needs a bit set for
|
||||
DSOURCE, MATHLIB, WITHTHREAD, WITHLIBC or WITHLIBCXX. */
|
||||
int *args = XCNEWVEC (int, argc);
|
||||
|
||||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
const char *arg = decoded_options[i].arg;
|
||||
|
||||
switch (decoded_options[i].opt_index)
|
||||
{
|
||||
case OPT_nostdlib:
|
||||
case OPT_nodefaultlibs:
|
||||
phobos_library = PHOBOS_NOLINK;
|
||||
break;
|
||||
|
||||
case OPT_nophoboslib:
|
||||
need_phobos = false;
|
||||
args[i] |= SKIPOPT;
|
||||
break;
|
||||
|
||||
case OPT_defaultlib_:
|
||||
if (defaultlib != NULL)
|
||||
free (CONST_CAST (char *, defaultlib));
|
||||
if (arg != NULL)
|
||||
{
|
||||
need_phobos = false;
|
||||
args[i] |= SKIPOPT;
|
||||
defaultlib = XNEWVEC (char, strlen (arg));
|
||||
strcpy (CONST_CAST (char *, defaultlib), arg);
|
||||
}
|
||||
break;
|
||||
|
||||
case OPT_debuglib_:
|
||||
if (debuglib != NULL)
|
||||
free (CONST_CAST (char *, debuglib));
|
||||
if (arg != NULL)
|
||||
{
|
||||
need_phobos = false;
|
||||
args[i] |= SKIPOPT;
|
||||
debuglib = XNEWVEC (char, strlen (arg));
|
||||
strcpy (CONST_CAST (char *, debuglib), arg);
|
||||
}
|
||||
break;
|
||||
|
||||
case OPT_l:
|
||||
if ((strcmp (arg, LIBSTDCXX) == 0)
|
||||
|| (strcmp (arg, LIBSTDCXX_PROFILE) == 0))
|
||||
{
|
||||
args[i] |= WITHLIBCXX;
|
||||
need_stdcxx = false;
|
||||
}
|
||||
/* Unrecognized libraries (e.g. -ltango) may require libphobos. */
|
||||
else if (phobos_library == PHOBOS_DEFAULT)
|
||||
phobos_library = PHOBOS_LINK;
|
||||
break;
|
||||
|
||||
case OPT_pg:
|
||||
case OPT_p:
|
||||
saw_profile_flag++;
|
||||
break;
|
||||
|
||||
case OPT_g:
|
||||
saw_debug_flag = true;
|
||||
break;
|
||||
|
||||
case OPT_v:
|
||||
/* If they only gave us `-v', don't try to link in libphobos. */
|
||||
if (argc == 2)
|
||||
phobos_library = PHOBOS_NOLINK;
|
||||
break;
|
||||
|
||||
case OPT_x:
|
||||
if (phobos_library == PHOBOS_DEFAULT && (strcmp (arg, "d") == 0))
|
||||
phobos_library = PHOBOS_LINK;
|
||||
break;
|
||||
|
||||
case OPT_Xlinker:
|
||||
case OPT_Wl_:
|
||||
/* Arguments that go directly to the linker might be .o files
|
||||
or something, and so might cause libphobos to be needed. */
|
||||
if (phobos_library == PHOBOS_DEFAULT)
|
||||
phobos_library = PHOBOS_LINK;
|
||||
break;
|
||||
|
||||
case OPT_c:
|
||||
case OPT_E:
|
||||
case OPT_M:
|
||||
case OPT_MM:
|
||||
case OPT_fsyntax_only:
|
||||
/* Don't specify libaries if we won't link, since that would
|
||||
cause a warning. */
|
||||
saw_opt_c = true;
|
||||
phobos_library = PHOBOS_NOLINK;
|
||||
break;
|
||||
|
||||
case OPT_S:
|
||||
saw_opt_S = true;
|
||||
phobos_library = PHOBOS_NOLINK;
|
||||
break;
|
||||
|
||||
case OPT_o:
|
||||
saw_opt_o = true;
|
||||
break;
|
||||
|
||||
case OPT_static:
|
||||
static_link = true;
|
||||
break;
|
||||
|
||||
case OPT_static_libgcc:
|
||||
shared_libgcc = false;
|
||||
break;
|
||||
|
||||
case OPT_static_libphobos:
|
||||
if (phobos_library != PHOBOS_NOLINK)
|
||||
phobos_library = PHOBOS_STATIC;
|
||||
args[i] |= SKIPOPT;
|
||||
break;
|
||||
|
||||
case OPT_shared_libphobos:
|
||||
if (phobos_library != PHOBOS_NOLINK)
|
||||
phobos_library = PHOBOS_DYNAMIC;
|
||||
args[i] |= SKIPOPT;
|
||||
break;
|
||||
|
||||
case OPT_fonly_:
|
||||
args[i] |= SKIPOPT;
|
||||
only_source_option = decoded_options[i].orig_option_with_args_text;
|
||||
|
||||
if (arg != NULL)
|
||||
{
|
||||
const char *suffix = strrchr (only_source_option, '.');
|
||||
if (suffix == NULL || strcmp (suffix, ".d") != 0)
|
||||
only_source_option = concat (only_source_option, ".d", NULL);
|
||||
}
|
||||
break;
|
||||
|
||||
case OPT_SPECIAL_input_file:
|
||||
{
|
||||
if (arg[0] == '\0' || arg[1] == '\0')
|
||||
continue;
|
||||
|
||||
if (phobos_library == PHOBOS_DEFAULT)
|
||||
phobos_library = PHOBOS_LINK;
|
||||
|
||||
/* Record that this is a D source file. */
|
||||
const char *suffix = strrchr (arg, '.');
|
||||
if (suffix != NULL && strcmp (suffix, ".d") == 0)
|
||||
{
|
||||
if (first_d_file == NULL)
|
||||
first_d_file = arg;
|
||||
|
||||
args[i] |= DSOURCE;
|
||||
}
|
||||
|
||||
/* If this is a C++ source file, we'll need to link
|
||||
against libstdc++ library. */
|
||||
if (suffix != NULL
|
||||
&& (strcmp (suffix, ".cc") == 0
|
||||
|| (strcmp (suffix, ".cpp") == 0)
|
||||
|| (strcmp (suffix, ".c++") == 0)))
|
||||
need_stdcxx = true;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* There's no point adding -shared-libgcc if we don't have a shared
|
||||
libgcc. */
|
||||
#ifndef ENABLE_SHARED_LIBGCC
|
||||
shared_libgcc = false;
|
||||
#endif
|
||||
|
||||
/* Make sure to have room for the trailing NULL argument.
|
||||
- needstdcxx might add `-lstdcxx'
|
||||
- libphobos adds `-Bstatic -lphobos -ldruntime -Bdynamic'
|
||||
- only_source adds 1 more arg, also maybe add `-o'. */
|
||||
num_args = argc + need_stdcxx + shared_libgcc + need_phobos * 4 + 2;
|
||||
new_decoded_options = XNEWVEC (cl_decoded_option, num_args);
|
||||
|
||||
i = 0;
|
||||
j = 0;
|
||||
|
||||
/* Copy the 0th argument, i.e., the name of the program itself. */
|
||||
new_decoded_options[j++] = decoded_options[i++];
|
||||
|
||||
/* NOTE: We start at 1 now, not 0. */
|
||||
while (i < argc)
|
||||
{
|
||||
if (args[i] & SKIPOPT)
|
||||
{
|
||||
++i;
|
||||
continue;
|
||||
}
|
||||
|
||||
new_decoded_options[j] = decoded_options[i];
|
||||
|
||||
if (!saw_libcxx && (args[i] & WITHLIBCXX))
|
||||
{
|
||||
--j;
|
||||
saw_libcxx = &decoded_options[i];
|
||||
}
|
||||
|
||||
if (args[i] & DSOURCE)
|
||||
{
|
||||
if (only_source_option)
|
||||
--j;
|
||||
}
|
||||
|
||||
i++;
|
||||
j++;
|
||||
}
|
||||
|
||||
if (only_source_option)
|
||||
{
|
||||
const char *only_source_arg = only_source_option + 7;
|
||||
generate_option (OPT_fonly_, only_source_arg, 1, CL_DRIVER,
|
||||
&new_decoded_options[j]);
|
||||
j++;
|
||||
|
||||
generate_option_input_file (only_source_arg,
|
||||
&new_decoded_options[j++]);
|
||||
}
|
||||
|
||||
/* If no reason to link against libphobos library, then don't add it. */
|
||||
if (phobos_library == PHOBOS_DEFAULT)
|
||||
phobos_library = PHOBOS_NOLINK;
|
||||
|
||||
/* If we didn't see a -o option, add one. This is because we need the
|
||||
driver to pass all .d files to the D compiler. Without a -o option
|
||||
the driver will invoke the compiler separately for each input file. */
|
||||
if (first_d_file != NULL && !saw_opt_o)
|
||||
{
|
||||
if (saw_opt_c || saw_opt_S)
|
||||
{
|
||||
const char *base = lbasename (first_d_file);
|
||||
int baselen = strlen (base) - 2;
|
||||
char *out = XNEWVEC (char, baselen + 3);
|
||||
|
||||
memcpy (out, base, baselen);
|
||||
/* The driver will convert .o to some other suffix if appropriate. */
|
||||
out[baselen] = '.';
|
||||
if (saw_opt_S)
|
||||
out[baselen + 1] = 's';
|
||||
else
|
||||
out[baselen + 1] = 'o';
|
||||
out[baselen + 2] = '\0';
|
||||
generate_option (OPT_o, out, 1, CL_DRIVER,
|
||||
&new_decoded_options[j]);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Wouldn't be necessary if the driver converted .out also. */
|
||||
const char *out = NULL;
|
||||
|
||||
#ifdef TARGET_EXECUTABLE_SUFFIX
|
||||
if (TARGET_EXECUTABLE_SUFFIX[0] != 0)
|
||||
out = "a" TARGET_EXECUTABLE_SUFFIX;
|
||||
#endif
|
||||
if (out == NULL)
|
||||
out = "a.out";
|
||||
|
||||
generate_option (OPT_o, out, 1, CL_DRIVER,
|
||||
&new_decoded_options[j]);
|
||||
}
|
||||
j++;
|
||||
}
|
||||
|
||||
/* Add `-lgphobos' if we haven't already done so. */
|
||||
if (phobos_library != PHOBOS_NOLINK && need_phobos)
|
||||
{
|
||||
/* Default to static linking. */
|
||||
if (phobos_library != PHOBOS_DYNAMIC)
|
||||
phobos_library = PHOBOS_STATIC;
|
||||
|
||||
#ifdef HAVE_LD_STATIC_DYNAMIC
|
||||
if (phobos_library == PHOBOS_DYNAMIC && static_link)
|
||||
{
|
||||
generate_option (OPT_Wl_, LD_DYNAMIC_OPTION, 1, CL_DRIVER,
|
||||
&new_decoded_options[j]);
|
||||
j++;
|
||||
}
|
||||
else if (phobos_library == PHOBOS_STATIC && !static_link)
|
||||
{
|
||||
generate_option (OPT_Wl_, LD_STATIC_OPTION, 1, CL_DRIVER,
|
||||
&new_decoded_options[j]);
|
||||
j++;
|
||||
}
|
||||
#endif
|
||||
|
||||
generate_option (OPT_l,
|
||||
saw_profile_flag ? LIBPHOBOS_PROFILE : LIBPHOBOS, 1,
|
||||
CL_DRIVER, &new_decoded_options[j]);
|
||||
added_libraries++;
|
||||
j++;
|
||||
generate_option (OPT_l,
|
||||
saw_profile_flag ? LIBDRUNTIME_PROFILE : LIBDRUNTIME, 1,
|
||||
CL_DRIVER, &new_decoded_options[j]);
|
||||
added_libraries++;
|
||||
j++;
|
||||
|
||||
#ifdef HAVE_LD_STATIC_DYNAMIC
|
||||
if (phobos_library == PHOBOS_DYNAMIC && static_link)
|
||||
{
|
||||
generate_option (OPT_Wl_, LD_STATIC_OPTION, 1, CL_DRIVER,
|
||||
&new_decoded_options[j]);
|
||||
j++;
|
||||
}
|
||||
else if (phobos_library == PHOBOS_STATIC && !static_link)
|
||||
{
|
||||
generate_option (OPT_Wl_, LD_DYNAMIC_OPTION, 1, CL_DRIVER,
|
||||
&new_decoded_options[j]);
|
||||
j++;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else if (saw_debug_flag && debuglib)
|
||||
{
|
||||
generate_option (OPT_l, debuglib, 1, CL_DRIVER,
|
||||
&new_decoded_options[j++]);
|
||||
added_libraries++;
|
||||
}
|
||||
else if (defaultlib)
|
||||
{
|
||||
generate_option (OPT_l, defaultlib, 1, CL_DRIVER,
|
||||
&new_decoded_options[j++]);
|
||||
added_libraries++;
|
||||
}
|
||||
|
||||
if (saw_libcxx)
|
||||
new_decoded_options[j++] = *saw_libcxx;
|
||||
else if (need_stdcxx)
|
||||
{
|
||||
generate_option (OPT_l,
|
||||
(saw_profile_flag
|
||||
? LIBSTDCXX_PROFILE
|
||||
: LIBSTDCXX),
|
||||
1, CL_DRIVER, &new_decoded_options[j++]);
|
||||
added_libraries++;
|
||||
}
|
||||
|
||||
if (shared_libgcc && !static_link)
|
||||
{
|
||||
generate_option (OPT_shared_libgcc, NULL, 1, CL_DRIVER,
|
||||
&new_decoded_options[j++]);
|
||||
}
|
||||
|
||||
*in_decoded_options_count = j;
|
||||
*in_decoded_options = new_decoded_options;
|
||||
*in_added_libraries = added_libraries;
|
||||
}
|
||||
|
||||
/* Called before linking. Returns 0 on success and -1 on failure. */
|
||||
|
||||
int
|
||||
lang_specific_pre_link (void)
|
||||
{
|
||||
if (phobos_library != PHOBOS_NOLINK && need_phobos)
|
||||
do_spec ("%:include(libgphobos.spec)");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Number of extra output files that lang_specific_pre_link may generate. */
|
||||
|
||||
int lang_specific_extra_outfiles = 0; /* Not used for D. */
|
||||
|
20
gcc/d/d-target-def.h
Normal file
20
gcc/d/d-target-def.h
Normal file
@ -0,0 +1,20 @@
|
||||
/* d-target-def.h -- Default initializers for D target hooks.
|
||||
Copyright (C) 2017-2018 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 3, or (at your option) any
|
||||
later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "d/d-target-hooks-def.h"
|
||||
#include "tree.h"
|
||||
#include "hooks.h"
|
394
gcc/d/d-target.cc
Normal file
394
gcc/d/d-target.cc
Normal file
@ -0,0 +1,394 @@
|
||||
/* d-target.cc -- Target interface for the D front end.
|
||||
Copyright (C) 2013-2018 Free Software Foundation, Inc.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
|
||||
#include "dmd/aggregate.h"
|
||||
#include "dmd/declaration.h"
|
||||
#include "dmd/expression.h"
|
||||
#include "dmd/mangle.h"
|
||||
#include "dmd/mtype.h"
|
||||
#include "dmd/tokens.h"
|
||||
#include "dmd/target.h"
|
||||
|
||||
#include "tree.h"
|
||||
#include "memmodel.h"
|
||||
#include "fold-const.h"
|
||||
#include "stor-layout.h"
|
||||
#include "tm.h"
|
||||
#include "tm_p.h"
|
||||
#include "target.h"
|
||||
|
||||
#include "d-tree.h"
|
||||
#include "d-target.h"
|
||||
|
||||
/* Implements the Target interface defined by the front end.
|
||||
Used for retrieving target-specific information. */
|
||||
|
||||
/* Type size information used by frontend. */
|
||||
int Target::ptrsize;
|
||||
int Target::c_longsize;
|
||||
int Target::realsize;
|
||||
int Target::realpad;
|
||||
int Target::realalignsize;
|
||||
bool Target::reverseCppOverloads;
|
||||
bool Target::cppExceptions;
|
||||
int Target::classinfosize;
|
||||
unsigned long long Target::maxStaticDataSize;
|
||||
|
||||
/* Floating-point constants for for .max, .min, and other properties. */
|
||||
template <typename T> real_t Target::FPTypeProperties<T>::max;
|
||||
template <typename T> real_t Target::FPTypeProperties<T>::min_normal;
|
||||
template <typename T> real_t Target::FPTypeProperties<T>::nan;
|
||||
template <typename T> real_t Target::FPTypeProperties<T>::snan;
|
||||
template <typename T> real_t Target::FPTypeProperties<T>::infinity;
|
||||
template <typename T> real_t Target::FPTypeProperties<T>::epsilon;
|
||||
template <typename T> d_int64 Target::FPTypeProperties<T>::dig;
|
||||
template <typename T> d_int64 Target::FPTypeProperties<T>::mant_dig;
|
||||
template <typename T> d_int64 Target::FPTypeProperties<T>::max_exp;
|
||||
template <typename T> d_int64 Target::FPTypeProperties<T>::min_exp;
|
||||
template <typename T> d_int64 Target::FPTypeProperties<T>::max_10_exp;
|
||||
template <typename T> d_int64 Target::FPTypeProperties<T>::min_10_exp;
|
||||
|
||||
|
||||
/* Initialize the floating-point constants for TYPE. */
|
||||
|
||||
template <typename T>
|
||||
static void
|
||||
define_float_constants (tree type)
|
||||
{
|
||||
const double log10_2 = 0.30102999566398119521;
|
||||
char buf[128];
|
||||
|
||||
/* Get back-end real mode format. */
|
||||
const machine_mode mode = TYPE_MODE (type);
|
||||
const real_format *fmt = REAL_MODE_FORMAT (mode);
|
||||
|
||||
/* The largest representable value that's not infinity. */
|
||||
get_max_float (fmt, buf, sizeof (buf));
|
||||
real_from_string (&T::max.rv (), buf);
|
||||
|
||||
/* The smallest representable normalized value that's not 0. */
|
||||
snprintf (buf, sizeof (buf), "0x1p%d", fmt->emin - 1);
|
||||
real_from_string (&T::min_normal.rv (), buf);
|
||||
|
||||
/* Floating-point NaN. */
|
||||
real_nan (&T::nan.rv (), "", 1, mode);
|
||||
|
||||
/* Signalling floating-point NaN. */
|
||||
real_nan (&T::snan.rv (), "", 0, mode);
|
||||
|
||||
/* Floating-point +Infinity if the target supports infinities. */
|
||||
real_inf (&T::infinity.rv ());
|
||||
|
||||
/* The smallest increment to the value 1. */
|
||||
if (fmt->pnan < fmt->p)
|
||||
snprintf (buf, sizeof (buf), "0x1p%d", fmt->emin - fmt->p);
|
||||
else
|
||||
snprintf (buf, sizeof (buf), "0x1p%d", 1 - fmt->p);
|
||||
real_from_string (&T::epsilon.rv (), buf);
|
||||
|
||||
/* The number of decimal digits of precision. */
|
||||
T::dig = (fmt->p - 1) * log10_2;
|
||||
|
||||
/* The number of bits in mantissa. */
|
||||
T::mant_dig = fmt->p;
|
||||
|
||||
/* The maximum int value such that 2** (value-1) is representable. */
|
||||
T::max_exp = fmt->emax;
|
||||
|
||||
/* The minimum int value such that 2** (value-1) is representable as a
|
||||
normalized value. */
|
||||
T::min_exp = fmt->emin;
|
||||
|
||||
/* The maximum int value such that 10**value is representable. */
|
||||
T::max_10_exp = fmt->emax * log10_2;
|
||||
|
||||
/* The minimum int value such that 10**value is representable as a
|
||||
normalized value. */
|
||||
T::min_10_exp = (fmt->emin - 1) * log10_2;
|
||||
}
|
||||
|
||||
/* Initialize all variables of the Target structure. */
|
||||
|
||||
void
|
||||
Target::_init (void)
|
||||
{
|
||||
/* Map D frontend type and sizes to GCC back-end types. */
|
||||
Target::ptrsize = (POINTER_SIZE / BITS_PER_UNIT);
|
||||
Target::realsize = int_size_in_bytes (long_double_type_node);
|
||||
Target::realpad = (Target::realsize -
|
||||
(TYPE_PRECISION (long_double_type_node) / BITS_PER_UNIT));
|
||||
Target::realalignsize = TYPE_ALIGN_UNIT (long_double_type_node);
|
||||
|
||||
/* Size of run-time TypeInfo object. */
|
||||
Target::classinfosize = 19 * Target::ptrsize;
|
||||
|
||||
/* Allow data sizes up to half of the address space. */
|
||||
Target::maxStaticDataSize = tree_to_shwi (TYPE_MAX_VALUE (ptrdiff_type_node));
|
||||
|
||||
/* Define what type to use for size_t, ptrdiff_t. */
|
||||
if (POINTER_SIZE == 64)
|
||||
{
|
||||
global.params.isLP64 = true;
|
||||
Tsize_t = Tuns64;
|
||||
Tptrdiff_t = Tint64;
|
||||
}
|
||||
else
|
||||
{
|
||||
Tsize_t = Tuns32;
|
||||
Tptrdiff_t = Tint32;
|
||||
}
|
||||
|
||||
Type::tsize_t = Type::basic[Tsize_t];
|
||||
Type::tptrdiff_t = Type::basic[Tptrdiff_t];
|
||||
Type::thash_t = Type::tsize_t;
|
||||
|
||||
/* Set-up target C ABI. */
|
||||
Target::c_longsize = int_size_in_bytes (long_integer_type_node);
|
||||
|
||||
/* Set-up target C++ ABI. */
|
||||
Target::reverseCppOverloads = false;
|
||||
Target::cppExceptions = true;
|
||||
|
||||
/* Initialize all compile-time properties for floating-point types.
|
||||
Should ensure that our real_t type is able to represent real_value. */
|
||||
gcc_assert (sizeof (real_t) >= sizeof (real_value));
|
||||
|
||||
define_float_constants <Target::FloatProperties> (float_type_node);
|
||||
define_float_constants <Target::DoubleProperties> (double_type_node);
|
||||
define_float_constants <Target::RealProperties> (long_double_type_node);
|
||||
|
||||
/* Commonly used floating-point constants. */
|
||||
const machine_mode mode = TYPE_MODE (long_double_type_node);
|
||||
real_convert (&CTFloat::zero.rv (), mode, &dconst0);
|
||||
real_convert (&CTFloat::one.rv (), mode, &dconst1);
|
||||
real_convert (&CTFloat::minusone.rv (), mode, &dconstm1);
|
||||
real_convert (&CTFloat::half.rv (), mode, &dconsthalf);
|
||||
}
|
||||
|
||||
/* Return GCC memory alignment size for type TYPE. */
|
||||
|
||||
unsigned
|
||||
Target::alignsize (Type *type)
|
||||
{
|
||||
gcc_assert (type->isTypeBasic ());
|
||||
return TYPE_ALIGN_UNIT (build_ctype (type));
|
||||
}
|
||||
|
||||
/* Return GCC field alignment size for type TYPE. */
|
||||
|
||||
unsigned
|
||||
Target::fieldalign (Type *type)
|
||||
{
|
||||
/* Work out the correct alignment for the field decl. */
|
||||
unsigned int align = type->alignsize () * BITS_PER_UNIT;
|
||||
|
||||
#ifdef BIGGEST_FIELD_ALIGNMENT
|
||||
align = MIN (align, (unsigned) BIGGEST_FIELD_ALIGNMENT);
|
||||
#endif
|
||||
|
||||
#ifdef ADJUST_FIELD_ALIGN
|
||||
if (type->isTypeBasic ())
|
||||
align = ADJUST_FIELD_ALIGN (NULL_TREE, build_ctype (type), align);
|
||||
#endif
|
||||
|
||||
/* Also controlled by -fpack-struct= */
|
||||
if (maximum_field_alignment)
|
||||
align = MIN (align, maximum_field_alignment);
|
||||
|
||||
return align / BITS_PER_UNIT;
|
||||
}
|
||||
|
||||
/* Return size of OS critical section.
|
||||
Can't use the sizeof () calls directly since cross compiling is supported
|
||||
and would end up using the host sizes rather than the target sizes. */
|
||||
|
||||
unsigned
|
||||
Target::critsecsize (void)
|
||||
{
|
||||
return targetdm.d_critsec_size ();
|
||||
}
|
||||
|
||||
/* Returns a Type for the va_list type of the target. */
|
||||
|
||||
Type *
|
||||
Target::va_listType (void)
|
||||
{
|
||||
return Type::tvalist;
|
||||
}
|
||||
|
||||
/* Checks whether the target supports a vector type with total size SZ
|
||||
(in bytes) and element type TYPE. */
|
||||
|
||||
int
|
||||
Target::isVectorTypeSupported (int sz, Type *type)
|
||||
{
|
||||
/* Size must be greater than zero, and a power of two. */
|
||||
if (sz <= 0 || sz & (sz - 1))
|
||||
return 2;
|
||||
|
||||
/* __vector(void[]) is treated same as __vector(ubyte[]) */
|
||||
if (type == Type::tvoid)
|
||||
type = Type::tuns8;
|
||||
|
||||
/* No support for non-trivial types. */
|
||||
if (!type->isTypeBasic ())
|
||||
return 3;
|
||||
|
||||
/* If there is no hardware support, check if we can safely emulate it. */
|
||||
tree ctype = build_ctype (type);
|
||||
machine_mode mode = TYPE_MODE (ctype);
|
||||
|
||||
if (!targetm.vector_mode_supported_p (mode)
|
||||
&& !targetm.scalar_mode_supported_p (as_a <scalar_mode> (mode)))
|
||||
return 3;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Checks whether the target supports operation OP for vectors of type TYPE.
|
||||
For binary ops T2 is the type of the right-hand operand.
|
||||
Returns true if the operation is supported or type is not a vector. */
|
||||
|
||||
bool
|
||||
Target::isVectorOpSupported (Type *type, TOK op, Type *)
|
||||
{
|
||||
if (type->ty != Tvector)
|
||||
return true;
|
||||
|
||||
/* Don't support if type is non-scalar, such as __vector(void[]). */
|
||||
if (!type->isscalar ())
|
||||
return false;
|
||||
|
||||
/* Don't support if expression cannot be represented. */
|
||||
switch (op)
|
||||
{
|
||||
case TOKpow:
|
||||
case TOKpowass:
|
||||
/* pow() is lowered as a function call. */
|
||||
return false;
|
||||
|
||||
case TOKmod:
|
||||
case TOKmodass:
|
||||
/* fmod() is lowered as a function call. */
|
||||
if (type->isfloating ())
|
||||
return false;
|
||||
break;
|
||||
|
||||
case TOKandand:
|
||||
case TOKoror:
|
||||
/* Logical operators must have a result type of bool. */
|
||||
return false;
|
||||
|
||||
case TOKue:
|
||||
case TOKlg:
|
||||
case TOKule:
|
||||
case TOKul:
|
||||
case TOKuge:
|
||||
case TOKug:
|
||||
case TOKle:
|
||||
case TOKlt:
|
||||
case TOKge:
|
||||
case TOKgt:
|
||||
case TOKleg:
|
||||
case TOKunord:
|
||||
case TOKequal:
|
||||
case TOKnotequal:
|
||||
case TOKidentity:
|
||||
case TOKnotidentity:
|
||||
/* Comparison operators must have a result type of bool. */
|
||||
return false;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Return the symbol mangling of S for C++ linkage. */
|
||||
|
||||
const char *
|
||||
Target::toCppMangle (Dsymbol *s)
|
||||
{
|
||||
return toCppMangleItanium (s);
|
||||
}
|
||||
|
||||
/* Return the symbol mangling of CD for C++ linkage. */
|
||||
|
||||
const char *
|
||||
Target::cppTypeInfoMangle (ClassDeclaration *cd)
|
||||
{
|
||||
return cppTypeInfoMangleItanium (cd);
|
||||
}
|
||||
|
||||
/* For a vendor-specific type, return a string containing the C++ mangling.
|
||||
In all other cases, return NULL. */
|
||||
|
||||
const char *
|
||||
Target::cppTypeMangle (Type *type)
|
||||
{
|
||||
if (type->isTypeBasic () || type->ty == Tvector || type->ty == Tstruct)
|
||||
{
|
||||
tree ctype = build_ctype (type);
|
||||
return targetm.mangle_type (ctype);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Return the type that will really be used for passing the given parameter
|
||||
ARG to an extern(C++) function. */
|
||||
|
||||
Type *
|
||||
Target::cppParameterType (Parameter *arg)
|
||||
{
|
||||
Type *t = arg->type->merge2 ();
|
||||
if (arg->storageClass & (STCout | STCref))
|
||||
t = t->referenceTo ();
|
||||
else if (arg->storageClass & STClazy)
|
||||
{
|
||||
/* Mangle as delegate. */
|
||||
Type *td = TypeFunction::create (NULL, t, 0, LINKd);
|
||||
td = TypeDelegate::create (td);
|
||||
t = t->merge2 ();
|
||||
}
|
||||
|
||||
/* Could be a va_list, which we mangle as a pointer. */
|
||||
if (t->ty == Tsarray && Type::tvalist->ty == Tsarray)
|
||||
{
|
||||
Type *tb = t->toBasetype ()->mutableOf ();
|
||||
if (tb == Type::tvalist)
|
||||
{
|
||||
tb = t->nextOf ()->pointerTo ();
|
||||
t = tb->castMod (t->mod);
|
||||
}
|
||||
}
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
/* Return the default system linkage for the target. */
|
||||
|
||||
LINK
|
||||
Target::systemLinkage (void)
|
||||
{
|
||||
return LINKc;
|
||||
}
|
60
gcc/d/d-target.def
Normal file
60
gcc/d/d-target.def
Normal file
@ -0,0 +1,60 @@
|
||||
/* d-target.def -- Target hook definitions for the D front end.
|
||||
Copyright (C) 2017-2018 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 3, or (at your option) any
|
||||
later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* See target-hooks-macros.h for details of macros that should be
|
||||
provided by the including file, and how to use them here. */
|
||||
|
||||
#include "target-hooks-macros.h"
|
||||
|
||||
#undef HOOK_TYPE
|
||||
#define HOOK_TYPE "D Target Hook"
|
||||
|
||||
HOOK_VECTOR (TARGETDM_INITIALIZER, gcc_targetdm)
|
||||
|
||||
#undef HOOK_PREFIX
|
||||
#define HOOK_PREFIX "TARGET_"
|
||||
|
||||
/* Environmental version identifiers relating to the target CPU. */
|
||||
DEFHOOK
|
||||
(d_cpu_versions,
|
||||
"Declare all environmental version identifiers relating to the target CPU\n\
|
||||
using the function @code{builtin_version}, which takes a string representing\n\
|
||||
the name of the version. Version identifiers predefined by this hook apply\n\
|
||||
to all modules that are being compiled and imported.",
|
||||
void, (void),
|
||||
hook_void_void)
|
||||
|
||||
/* Environmental version identifiers relating to the target OS. */
|
||||
DEFHOOK
|
||||
(d_os_versions,
|
||||
"Similarly to @code{TARGET_D_CPU_VERSIONS}, but is used for versions\n\
|
||||
relating to the target operating system.",
|
||||
void, (void),
|
||||
hook_void_void)
|
||||
|
||||
/* The sizeof CRITICAL_SECTION or pthread_mutex_t. */
|
||||
DEFHOOK
|
||||
(d_critsec_size,
|
||||
"Returns the size of the data structure used by the target operating system\n\
|
||||
for critical sections and monitors. For example, on Microsoft Windows this\n\
|
||||
would return the @code{sizeof(CRITICAL_SECTION)}, while other platforms that\n\
|
||||
implement pthreads would return @code{sizeof(pthread_mutex_t)}.",
|
||||
unsigned, (void),
|
||||
hook_uint_void_0)
|
||||
|
||||
/* Close the 'struct gcc_targetdm' definition. */
|
||||
HOOK_VECTOR_END (C90_EMPTY_HACK)
|
34
gcc/d/d-target.h
Normal file
34
gcc/d/d-target.h
Normal file
@ -0,0 +1,34 @@
|
||||
/* d-target.h -- Data structure definitions for target-specific D behavior.
|
||||
Copyright (C) 2017-2018 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 3, or (at your option) any
|
||||
later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_D_TARGET_H
|
||||
#define GCC_D_TARGET_H
|
||||
|
||||
#define DEFHOOKPOD(NAME, DOC, TYPE, INIT) TYPE NAME;
|
||||
#define DEFHOOK(NAME, DOC, TYPE, PARAMS, INIT) TYPE (* NAME) PARAMS;
|
||||
#define DEFHOOK_UNDOC DEFHOOK
|
||||
#define HOOKSTRUCT(FRAGMENT) FRAGMENT
|
||||
|
||||
#include "d-target.def"
|
||||
|
||||
/* Each target can provide their own. */
|
||||
extern struct gcc_targetdm targetdm;
|
||||
|
||||
/* Used by target to add predefined version idenditiers. */
|
||||
extern void d_add_builtin_version (const char *);
|
||||
|
||||
#endif /* GCC_D_TARGET_H */
|
29
gcc/d/d-tree.def
Normal file
29
gcc/d/d-tree.def
Normal file
@ -0,0 +1,29 @@
|
||||
/* d-tree.def -- Definitions and documentation for additional tree codes used
|
||||
in the D compiler (see tree.def for standard codes).
|
||||
Copyright (C) 2006-2018 Free Software Foundation, Inc.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Logical shift done on an unsigned type. If the first operand is
|
||||
signed, it will be converted to the unsigned equivalent. The second
|
||||
operand is the number of bits to shift by; it need not be the same
|
||||
type as the first operand and result. */
|
||||
DEFTREECODE (UNSIGNED_RSHIFT_EXPR, "unsigned_rshift_expr", tcc_binary, 2)
|
||||
|
||||
/* Floating point modulus that expands to a call to fmod. */
|
||||
DEFTREECODE (FLOAT_MOD_EXPR, "float_mod_expr", tcc_binary, 2)
|
||||
|
||||
/* Used to represent information associated with a function closure. */
|
||||
DEFTREECODE (FUNCFRAME_INFO, "funcframe_info", tcc_exceptional, 0)
|
675
gcc/d/d-tree.h
Normal file
675
gcc/d/d-tree.h
Normal file
@ -0,0 +1,675 @@
|
||||
/* d-tree.h -- Definitions and declarations for code generation.
|
||||
Copyright (C) 2006-2018 Free Software Foundation, Inc.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_D_TREE_H
|
||||
#define GCC_D_TREE_H
|
||||
|
||||
/* Forward type declarations to avoid including unnecessary headers. */
|
||||
|
||||
class Dsymbol;
|
||||
class Declaration;
|
||||
class AggregateDeclaration;
|
||||
class ClassDeclaration;
|
||||
class EnumDeclaration;
|
||||
class FuncDeclaration;
|
||||
class StructDeclaration;
|
||||
class TypeInfoDeclaration;
|
||||
class VarDeclaration;
|
||||
class UserAttributeDeclaration;
|
||||
class Expression;
|
||||
class ClassReferenceExp;
|
||||
class Module;
|
||||
class Statement;
|
||||
class Type;
|
||||
class TypeFunction;
|
||||
class Parameter;
|
||||
struct BaseClass;
|
||||
struct Scope;
|
||||
struct Loc;
|
||||
|
||||
template <typename TYPE> struct Array;
|
||||
typedef Array<Expression *> Expressions;
|
||||
|
||||
/* Usage of TREE_LANG_FLAG_?:
|
||||
0: METHOD_CALL_EXPR
|
||||
1: CALL_EXPR_ARGS_ORDERED (in CALL_EXPR).
|
||||
|
||||
Usage of TYPE_LANG_FLAG_?:
|
||||
0: TYPE_SHARED
|
||||
1: TYPE_IMAGINARY_FLOAT (in REAL_TYPE).
|
||||
ANON_AGGR_TYPE_P (in RECORD_TYPE, UNION_TYPE).
|
||||
2: CLASS_TYPE_P (in RECORD_TYPE).
|
||||
3: TYPE_DYNAMIC_ARRAY (in RECORD_TYPE).
|
||||
4: TYPE_DELEGATE (in RECORD_TYPE).
|
||||
5: TYPE_ASSOCIATIVE_ARRAY (in RECORD_TYPE).
|
||||
|
||||
Usage of DECL_LANG_FLAG_?:
|
||||
0: LABEL_VARIABLE_CASE (in LABEL_DECL).
|
||||
DECL_BUILT_IN_CTFE (in FUNCTION_DECL). */
|
||||
|
||||
/* The kinds of scopes we recognize. */
|
||||
|
||||
enum level_kind
|
||||
{
|
||||
level_block, /* An ordinary block scope. */
|
||||
level_try, /* A try-block. */
|
||||
level_catch, /* A catch-block. */
|
||||
level_finally, /* A finally-block. */
|
||||
level_cond, /* The scope for an if condition. */
|
||||
level_switch, /* The scope for a switch statement. */
|
||||
level_loop, /* A for, do-while, or unrolled-loop block. */
|
||||
level_with, /* The scope for a with statement. */
|
||||
level_function /* The block representing an entire function. */
|
||||
};
|
||||
|
||||
/* List of codes for internally recognised compiler intrinsics. */
|
||||
|
||||
enum intrinsic_code
|
||||
{
|
||||
#define DEF_D_INTRINSIC(CODE, A, N, M, D, C) INTRINSIC_ ## CODE,
|
||||
|
||||
#include "intrinsics.def"
|
||||
|
||||
#undef DEF_D_INTRINSIC
|
||||
INTRINSIC_LAST
|
||||
};
|
||||
|
||||
/* For use with break and continue statements. */
|
||||
|
||||
enum bc_kind
|
||||
{
|
||||
bc_break = 0,
|
||||
bc_continue = 1
|
||||
};
|
||||
|
||||
/* The datatype used to implement D scope. It is needed primarily to support
|
||||
the back-end, but also helps debugging information for local variables. */
|
||||
|
||||
struct GTY((chain_next ("%h.level_chain"))) binding_level
|
||||
{
|
||||
/* A chain of declarations for all variables, constants and functions.
|
||||
These are in the reverse of the order supplied. */
|
||||
tree names;
|
||||
|
||||
/* For each level (except the global one), a chain of BLOCK nodes for
|
||||
all the levels that were entered and exited one level down. */
|
||||
tree blocks;
|
||||
|
||||
/* The binding level this one is contained in. */
|
||||
binding_level *level_chain;
|
||||
|
||||
/* The kind of scope this object represents. */
|
||||
ENUM_BITFIELD (level_kind) kind : 4;
|
||||
};
|
||||
|
||||
/* The binding level currently in effect. */
|
||||
extern GTY(()) binding_level *current_binding_level;
|
||||
extern GTY(()) binding_level *global_binding_level;
|
||||
|
||||
/* Used only for jumps to as-yet undefined labels, since jumps to
|
||||
defined labels can have their validity checked immediately. */
|
||||
|
||||
struct GTY((chain_next ("%h.next"))) d_label_use_entry
|
||||
{
|
||||
d_label_use_entry *next;
|
||||
|
||||
/* The frontend Statement associated with the jump. */
|
||||
Statement * GTY((skip)) statement;
|
||||
|
||||
/* The binding level to which this entry is *currently* attached.
|
||||
This is initially the binding level in which the goto appeared,
|
||||
but is modified as scopes are closed. */
|
||||
binding_level *level;
|
||||
};
|
||||
|
||||
/* A list of all LABEL_DECLs in the function that have names. Here so
|
||||
we can clear out their names' definitions at the end of the
|
||||
function, and so we can check the validity of jumps to these labels. */
|
||||
|
||||
struct GTY(()) d_label_entry
|
||||
{
|
||||
/* The label decl itself. */
|
||||
tree label;
|
||||
|
||||
/* The frontend Statement associated with the label. */
|
||||
Statement * GTY((skip)) statement;
|
||||
|
||||
/* The binding level to which the label is *currently* attached.
|
||||
This is initially set to the binding level in which the label
|
||||
is defined, but is modified as scopes are closed. */
|
||||
binding_level *level;
|
||||
|
||||
/* A list of forward references of the label. */
|
||||
d_label_use_entry *fwdrefs;
|
||||
|
||||
/* The following bits are set after the label is defined, and are
|
||||
updated as scopes are popped. They indicate that a backward jump
|
||||
to the label will illegally enter a scope of the given flavor. */
|
||||
bool in_try_scope;
|
||||
bool in_catch_scope;
|
||||
|
||||
/* If set, the label we reference represents a break/continue pair. */
|
||||
bool bc_label;
|
||||
};
|
||||
|
||||
/* Frame information for a function declaration. */
|
||||
|
||||
struct GTY(()) tree_frame_info
|
||||
{
|
||||
struct tree_common common;
|
||||
tree frame_type;
|
||||
};
|
||||
|
||||
/* True if the function creates a nested frame. */
|
||||
#define FRAMEINFO_CREATES_FRAME(NODE) \
|
||||
(TREE_LANG_FLAG_0 (FUNCFRAME_INFO_CHECK (NODE)))
|
||||
|
||||
/* True if the function has a static chain passed in its DECL_ARGUMENTS. */
|
||||
#define FRAMEINFO_STATIC_CHAIN(NODE) \
|
||||
(TREE_LANG_FLAG_1 (FUNCFRAME_INFO_CHECK (NODE)))
|
||||
|
||||
/* True if the function frame is a closure (initialized on the heap). */
|
||||
#define FRAMEINFO_IS_CLOSURE(NODE) \
|
||||
(TREE_LANG_FLAG_2 (FUNCFRAME_INFO_CHECK (NODE)))
|
||||
|
||||
#define FRAMEINFO_TYPE(NODE) \
|
||||
(((tree_frame_info *) FUNCFRAME_INFO_CHECK (NODE))->frame_type)
|
||||
|
||||
/* Language-dependent contents of an identifier. */
|
||||
|
||||
struct GTY(()) lang_identifier
|
||||
{
|
||||
struct tree_identifier common;
|
||||
|
||||
/* The identifier as the user sees it. */
|
||||
tree pretty_ident;
|
||||
|
||||
/* The back-end tree associated with this identifier. */
|
||||
tree decl_tree;
|
||||
|
||||
/* The frontend Declaration associated with this identifier. */
|
||||
Declaration * GTY((skip)) dsymbol;
|
||||
};
|
||||
|
||||
#define IDENTIFIER_LANG_SPECIFIC(NODE) \
|
||||
((struct lang_identifier *) IDENTIFIER_NODE_CHECK (NODE))
|
||||
|
||||
#define IDENTIFIER_PRETTY_NAME(NODE) \
|
||||
(IDENTIFIER_LANG_SPECIFIC (NODE)->pretty_ident)
|
||||
|
||||
#define IDENTIFIER_DECL_TREE(NODE) \
|
||||
(IDENTIFIER_LANG_SPECIFIC (NODE)->decl_tree)
|
||||
|
||||
#define IDENTIFIER_DSYMBOL(NODE) \
|
||||
(IDENTIFIER_LANG_SPECIFIC (NODE)->dsymbol)
|
||||
|
||||
/* Global state pertinent to the current function. */
|
||||
|
||||
struct GTY(()) language_function
|
||||
{
|
||||
/* Our function and enclosing module. */
|
||||
FuncDeclaration * GTY((skip)) function;
|
||||
Module * GTY((skip)) module;
|
||||
|
||||
/* Static chain of function, for D2, this is a closure. */
|
||||
tree static_chain;
|
||||
|
||||
/* Stack of statement lists being collected while we are
|
||||
compiling the function. */
|
||||
vec<tree, va_gc> *stmt_list;
|
||||
|
||||
/* Variables that are in scope that will need destruction later. */
|
||||
vec<tree, va_gc> *vars_in_scope;
|
||||
|
||||
/* Table of all used or defined labels in the function. */
|
||||
hash_map<Statement *, d_label_entry> *labels;
|
||||
};
|
||||
|
||||
/* The D front end types have not been integrated into the GCC garbage
|
||||
collection system. Handle this by using the "skip" attribute. */
|
||||
|
||||
struct GTY(()) lang_decl
|
||||
{
|
||||
Declaration * GTY((skip)) decl;
|
||||
|
||||
/* FIELD_DECL in frame struct that this variable is allocated in. */
|
||||
tree frame_field;
|
||||
|
||||
/* RESULT_DECL in a function that returns by nrvo. */
|
||||
tree named_result;
|
||||
|
||||
/* Chain of DECL_LANG_THUNKS in a function. */
|
||||
tree thunks;
|
||||
|
||||
/* In a FUNCTION_DECL, this is the THUNK_LANG_OFFSET. */
|
||||
int offset;
|
||||
|
||||
/* In a FUNCTION_DECL, if this is an intrinsic, the code for it. */
|
||||
enum intrinsic_code intrinsic;
|
||||
|
||||
/* FUNCFRAME_INFO in a function that has non-local references. */
|
||||
tree frame_info;
|
||||
};
|
||||
|
||||
/* The current D per-function global variables. */
|
||||
|
||||
#define d_function_chain (cfun ? cfun->language : NULL)
|
||||
|
||||
/* The D frontend Declaration AST for GCC decl NODE. */
|
||||
#define DECL_LANG_FRONTEND(NODE) \
|
||||
(DECL_LANG_SPECIFIC (NODE) \
|
||||
? DECL_LANG_SPECIFIC (NODE)->decl : NULL)
|
||||
|
||||
#define SET_DECL_LANG_FRAME_FIELD(NODE, VAL) \
|
||||
DECL_LANG_SPECIFIC (NODE)->frame_field = VAL
|
||||
|
||||
#define DECL_LANG_FRAME_FIELD(NODE) \
|
||||
(DECL_P (NODE) \
|
||||
? DECL_LANG_SPECIFIC (NODE)->frame_field : NULL)
|
||||
|
||||
#define SET_DECL_LANG_NRVO(NODE, VAL) \
|
||||
DECL_LANG_SPECIFIC (NODE)->named_result = VAL
|
||||
|
||||
#define DECL_LANG_NRVO(NODE) \
|
||||
(DECL_P (NODE) \
|
||||
? DECL_LANG_SPECIFIC (NODE)->named_result : NULL)
|
||||
|
||||
#define DECL_LANG_THUNKS(NODE) \
|
||||
DECL_LANG_SPECIFIC (NODE)->thunks
|
||||
|
||||
#define THUNK_LANG_OFFSET(NODE) \
|
||||
DECL_LANG_SPECIFIC (NODE)->offset
|
||||
|
||||
#define DECL_INTRINSIC_CODE(NODE) \
|
||||
DECL_LANG_SPECIFIC (NODE)->intrinsic
|
||||
|
||||
#define DECL_LANG_FRAMEINFO(NODE) \
|
||||
DECL_LANG_SPECIFIC (NODE)->frame_info
|
||||
|
||||
/* The lang_type field is not set for every GCC type. */
|
||||
|
||||
struct GTY(()) lang_type
|
||||
{
|
||||
Type * GTY((skip)) type;
|
||||
};
|
||||
|
||||
/* The D frontend Type AST for GCC type NODE. */
|
||||
#define TYPE_LANG_FRONTEND(NODE) \
|
||||
(TYPE_LANG_SPECIFIC (NODE) \
|
||||
? TYPE_LANG_SPECIFIC (NODE)->type : NULL)
|
||||
|
||||
|
||||
enum d_tree_node_structure_enum
|
||||
{
|
||||
TS_D_GENERIC,
|
||||
TS_D_IDENTIFIER,
|
||||
TS_D_FRAMEINFO,
|
||||
LAST_TS_D_ENUM
|
||||
};
|
||||
|
||||
/* The resulting tree type. */
|
||||
|
||||
union GTY((desc ("d_tree_node_structure (&%h)"),
|
||||
chain_next ("CODE_CONTAINS_STRUCT (TREE_CODE (&%h.generic), TS_COMMON)"
|
||||
" ? ((union lang_tree_node *) TREE_CHAIN (&%h.generic)) : NULL")))
|
||||
lang_tree_node
|
||||
{
|
||||
union tree_node GTY ((tag ("TS_D_GENERIC"),
|
||||
desc ("tree_node_structure (&%h)"))) generic;
|
||||
lang_identifier GTY ((tag ("TS_D_IDENTIFIER"))) identifier;
|
||||
tree_frame_info GTY ((tag ("TS_D_FRAMEINFO"))) frameinfo;
|
||||
};
|
||||
|
||||
/* True if the Tdelegate typed expression is not really a variable,
|
||||
but a literal function / method reference. */
|
||||
#define METHOD_CALL_EXPR(NODE) \
|
||||
(TREE_LANG_FLAG_0 (NODE))
|
||||
|
||||
/* True if all arguments in a call expression should be evaluated in the
|
||||
order they are given (left to right). */
|
||||
#define CALL_EXPR_ARGS_ORDERED(NODE) \
|
||||
(TREE_LANG_FLAG_1 (CALL_EXPR_CHECK (NODE)))
|
||||
|
||||
/* True if the type was declared 'shared'. */
|
||||
#define TYPE_SHARED(NODE) \
|
||||
(TYPE_LANG_FLAG_0 (NODE))
|
||||
|
||||
/* True if the type is an imaginary float type. */
|
||||
#define TYPE_IMAGINARY_FLOAT(NODE) \
|
||||
(TYPE_LANG_FLAG_1 (REAL_TYPE_CHECK (NODE)))
|
||||
|
||||
/* True if the type is an anonymous record or union. */
|
||||
#define ANON_AGGR_TYPE_P(NODE) \
|
||||
(TYPE_LANG_FLAG_1 (RECORD_OR_UNION_CHECK (NODE)))
|
||||
|
||||
/* True if the type is the underlying record for a class. */
|
||||
#define CLASS_TYPE_P(NODE) \
|
||||
(TYPE_LANG_FLAG_2 (RECORD_TYPE_CHECK (NODE)))
|
||||
|
||||
/* True if the type is a D dynamic array. */
|
||||
#define TYPE_DYNAMIC_ARRAY(NODE) \
|
||||
(TYPE_LANG_FLAG_3 (RECORD_TYPE_CHECK (NODE)))
|
||||
|
||||
/* True if the type is a D delegate. */
|
||||
#define TYPE_DELEGATE(NODE) \
|
||||
(TYPE_LANG_FLAG_4 (RECORD_TYPE_CHECK (NODE)))
|
||||
|
||||
/* True if the type is a D associative array. */
|
||||
#define TYPE_ASSOCIATIVE_ARRAY(NODE) \
|
||||
(TYPE_LANG_FLAG_5 (RECORD_TYPE_CHECK (NODE)))
|
||||
|
||||
/* True if the decl is a variable case label decl. */
|
||||
#define LABEL_VARIABLE_CASE(NODE) \
|
||||
(DECL_LANG_FLAG_0 (LABEL_DECL_CHECK (NODE)))
|
||||
|
||||
/* True if the decl is a CTFE built-in. */
|
||||
#define DECL_BUILT_IN_CTFE(NODE) \
|
||||
(DECL_LANG_FLAG_0 (FUNCTION_DECL_CHECK (NODE)))
|
||||
|
||||
enum d_tree_index
|
||||
{
|
||||
DTI_VTABLE_ENTRY_TYPE,
|
||||
DTI_VTBL_PTR_TYPE,
|
||||
DTI_VTBL_INTERFACE_TYPE,
|
||||
|
||||
DTI_BOOL_TYPE,
|
||||
DTI_CHAR_TYPE,
|
||||
DTI_WCHAR_TYPE,
|
||||
DTI_DCHAR_TYPE,
|
||||
|
||||
DTI_BYTE_TYPE,
|
||||
DTI_UBYTE_TYPE,
|
||||
DTI_SHORT_TYPE,
|
||||
DTI_USHORT_TYPE,
|
||||
DTI_INT_TYPE,
|
||||
DTI_UINT_TYPE,
|
||||
DTI_LONG_TYPE,
|
||||
DTI_ULONG_TYPE,
|
||||
DTI_CENT_TYPE,
|
||||
DTI_UCENT_TYPE,
|
||||
|
||||
DTI_IFLOAT_TYPE,
|
||||
DTI_IDOUBLE_TYPE,
|
||||
DTI_IREAL_TYPE,
|
||||
|
||||
DTI_UNKNOWN_TYPE,
|
||||
|
||||
DTI_ARRAY_TYPE,
|
||||
DTI_NULL_ARRAY,
|
||||
|
||||
DTI_MAX
|
||||
};
|
||||
|
||||
extern GTY(()) tree d_global_trees[DTI_MAX];
|
||||
|
||||
#define vtable_entry_type d_global_trees[DTI_VTABLE_ENTRY_TYPE]
|
||||
#define vtbl_ptr_type_node d_global_trees[DTI_VTBL_PTR_TYPE]
|
||||
#define vtbl_interface_type_node d_global_trees[DTI_VTBL_INTERFACE_TYPE]
|
||||
/* D built-in language types. */
|
||||
#define d_bool_type d_global_trees[DTI_BOOL_TYPE]
|
||||
#define d_byte_type d_global_trees[DTI_BYTE_TYPE]
|
||||
#define d_ubyte_type d_global_trees[DTI_UBYTE_TYPE]
|
||||
#define d_short_type d_global_trees[DTI_SHORT_TYPE]
|
||||
#define d_ushort_type d_global_trees[DTI_USHORT_TYPE]
|
||||
#define d_int_type d_global_trees[DTI_INT_TYPE]
|
||||
#define d_uint_type d_global_trees[DTI_UINT_TYPE]
|
||||
#define d_long_type d_global_trees[DTI_LONG_TYPE]
|
||||
#define d_ulong_type d_global_trees[DTI_ULONG_TYPE]
|
||||
#define d_cent_type d_global_trees[DTI_CENT_TYPE]
|
||||
#define d_ucent_type d_global_trees[DTI_UCENT_TYPE]
|
||||
/* Imaginary floating-point types. */
|
||||
#define ifloat_type_node d_global_trees[DTI_IFLOAT_TYPE]
|
||||
#define idouble_type_node d_global_trees[DTI_IDOUBLE_TYPE]
|
||||
#define ireal_type_node d_global_trees[DTI_IREAL_TYPE]
|
||||
/* UTF-8, 16 and 32 types. */
|
||||
#define char8_type_node d_global_trees[DTI_CHAR_TYPE]
|
||||
#define char16_type_node d_global_trees[DTI_DCHAR_TYPE]
|
||||
#define char32_type_node d_global_trees[DTI_WCHAR_TYPE]
|
||||
/* Empty record type used as placeholder when real type is unknown. */
|
||||
#define unknown_type_node d_global_trees[DTI_UNKNOWN_TYPE]
|
||||
/* Generic dynamic array type void[]. */
|
||||
#define array_type_node d_global_trees[DTI_ARRAY_TYPE]
|
||||
/* Null initializer for dynamic arrays. */
|
||||
#define null_array_node d_global_trees[DTI_NULL_ARRAY]
|
||||
|
||||
/* A prefix for internal variables, which are not user-visible. */
|
||||
#if !defined (NO_DOT_IN_LABEL)
|
||||
# define GDC_PREFIX(x) "gdc." x
|
||||
#elif !defined (NO_DOLLAR_IN_LABEL)
|
||||
# define GDC_PREFIX(x) "gdc$" x
|
||||
#else
|
||||
# define GDC_PREFIX(x) "gdc_" x
|
||||
#endif
|
||||
|
||||
/* Internally recognised D runtime library functions. */
|
||||
|
||||
enum libcall_fn
|
||||
{
|
||||
#define DEF_D_RUNTIME(CODE, N, T, P, F) LIBCALL_ ## CODE,
|
||||
|
||||
#include "runtime.def"
|
||||
|
||||
#undef DEF_D_RUNTIME
|
||||
LIBCALL_LAST
|
||||
};
|
||||
|
||||
/* Gate for when the D frontend makes an early call into the codegen pass, such
|
||||
as when it requires target information or CTFE evaluation. As full semantic
|
||||
may not be completed, we only want to build the superficial tree structure
|
||||
without finishing any decls or types. */
|
||||
extern bool doing_semantic_analysis_p;
|
||||
|
||||
/* In d-attribs.c. */
|
||||
extern tree insert_type_attribute (tree, const char *, tree = NULL_TREE);
|
||||
extern tree insert_decl_attribute (tree, const char *, tree = NULL_TREE);
|
||||
extern tree build_attributes (Expressions *);
|
||||
|
||||
/* In d-builtins.cc. */
|
||||
extern const attribute_spec d_langhook_attribute_table[];
|
||||
extern const attribute_spec d_langhook_common_attribute_table[];
|
||||
|
||||
extern tree d_builtin_function (tree);
|
||||
extern void d_init_builtins (void);
|
||||
extern void d_register_builtin_type (tree, const char *);
|
||||
extern void d_build_builtins_module (Module *);
|
||||
extern void d_maybe_set_builtin (Module *);
|
||||
extern Expression *d_eval_constant_expression (tree);
|
||||
extern void d_init_versions (void);
|
||||
|
||||
/* In d-codegen.cc. */
|
||||
extern location_t make_location_t (const Loc &);
|
||||
extern tree d_decl_context (Dsymbol *);
|
||||
extern tree copy_aggregate_type (tree);
|
||||
extern bool declaration_reference_p (Declaration *);
|
||||
extern tree declaration_type (Declaration *);
|
||||
extern bool argument_reference_p (Parameter *);
|
||||
extern tree type_passed_as (Parameter *);
|
||||
extern tree build_integer_cst (dinteger_t, tree = d_int_type);
|
||||
extern tree build_float_cst (const real_t &, Type *);
|
||||
extern tree d_array_length (tree);
|
||||
extern tree d_array_ptr (tree);
|
||||
extern tree d_array_value (tree, tree, tree);
|
||||
extern tree get_array_length (tree, Type *);
|
||||
extern tree build_class_binfo (tree, ClassDeclaration *);
|
||||
extern tree build_interface_binfo (tree, ClassDeclaration *, unsigned &);
|
||||
extern tree delegate_method (tree);
|
||||
extern tree delegate_object (tree);
|
||||
extern tree build_delegate_cst (tree, tree, Type *);
|
||||
extern tree build_method_call (tree, tree, Type *);
|
||||
extern void extract_from_method_call (tree, tree &, tree &);
|
||||
extern tree build_vindex_ref (tree, tree, size_t);
|
||||
extern tree d_save_expr (tree);
|
||||
extern tree stabilize_expr (tree *);
|
||||
extern tree build_target_expr (tree, tree);
|
||||
extern tree force_target_expr (tree);
|
||||
extern tree build_address (tree);
|
||||
extern tree d_mark_addressable (tree);
|
||||
extern tree d_mark_used (tree);
|
||||
extern tree d_mark_read (tree);
|
||||
extern bool identity_compare_p (StructDeclaration *);
|
||||
extern tree build_struct_comparison (tree_code, StructDeclaration *,
|
||||
tree, tree);
|
||||
extern tree build_array_struct_comparison (tree_code, StructDeclaration *,
|
||||
tree, tree, tree);
|
||||
extern tree build_struct_literal (tree, vec<constructor_elt, va_gc> *);
|
||||
extern tree component_ref (tree, tree);
|
||||
extern tree build_assign (tree_code, tree, tree);
|
||||
extern tree modify_expr (tree, tree);
|
||||
extern tree build_nop (tree, tree);
|
||||
extern tree build_vconvert (tree, tree);
|
||||
extern tree build_boolop (tree_code, tree, tree);
|
||||
extern tree build_condition (tree, tree, tree, tree);
|
||||
extern tree build_vcondition (tree, tree, tree);
|
||||
extern tree compound_expr (tree, tree);
|
||||
extern tree return_expr (tree);
|
||||
extern tree size_mult_expr (tree, tree);
|
||||
extern tree real_part (tree);
|
||||
extern tree imaginary_part (tree);
|
||||
extern tree complex_expr (tree, tree, tree);
|
||||
extern tree indirect_ref (tree, tree);
|
||||
extern tree build_deref (tree);
|
||||
extern tree build_array_index (tree, tree);
|
||||
extern tree build_offset_op (tree_code, tree, tree);
|
||||
extern tree build_offset (tree, tree);
|
||||
extern tree build_memref (tree, tree, tree);
|
||||
extern tree build_array_set (tree, tree, tree);
|
||||
extern tree build_array_from_val (Type *, tree);
|
||||
extern tree void_okay_p (tree);
|
||||
extern tree build_bounds_condition (const Loc &, tree, tree, bool);
|
||||
extern bool array_bounds_check (void);
|
||||
extern tree create_temporary_var (tree);
|
||||
extern tree maybe_temporary_var (tree, tree *);
|
||||
extern tree bind_expr (tree, tree);
|
||||
extern TypeFunction *get_function_type (Type *);
|
||||
extern bool call_by_alias_p (FuncDeclaration *, FuncDeclaration *);
|
||||
extern tree d_build_call_expr (FuncDeclaration *, tree, Expressions *);
|
||||
extern tree d_build_call (TypeFunction *, tree, tree, Expressions *);
|
||||
extern tree d_assert_call (const Loc &, libcall_fn, tree = NULL_TREE);
|
||||
extern tree build_float_modulus (tree, tree, tree);
|
||||
extern tree build_vthis_function (tree, tree);
|
||||
extern tree get_frame_for_symbol (Dsymbol *);
|
||||
extern tree build_vthis (AggregateDeclaration *);
|
||||
extern void build_closure (FuncDeclaration *);
|
||||
extern tree get_frameinfo (FuncDeclaration *);
|
||||
extern tree get_framedecl (FuncDeclaration *, FuncDeclaration *);
|
||||
|
||||
/* In d-convert.cc. */
|
||||
extern bool decl_with_nonnull_addr_p (const_tree);
|
||||
extern tree d_truthvalue_conversion (tree);
|
||||
extern tree d_convert (tree, tree);
|
||||
extern tree convert_expr (tree, Type *, Type *);
|
||||
extern tree convert_for_assignment (tree, Type *, Type *);
|
||||
extern tree convert_for_argument (tree, Parameter *);
|
||||
extern tree convert_for_condition (tree, Type *);
|
||||
extern tree d_array_convert (Expression *);
|
||||
extern tree d_array_convert (Type *, Expression *, vec<tree, va_gc> **);
|
||||
|
||||
/* In d-incpath.cc. */
|
||||
extern void add_import_paths (const char *, const char *, bool);
|
||||
|
||||
/* In d-lang.cc. */
|
||||
extern void d_add_builtin_module (Module *);
|
||||
extern void d_add_entrypoint_module (Module *, Module *);
|
||||
extern d_tree_node_structure_enum d_tree_node_structure (lang_tree_node *);
|
||||
extern struct lang_type *build_lang_type (Type *);
|
||||
extern struct lang_decl *build_lang_decl (Declaration *);
|
||||
extern tree d_pushdecl (tree);
|
||||
extern tree d_unsigned_type (tree);
|
||||
extern tree d_signed_type (tree);
|
||||
extern void d_keep (tree);
|
||||
|
||||
/* In decl.cc. */
|
||||
extern tree mangle_internal_decl (Dsymbol *, const char *, const char *);
|
||||
extern void build_decl_tree (Dsymbol *);
|
||||
extern tree get_symbol_decl (Declaration *);
|
||||
extern tree declare_extern_var (tree, tree);
|
||||
extern void declare_local_var (VarDeclaration *);
|
||||
extern tree build_local_temp (tree);
|
||||
extern tree get_decl_tree (Declaration *);
|
||||
extern void d_finish_decl (tree);
|
||||
extern tree make_thunk (FuncDeclaration *, int);
|
||||
extern tree start_function (FuncDeclaration *);
|
||||
extern void finish_function (tree);
|
||||
extern void mark_needed (tree);
|
||||
extern unsigned base_vtable_offset (ClassDeclaration *, BaseClass *);
|
||||
extern tree get_vtable_decl (ClassDeclaration *);
|
||||
extern tree build_new_class_expr (ClassReferenceExp *);
|
||||
extern tree aggregate_initializer_decl (AggregateDeclaration *);
|
||||
extern tree layout_struct_initializer (StructDeclaration *);
|
||||
extern tree layout_class_initializer (ClassDeclaration *);
|
||||
extern tree enum_initializer_decl (EnumDeclaration *);
|
||||
extern tree build_artificial_decl (tree, tree, const char * = NULL);
|
||||
extern tree create_field_decl (tree, const char *, int, int);
|
||||
extern void build_type_decl (tree, Dsymbol *);
|
||||
extern void d_comdat_linkage (tree);
|
||||
extern void d_linkonce_linkage (tree);
|
||||
|
||||
/* In expr.cc. */
|
||||
extern tree build_expr (Expression *, bool = false);
|
||||
extern tree build_expr_dtor (Expression *);
|
||||
extern tree build_return_dtor (Expression *, Type *, TypeFunction *);
|
||||
|
||||
/* In imports.cc. */
|
||||
extern tree build_import_decl (Dsymbol *);
|
||||
|
||||
/* In intrinsics.cc. */
|
||||
extern void maybe_set_intrinsic (FuncDeclaration *);
|
||||
extern tree maybe_expand_intrinsic (tree);
|
||||
|
||||
/* In modules.cc. */
|
||||
extern void build_module_tree (Module *);
|
||||
extern tree d_module_context (void);
|
||||
extern void register_module_decl (Declaration *);
|
||||
extern void d_finish_compilation (tree *, int);
|
||||
|
||||
/* In runtime.cc. */
|
||||
extern tree build_libcall (libcall_fn, Type *, int ...);
|
||||
|
||||
/* In typeinfo.cc. */
|
||||
extern tree layout_typeinfo (TypeInfoDeclaration *);
|
||||
extern tree layout_classinfo (ClassDeclaration *);
|
||||
extern tree get_typeinfo_decl (TypeInfoDeclaration *);
|
||||
extern tree get_classinfo_decl (ClassDeclaration *);
|
||||
extern tree build_typeinfo (Type *);
|
||||
extern void create_typeinfo (Type *, Module *);
|
||||
extern void create_tinfo_types (Module *);
|
||||
extern void layout_cpp_typeinfo (ClassDeclaration *);
|
||||
extern tree get_cpp_typeinfo_decl (ClassDeclaration *);
|
||||
extern bool speculative_type_p (Type *);
|
||||
|
||||
/* In toir.cc. */
|
||||
extern void push_binding_level (level_kind);
|
||||
extern tree pop_binding_level (void);
|
||||
extern void push_stmt_list (void);
|
||||
extern tree pop_stmt_list (void);
|
||||
extern void add_stmt (tree);
|
||||
extern void build_function_body (FuncDeclaration *);
|
||||
|
||||
/* In types.cc. */
|
||||
extern bool valist_array_p (Type *);
|
||||
extern bool empty_aggregate_p (tree);
|
||||
extern bool same_type_p (Type *, Type *);
|
||||
extern Type *get_object_type (void);
|
||||
extern tree make_array_type (Type *, unsigned HOST_WIDE_INT);
|
||||
extern tree make_struct_type (const char *, int n, ...);
|
||||
extern tree insert_type_modifiers (tree, unsigned);
|
||||
extern void insert_aggregate_field (tree, tree, size_t);
|
||||
extern void finish_aggregate_type (unsigned, unsigned, tree,
|
||||
UserAttributeDeclaration *);
|
||||
extern tree build_ctype (Type *);
|
||||
|
||||
#endif /* GCC_D_TREE_H */
|
2312
gcc/d/decl.cc
Normal file
2312
gcc/d/decl.cc
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user