From patchwork Thu Jun 17 12:26:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 56029 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id C97E31007D2 for ; Thu, 17 Jun 2010 22:26:51 +1000 (EST) Received: (qmail 5403 invoked by alias); 17 Jun 2010 12:26:46 -0000 Received: (qmail 5315 invoked by uid 22791); 17 Jun 2010 12:26:40 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, TW_PR, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 17 Jun 2010 12:26:31 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 4F45DCB02A9; Thu, 17 Jun 2010 14:26:37 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id d7VEQ1Gf493H; Thu, 17 Jun 2010 14:26:37 +0200 (CEST) Received: from saumur.act-europe.fr (saumur.act-europe.fr [10.10.0.183]) by mel.act-europe.fr (Postfix) with ESMTP id 3A664CB02A7; Thu, 17 Jun 2010 14:26:37 +0200 (CEST) Received: by saumur.act-europe.fr (Postfix, from userid 525) id 42AB5D9AB0; Thu, 17 Jun 2010 14:26:47 +0200 (CEST) Date: Thu, 17 Jun 2010 14:26:47 +0200 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Vincent Celier Subject: [Ada] gnatmake performance enhancement Message-ID: <20100617122647.GA9166@adacore.com> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.9i X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org gnatmake with project files no longer provides an include path file to the compiler, except when -x is specified. There is no functionality change, so no test. Tested on x86_64-pc-linux-gnu, committed on trunk 2010-06-17 Vincent Celier * make.adb (Collect_Arguments_And_Compile): Create include path file only when -x is specified. (Gnatmake): Ditto * opt.ads (Use_Include_Path_File): New Boolean flag, initialized to False. * prj-env.adb (Set_Ada_Paths): New Boolean parameters Include_Path and Objects_Path, defaulted to True. Only create include path file if Include_Path is True, only create objects path file if Objects_Path is True. * prj-env.ads (Set_Ada_Paths): New Boolean parameters Include_Path and Objects_Path, defaulted to True. * switch-m.adb (Scan_Make_Switches): Set Use_Include_Path_File to True when -x is used. Index: make.adb =================================================================== --- make.adb (revision 160834) +++ make.adb (working copy) @@ -2723,7 +2723,8 @@ package body Make is Prj.Env.Set_Ada_Paths (Arguments_Project, Project_Tree, - Including_Libraries => True); + Including_Libraries => True, + Include_Path => Use_Include_Path_File); if not Unique_Compile and then MLib.Tgt.Support_For_Libraries /= Prj.None @@ -6026,7 +6027,8 @@ package body Make is -- and all the object directories in ADA_OBJECTS_PATH, -- except those of library projects. - Prj.Env.Set_Ada_Paths (Main_Project, Project_Tree, False); + Prj.Env.Set_Ada_Paths + (Main_Project, Project_Tree, Use_Include_Path_File); -- If switch -C was specified, create a binder mapping file @@ -6253,7 +6255,11 @@ package body Make is -- Put the object directories in ADA_OBJECTS_PATH - Prj.Env.Set_Ada_Paths (Main_Project, Project_Tree, False); + Prj.Env.Set_Ada_Paths + (Main_Project, + Project_Tree, + Including_Libraries => False, + Include_Path => False); -- Check for attributes Linker'Linker_Options in projects -- other than the main project Index: switch-m.adb =================================================================== --- switch-m.adb (revision 160834) +++ switch-m.adb (working copy) @@ -839,6 +839,7 @@ package body Switch.M is when 'x' => External_Unit_Compilation_Allowed := True; + Use_Include_Path_File := True; -- Processing for z switch Index: opt.ads =================================================================== --- opt.ads (revision 160834) +++ opt.ads (working copy) @@ -1229,6 +1229,11 @@ package Opt is -- set True, and upper half characters in the source indicate the start of -- a wide character sequence. Set by -gnatW or -W switches. + Use_Include_Path_File : Boolean := False; + -- GNATMAKE, GPRBUILD + -- When True, create a source search path file, even when a mapping file + -- is used. + Usage_Requested : Boolean := False; -- GNAT, GNATBIND, GNATMAKE -- Set to True if -h (-gnath for the compiler) switch encountered Index: prj-env.adb =================================================================== --- prj-env.adb (revision 160834) +++ prj-env.adb (working copy) @@ -1498,7 +1498,9 @@ package body Prj.Env is procedure Set_Ada_Paths (Project : Project_Id; In_Tree : Project_Tree_Ref; - Including_Libraries : Boolean) + Including_Libraries : Boolean; + Include_Path : Boolean := True; + Objects_Path : Boolean := True) is Source_Paths : Source_Path_Table.Instance; @@ -1570,7 +1572,7 @@ package body Prj.Env is -- If it is the first time we call this procedure for this project, -- compute the source path and/or the object path. - if Project.Include_Path_File = No_Path then + if Include_Path and then Project.Include_Path_File = No_Path then Source_Path_Table.Init (Source_Paths); Process_Source_Dirs := True; Create_New_Path_File @@ -1580,7 +1582,7 @@ package body Prj.Env is -- For the object path, we make a distinction depending on -- Including_Libraries. - if Including_Libraries then + if Objects_Path and Including_Libraries then if Project.Objects_Path_File_With_Libs = No_Path then Object_Path_Table.Init (Object_Paths); Process_Object_Dirs := True; @@ -1588,7 +1590,7 @@ package body Prj.Env is (In_Tree, Object_FD, Project.Objects_Path_File_With_Libs); end if; - else + elsif Objects_Path then if Project.Objects_Path_File_Without_Libs = No_Path then Object_Path_Table.Init (Object_Paths); Process_Object_Dirs := True; @@ -1662,7 +1664,8 @@ package body Prj.Env is -- Set the env vars, if they need to be changed, and set the -- corresponding flags. - if In_Tree.Private_Part.Current_Source_Path_File /= + if Include_Path and then + In_Tree.Private_Part.Current_Source_Path_File /= Project.Include_Path_File then In_Tree.Private_Part.Current_Source_Path_File := @@ -1672,28 +1675,30 @@ package body Prj.Env is Get_Name_String (In_Tree.Private_Part.Current_Source_Path_File)); end if; - if Including_Libraries then - if In_Tree.Private_Part.Current_Object_Path_File /= - Project.Objects_Path_File_With_Libs - then - In_Tree.Private_Part.Current_Object_Path_File := - Project.Objects_Path_File_With_Libs; - Set_Path_File_Var - (Project_Objects_Path_File, - Get_Name_String - (In_Tree.Private_Part.Current_Object_Path_File)); - end if; + if Objects_Path then + if Including_Libraries then + if In_Tree.Private_Part.Current_Object_Path_File /= + Project.Objects_Path_File_With_Libs + then + In_Tree.Private_Part.Current_Object_Path_File := + Project.Objects_Path_File_With_Libs; + Set_Path_File_Var + (Project_Objects_Path_File, + Get_Name_String + (In_Tree.Private_Part.Current_Object_Path_File)); + end if; - else - if In_Tree.Private_Part.Current_Object_Path_File /= - Project.Objects_Path_File_Without_Libs - then - In_Tree.Private_Part.Current_Object_Path_File := - Project.Objects_Path_File_Without_Libs; - Set_Path_File_Var - (Project_Objects_Path_File, - Get_Name_String - (In_Tree.Private_Part.Current_Object_Path_File)); + else + if In_Tree.Private_Part.Current_Object_Path_File /= + Project.Objects_Path_File_Without_Libs + then + In_Tree.Private_Part.Current_Object_Path_File := + Project.Objects_Path_File_Without_Libs; + Set_Path_File_Var + (Project_Objects_Path_File, + Get_Name_String + (In_Tree.Private_Part.Current_Object_Path_File)); + end if; end if; end if; Index: prj-env.ads =================================================================== --- prj-env.ads (revision 160834) +++ prj-env.ads (working copy) @@ -94,7 +94,9 @@ package Prj.Env is procedure Set_Ada_Paths (Project : Project_Id; In_Tree : Project_Tree_Ref; - Including_Libraries : Boolean); + Including_Libraries : Boolean; + Include_Path : Boolean := True; + Objects_Path : Boolean := True); -- Set the environment variables for additional project path files, after -- creating the path files if necessary.