From a1ccbae63cdf25b8ff66da18ed0d081cb9411ccf Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Mon, 13 Apr 2020 11:25:26 +0200 Subject: d: Merge update dmd 799066f49 Removes the implementation of __traits(argTypes), which only supported x86_64 targets. The only use of this trait is an unused va_arg() function, this has been removed as well. Reviewed-on: https://github.com/dlang/dmd/pull/11022 gcc/d/ChangeLog: 2020-04-13 Iain Buclaw * Make-lang.in (D_FRONTEND_OBJS): Remove d/argtypes.o. * d-target.cc (Target::toArgTypes): New function. libphobos/ChangeLog: 2020-04-13 Iain Buclaw * libdruntime/core/stdc/stdarg.d: Remove run-time va_list template. --- libphobos/ChangeLog | 4 + libphobos/libdruntime/core/stdc/stdarg.d | 160 ------------------------------- 2 files changed, 4 insertions(+), 160 deletions(-) (limited to 'libphobos') diff --git a/libphobos/ChangeLog b/libphobos/ChangeLog index 653f48115bd..e6eec480b1f 100644 --- a/libphobos/ChangeLog +++ b/libphobos/ChangeLog @@ -1,3 +1,7 @@ +2020-04-13 Iain Buclaw + + * libdruntime/core/stdc/stdarg.d: Remove run-time va_list template. + 2020-04-10 Iain Buclaw * d_rules.am (libdgruntime_la_LINK): Move to libdruntime/Makefile.am. diff --git a/libphobos/libdruntime/core/stdc/stdarg.d b/libphobos/libdruntime/core/stdc/stdarg.d index 613138f968e..586fe20d991 100644 --- a/libphobos/libdruntime/core/stdc/stdarg.d +++ b/libphobos/libdruntime/core/stdc/stdarg.d @@ -50,166 +50,6 @@ version (GNU) void va_arg(T)(ref va_list ap, ref T parmn); - /************* - * Retrieve and store through parmn the next value that is of TypeInfo ti. - * Used when the static type is not known. - */ - version (X86) - { - /// - void va_arg()(ref va_list ap, TypeInfo ti, void* parmn) - { - auto p = ap; - auto tsize = ti.tsize; - ap = cast(va_list)(cast(size_t)p + ((tsize + size_t.sizeof - 1) & ~(size_t.sizeof - 1))); - parmn[0..tsize] = p[0..tsize]; - } - } - else version (X86_64) - { - /// Layout of this struct must match __builtin_va_list for C ABI compatibility - struct __va_list - { - uint offset_regs = 6 * 8; // no regs - uint offset_fpregs = 6 * 8 + 8 * 16; // no fp regs - void* stack_args; - void* reg_args; - } - - /// - void va_arg()(ref va_list apx, TypeInfo ti, void* parmn) - { - __va_list* ap = cast(__va_list*)apx; - TypeInfo arg1, arg2; - if (!ti.argTypes(arg1, arg2)) - { - bool inXMMregister(TypeInfo arg) pure nothrow @safe - { - return (arg.flags & 2) != 0; - } - - TypeInfo_Vector v1 = arg1 ? cast(TypeInfo_Vector)arg1 : null; - if (arg1 && (arg1.tsize() <= 8 || v1)) - { // Arg is passed in one register - auto tsize = arg1.tsize(); - void* p; - bool stack = false; - auto offset_fpregs_save = ap.offset_fpregs; - auto offset_regs_save = ap.offset_regs; - L1: - if (inXMMregister(arg1) || v1) - { // Passed in XMM register - if (ap.offset_fpregs < (6 * 8 + 16 * 8) && !stack) - { - p = ap.reg_args + ap.offset_fpregs; - ap.offset_fpregs += 16; - } - else - { - p = ap.stack_args; - ap.stack_args += (tsize + size_t.sizeof - 1) & ~(size_t.sizeof - 1); - stack = true; - } - } - else - { // Passed in regular register - if (ap.offset_regs < 6 * 8 && !stack) - { - p = ap.reg_args + ap.offset_regs; - ap.offset_regs += 8; - } - else - { - p = ap.stack_args; - ap.stack_args += 8; - stack = true; - } - } - parmn[0..tsize] = p[0..tsize]; - - if (arg2) - { - if (inXMMregister(arg2)) - { // Passed in XMM register - if (ap.offset_fpregs < (6 * 8 + 16 * 8) && !stack) - { - p = ap.reg_args + ap.offset_fpregs; - ap.offset_fpregs += 16; - } - else - { - if (!stack) - { // arg1 is really on the stack, so rewind and redo - ap.offset_fpregs = offset_fpregs_save; - ap.offset_regs = offset_regs_save; - stack = true; - goto L1; - } - p = ap.stack_args; - ap.stack_args += (arg2.tsize() + size_t.sizeof - 1) & ~(size_t.sizeof - 1); - } - } - else - { // Passed in regular register - if (ap.offset_regs < 6 * 8 && !stack) - { - p = ap.reg_args + ap.offset_regs; - ap.offset_regs += 8; - } - else - { - if (!stack) - { // arg1 is really on the stack, so rewind and redo - ap.offset_fpregs = offset_fpregs_save; - ap.offset_regs = offset_regs_save; - stack = true; - goto L1; - } - p = ap.stack_args; - ap.stack_args += 8; - } - } - auto sz = ti.tsize() - 8; - (parmn + 8)[0..sz] = p[0..sz]; - } - } - else - { // Always passed in memory - // The arg may have more strict alignment than the stack - auto talign = ti.talign(); - auto tsize = ti.tsize(); - auto p = cast(void*)((cast(size_t)ap.stack_args + talign - 1) & ~(talign - 1)); - ap.stack_args = cast(void*)(cast(size_t)p + ((tsize + size_t.sizeof - 1) & ~(size_t.sizeof - 1))); - parmn[0..tsize] = p[0..tsize]; - } - } - else - { - assert(false, "not a valid argument type for va_arg"); - } - } - } - else version (ARM) - { - /// - void va_arg()(ref va_list ap, TypeInfo ti, void* parmn) - { - auto p = *cast(void**) ≈ - auto tsize = ti.tsize(); - *cast(void**) &ap += ( tsize + size_t.sizeof - 1 ) & ~( size_t.sizeof - 1 ); - parmn[0..tsize] = p[0..tsize]; - } - } - else - { - /// - void va_arg()(ref va_list ap, TypeInfo ti, void* parmn) - { - static assert(false, "Unsupported platform"); - } - } - - /*********************** * End use of ap. */ -- cgit v1.2.3