From 8967ee52ea92c865801d6137600e33e4a32cd2ec Mon Sep 17 00:00:00 2001 From: Ghjuvan Lacambre Date: Mon, 21 Jun 2021 11:47:59 +0200 Subject: [Ada] Refactor scan_backend_switch to share logic across backends gcc/ada/ * adabkend.adb (Scan_Back_End_Switches): Replace switch-scanning logic with call to Backend_Utils.Scan_Common_Back_End_Switches. * back_end.adb (Scan_Back_End_Switches): Replace switch-scanning logic with call to Backend_Utils.Scan_Common_Back_End_Switches. * backend_utils.adb: New file. * backend_utils.ads: New file. * gcc-interface/Make-lang.in: Add ada/backend_utils.o. --- gcc/ada/backend_utils.ads | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 gcc/ada/backend_utils.ads (limited to 'gcc/ada/backend_utils.ads') diff --git a/gcc/ada/backend_utils.ads b/gcc/ada/backend_utils.ads new file mode 100644 index 0000000..71321ef --- /dev/null +++ b/gcc/ada/backend_utils.ads @@ -0,0 +1,36 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT COMPILER COMPONENTS -- +-- -- +-- B A C K E N D _ U T I L S -- +-- -- +-- S p e c -- +-- -- +-- Copyright (C) 2021-2021, Free Software Foundation, Inc. -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- +-- for more details. You should have received a copy of the GNU General -- +-- Public License distributed with GNAT; see file COPYING3. If not, go to -- +-- http://www.gnu.org/licenses for a complete copy of the license. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- Procedures and functions used by both the Adabkend and Back_End packages. + +package Backend_Utils is + + function Scan_Common_Back_End_Switch (Switch_Chars : String) return Boolean; + -- Scan back-end switches which are common to all back-ends and have an + -- effect in the front-end. Call Store_Compilation_Switch and return True + -- if Switch_Chars is recognized as a common back end switch. Return False + -- otherwise. + +end Backend_Utils; -- cgit v1.1