From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3k5cFXwgKCtY8HJG4A528GG8D6.4GEDA323A82ADKGMJ46O2J6.GJ8@flex--gprocida.bounces.google.com> Received: from mail-wr1-x449.google.com (mail-wr1-x449.google.com [IPv6:2a00:1450:4864:20::449]) by sourceware.org (Postfix) with ESMTPS id 0A530386180A for ; Wed, 8 Jul 2020 09:53:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0A530386180A Received: by mail-wr1-x449.google.com with SMTP id j3so31819478wrq.9 for ; Wed, 08 Jul 2020 02:53:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=fteoleL+bsc+y9O10q6YfIkGV77ZocH8hSOtU8mWYjE=; b=euuBrt2eTVMsMFTrIvPmmAaT2XnSKTaDer0TYcm/7WwN0jZq/yRVkXvETrtdh7K0d/ MMZ3oqRYhI8WOGn+kd+v/S/wCKIJAZuQ609D/3IKv+t7hp6IzgJCX+v/A8GAo+5RghQV GAhRsYXsabW0XzIT2jbMbJ130fuykDUmBHecRb5N4/guw3BXyTd9nxMxBJiIpSEIVBeK XF28FmpefSN4qxqwJSFiyUTGrwnOJh8oHDn1srFDCAPAlDQlSnrVj7zsfOQPOiaK+Vyn gx2ufcslpI8QUBBLllzZaQGQHRDSkWlt4KStqbbfDmYy0n5A00C4DUrI/M/4avOGiK7f DEkw== X-Gm-Message-State: AOAM5335Hou45kUEvuY8bU6w/2veW2fBE2hu9Q1LR3pamxKsZvKDkx2v F3vzYN9v9TQ0RkUdodzoAqvYVtVCADFNcgV/vZxEndOcReDduabHTlzVfu0SQJCWAY0zh8mpJHw ZoVj7S+Ti1NGPb4/6//xIF2cHI0YrR4ID2sB9N2u5F5DuFBYw1XDZ+UYukMdUDLE5dOBhDZc= X-Google-Smtp-Source: ABdhPJzU2QnlS2zPj91qY1KYI3aOa3jEG5qwVjNLGgsIKBk8c+L+8hn0g6GxlZDhODc3BM8vYBDZFaqw46FIXA== X-Received: by 2002:a7b:c313:: with SMTP id k19mr8561043wmj.67.1594202003751; Wed, 08 Jul 2020 02:53:23 -0700 (PDT) Date: Wed, 8 Jul 2020 10:53:12 +0100 Message-Id: <20200708095315.948634-1-gprocida@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.27.0.383.g050319c2ae-goog Subject: [PATCH 0/3] Type equality refactor and instrumentation From: Giuliano Procida To: libabigail@sourceware.org Cc: dodji@seketeli.org, kernel-team@android.com, gprocida@google.com, maennich@google.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-18.6 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 09:53:26 -0000 Hi Dodji. This series refactors various operator== methods making their common functionality evident. The first patch is just a prelude to make the second smaller. The second patch does the refactoring. I'm not attached to the name 'equality_helper'. The third patch is not intended for direct inclusion in libabigail but builds on the refactoring to investigate how equality and canonical types work in practice. It identifies some potential discrepancies, but they may be entirely expected. In general, it can be risky to define operator== in a way where reflexivity, symmetry and transitivity do not obviously hold or can be sensitive to small code changes or in way where equality, say for class_decl_sptr, can be affected by something like canonicalisation. More instrumentation could be added to check behaviour. Giuliano Procida (3): abg-ir.cc: Tidy some operator== definitions abg-ir.cc: Refactor operator== methods with helper Add some type equality paranoia. src/abg-ir.cc | 185 +++++++++++++++++++++++++++++--------------------- 1 file changed, 106 insertions(+), 79 deletions(-) -- 2.27.0.383.g050319c2ae-goog