From 495ced03606dec44ec380e2c753919de5f2f8104 Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Thu, 4 May 2017 21:54:31 +0200 Subject: [PATCH] Remove IN_GCC code for xopCmp/xopEquals in compiler and library --- gcc/d/dfrontend/clone.c | 4 ---- libphobos/libdruntime/object.d | 14 ++------------ 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/gcc/d/dfrontend/clone.c b/gcc/d/dfrontend/clone.c index 39a85e39a..4e3aa77db 100644 --- a/gcc/d/dfrontend/clone.c +++ b/gcc/d/dfrontend/clone.c @@ -652,11 +652,7 @@ FuncDeclaration *buildXopCmp(StructDeclaration *sd, Scope *sc) fop->generated = true; Expression *e1 = new IdentifierExp(loc, Id::p); Expression *e2 = new IdentifierExp(loc, Id::q); -#ifdef IN_GCC - Expression *e = new CallExp(loc, new DotIdExp(loc, e1, Id::cmp), e2); -#else Expression *e = new CallExp(loc, new DotIdExp(loc, e2, Id::cmp), e1); -#endif fop->fbody = new ReturnStatement(loc, e); diff --git a/libphobos/libdruntime/object.d b/libphobos/libdruntime/object.d index 85114b29a..8414896f9 100644 --- a/libphobos/libdruntime/object.d +++ b/libphobos/libdruntime/object.d @@ -1127,12 +1127,7 @@ class TypeInfo_Struct : TypeInfo return false; else if (xopEquals) { - version(GNU) - { // BUG: GDC and DMD use different calling conventions - return (*xopEquals)(p2, p1); - } - else - return (*xopEquals)(p1, p2); + return (*xopEquals)(p1, p2); } else if (p1 == p2) return true; @@ -1154,12 +1149,7 @@ class TypeInfo_Struct : TypeInfo return true; else if (xopCmp) { - version(GNU) - { // BUG: GDC and DMD use different calling conventions - return (*xopCmp)(p1, p2); - } - else - return (*xopCmp)(p2, p1); + return (*xopCmp)(p2, p1); } else // BUG: relies on the GC not moving objects