From: Tankut Baris Aktemur Date: Tue, 14 Nov 2023 14:00:49 +0000 (+0100) Subject: gdb: refactor make-target-delegates.py's ARGTYPES X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c7be5fa993b26d7d398755cac4fad6f05dc19910;p=binutils-gdb.git gdb: refactor make-target-delegates.py's ARGTYPES Refactor the ARGTYPES regular expression in make-target-delegates.py to eliminate '.*' for better control on what is matched. Also, simplify the "E" match group, for which the optional SYMBOL becomes redundant because that case can be matched by the "T" group. After applying this patch, running './make-target-delegates.py' does not change anything in 'target-delegates.c'. Approved-By: Pedro Alves --- diff --git a/gdb/make-target-delegates.py b/gdb/make-target-delegates.py index 5bbe7c0b930..fd5f436a43d 100755 --- a/gdb/make-target-delegates.py +++ b/gdb/make-target-delegates.py @@ -73,17 +73,18 @@ METHOD = re.compile( + METHOD_TRAILER ) +# Space-separated symbols. +CP_SYMBOLS = CP_SYMBOL + r"(\s+" + CP_SYMBOL + r")*" + # Regular expression used to dissect argument types. ARGTYPES = re.compile( "^(" + r"(?Penum\s+" + SYMBOL - + r"\s*)(" - + SYMBOL - + ")?" - + r"|(?P.*(enum\s+)?" - + SYMBOL - + r".*(\s|\*|&))" + + r")" + + r"|(?P" + + CP_SYMBOLS + + r"(\s|\*|&)+)" + SYMBOL + ")$" )