From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3oq-iXggKCocr02zntolrzzrwp.nzxwtmlmtrltw3z52np7l2p.z2r@flex--gprocida.bounces.google.com> Received: from mail-wm1-x349.google.com (mail-wm1-x349.google.com [IPv6:2a00:1450:4864:20::349]) by sourceware.org (Postfix) with ESMTPS id A600B38930E1 for ; Fri, 24 Apr 2020 09:21:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A600B38930E1 Received: by mail-wm1-x349.google.com with SMTP id 71so3935470wmb.8 for ; Fri, 24 Apr 2020 02:21:39 -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:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=DN3meFVdZsY56zlG2jgIACAP7mwhgfPJyPHKJW5n82Q=; b=JN87nl811ILNAjpM3DS7fvLYpIf6FzPwsyX1Z9ogkcnPZmoDrkScwsYvZfs/A9MCSR aHJQreTc721f5EU/AZSdQNURPOwCVYJqwLp7hVgeWPR7jV1Zc1X9PlMZ5x1tn5eJ9rbo gaTcmbrkcVp0AT9nQGcmOFX5G+s19vLGOhzV8H3VVMsSksQ5fDTxziMoOXFX7yMKbGEr azCfVDtDPPbZajemEtB1z5MBJ9YTcphOKPeaH9jOJtoy1ulcGH61F2TVO6Gz8jL3EX9A 6FH+UzApjJy+J1cc4xauaN09uVEO+LMWCePUcFrQO3lV2UGbfkgGqeV08lqZUMBt3g/E o5Wg== X-Gm-Message-State: AGi0PuaBetyLD2bYCkwDzzUZvtW7QZa5BmwnI2LRWcViKkqnkarGI/IK zd0HFTAanQYLYcd6djQ6ceKUGWa7RVMhUE5W7nzKFL5YJuPpAMOWJVmtSS47HO6lOydgyR+prJE XT6hhzjNKJWm2EcldYlFnf9wL6vHZCyBg+bhTjPWm5lDfcCkNVo4OSBt2zk4ELRq8AlZCjTE= X-Google-Smtp-Source: APiQypLtAwUSU1ZVWivR258phZqjTgBKR0nlB79QltLUVIKeY9ePKJOhgQmiqkaHWokX6oNvz1p2XX3i4TV28g== X-Received: by 2002:adf:b344:: with SMTP id k4mr9620916wrd.76.1587720098468; Fri, 24 Apr 2020 02:21:38 -0700 (PDT) Date: Fri, 24 Apr 2020 10:21:11 +0100 In-Reply-To: <20200423154441.170531-1-gprocida@google.com> Message-Id: <20200424092132.150547-1-gprocida@google.com> Mime-Version: 1.0 References: <20200423154441.170531-1-gprocida@google.com> X-Mailer: git-send-email 2.26.2.303.gf8c07b1a785-goog Subject: [PATCH v3 00/21]Simplify regex and suppression parsing. 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=-23.5 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_2, 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: Libabigail mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Apr 2020 09:21:43 -0000 This patch series takes the suppression parsing very close to where it can be translated into a table-driven format. It is mostly a series of simplifications which are useful in their own right. I have tried to keep each commit doing exactly one thing, to make reviewing easier. These changes are not pure refactorings: Escape names used in symbol whitelisting regex. diff suppression: Fix handling of change kinds abg-tools-utils.cc: Assert generated regexes OK. Warn if user-supplied regexes fail to compile. The rest should be. Regards, Giuliano. Giuliano Procida (21): Move regex definitions to own files. Move libxml bits out of abg-sptr-utils.h. Simplify generation of symbol whitelist regex. Escape names used in symbol whitelisting regex. abg-suppression.cc: More uniform variable naming. diff suppression: Fix handling of change kinds. Add POSIX regex wrapper functions. Use regex::compile wrapper instead of regcomp. Use regex::match wrapper instead of regexec. Refactor read_parameter_spec_from_string logic. Compile suppression regexes earlier. Reduce direct access to suppression priv_ members. Move match methods from priv to suppression_base. Remove suppression types' priv class methods. abg-suppression.cc: More consistent regex matching. abg-tools-utils.cc: Assert generated regexes OK. Refactor suppression property string parsing. Refactor suppression property regex parsing. Warn if user-supplied regexes fail to compile. Default construct suppression types. Remove unused suppression type priv constructors. include/Makefile.am | 3 +- include/abg-libxml-utils.h | 21 +- src/abg-sptr-utils.cc => include/abg-regex.h | 73 +- include/abg-sptr-utils.h | 66 +- include/abg-suppression.h | 182 +- src/Makefile.am | 2 +- src/abg-corpus-priv.h | 37 +- src/abg-corpus.cc | 2 +- src/abg-dwarf-reader.cc | 4 +- src/abg-reader.cc | 4 +- src/abg-regex.cc | 147 ++ src/abg-suppression-priv.h | 723 +------- src/abg-suppression.cc | 1608 +++++++---------- src/abg-tools-utils.cc | 26 +- .../test15-suppr-added-fn-report-5.txt | 6 +- .../test16-suppr-removed-fn-report-5.txt | 15 +- .../test17-suppr-added-var-report-5.txt | 15 +- .../test18-suppr-removed-var-report-5.txt | 15 +- tests/test-kmi-whitelist.cc | 70 +- 19 files changed, 1065 insertions(+), 1954 deletions(-) rename src/abg-sptr-utils.cc => include/abg-regex.h (51%) create mode 100644 src/abg-regex.cc -- 2.26.2.303.gf8c07b1a785-goog