summaryrefslogtreecommitdiff
path: root/libphobos
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2020-04-13 11:25:26 +0200
committerIain Buclaw <ibuclaw@gdcproject.org>2020-04-13 11:35:28 +0200
commita1ccbae63cdf25b8ff66da18ed0d081cb9411ccf (patch)
tree5c0266feb2fee3b909db9586eebd8bc8a9afc560 /libphobos
parentaf4c92573dc462a17a6c345756889d28054ed591 (diff)
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 <ibuclaw@gdcproject.org> * Make-lang.in (D_FRONTEND_OBJS): Remove d/argtypes.o. * d-target.cc (Target::toArgTypes): New function. libphobos/ChangeLog: 2020-04-13 Iain Buclaw <ibuclaw@gdcproject.org> * libdruntime/core/stdc/stdarg.d: Remove run-time va_list template.
Diffstat (limited to 'libphobos')
-rw-r--r--libphobos/ChangeLog4
-rw-r--r--libphobos/libdruntime/core/stdc/stdarg.d160
2 files changed, 4 insertions, 160 deletions
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 <ibuclaw@gdcproject.org>
+
+ * libdruntime/core/stdc/stdarg.d: Remove run-time va_list template.
+
2020-04-10 Iain Buclaw <ibuclaw@gdcproject.org>
* 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**) &ap;
- 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.
*/