aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/prj-ext.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-01-24 15:27:22 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2014-01-24 15:27:22 +0100
commit08cd7c2fcf3cd62176d1f6d19f4ef030d343ce0f (patch)
tree799e4e44b9400cc1fb303ec146c507d289d8bd3d /gcc/ada/prj-ext.adb
parent7610fee82af0217dd376ce0213d195209f72b606 (diff)
downloadgcc-08cd7c2fcf3cd62176d1f6d19f4ef030d343ce0f.zip
gcc-08cd7c2fcf3cd62176d1f6d19f4ef030d343ce0f.tar.gz
gcc-08cd7c2fcf3cd62176d1f6d19f4ef030d343ce0f.tar.bz2
[multiple changes]
2014-01-24 Ed Schonberg <schonberg@adacore.com> * sem_attr.adb (Analyze_Attribute, case 'Update): Analyze expressions in each component association, and for records note the entity in each association choice, for subsequent resolution. (Resolve_Attribute, case 'Update): Complete resolution of expressions in each component association. 2014-01-24 Robert Dewar <dewar@adacore.com> * sem.adb (Sem): Avoid premature reference to Current_Sem_Unit (this was causing Is_Main_Unit_Or_Main_Unit_Spec to be set wrong, leading to wrong handling of SPARK_Mode for library units). 2014-01-24 Robert Dewar <dewar@adacore.com> * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Set SPARK_Mode on generic instances (do not consider them to be internally generated) 2014-01-24 Doug Rupp <rupp@adacore.com> * s-osinte-android.ads (pthread_sigmask): Import sigprocmask vice pthread_sigmask. 2014-01-24 Vincent Celier <celier@adacore.com> * prj.adb (Debug_Output (Str, Str2)): Output if verbosity is not default. 2014-01-24 Vincent Celier <celier@adacore.com> * prj-ext.adb (Add): Do not output anything when Silent is True, whatever the verbosity. When Source is From_External_Attribute, set the corresponding environment variable if it is not already set. * prj-ext.ads (Add): New Boolean parameter Silent, defaulted to False * prj-proc.adb (Process_Expression_For_Associative_Array): For attribute External, call Prj.Ext.Add with Silent set to True for the child environment, to avoid useless output in non default verbosity. 2014-01-24 Ed Schonberg <schonberg@adacore.com> * sem_res.adb (Set_Slice_Subtype): Handle properly a discrete range given by a subtype indication, and force evaluation of the bounds, as for a simple range. * exp_util.adb (Evaluate_Slice_Bounds): Utility to force evaluation of bounds of slice for various kinds of discrete ranges. (Evaluate_Name, Evaluate_Subtype_From_Expr): use Evaluate_Slice_Bounds. 2014-01-24 Bob Duff <duff@adacore.com> * s-taskin.ads (Activator): Make this Atomic, because Activation_Is_Complete reads it, and that can be called from any task. Previously, this component was only modified by the activator before activation, and by Self after activation. * a-taside.ads, a-taside.adb (Environment_Task, Activation_Is_Complete): Implement these missing functions. From-SVN: r207034
Diffstat (limited to 'gcc/ada/prj-ext.adb')
-rw-r--r--gcc/ada/prj-ext.adb41
1 files changed, 35 insertions, 6 deletions
diff --git a/gcc/ada/prj-ext.adb b/gcc/ada/prj-ext.adb
index 5d49fa4..5f13400 100644
--- a/gcc/ada/prj-ext.adb
+++ b/gcc/ada/prj-ext.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2000-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 2000-2013, 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- --
@@ -66,12 +66,39 @@ package body Prj.Ext is
(Self : External_References;
External_Name : String;
Value : String;
- Source : External_Source := External_Source'First)
+ Source : External_Source := External_Source'First;
+ Silent : Boolean := False)
is
Key : Name_Id;
N : Name_To_Name_Ptr;
begin
+ -- For external attribute, set the environment variable
+
+ if Source = From_External_Attribute and then External_Name /= "" then
+ declare
+ Env_Var : String_Access := Getenv (External_Name);
+
+ begin
+ if Env_Var = null or else Env_Var.all = "" then
+ Setenv (Name => External_Name, Value => Value);
+
+ if not Silent then
+ Debug_Output
+ ("Environment variable """ & External_Name
+ & """ = """ & Value & '"');
+ end if;
+
+ elsif not Silent then
+ Debug_Output
+ ("Not overriding existing environment variable """
+ & External_Name & """, value is """ & Env_Var.all & '"');
+ end if;
+
+ Free (Env_Var);
+ end;
+ end if;
+
Name_Len := External_Name'Length;
Name_Buffer (1 .. Name_Len) := External_Name;
Canonical_Case_Env_Var_Name (Name_Buffer (1 .. Name_Len));
@@ -87,11 +114,13 @@ package body Prj.Ext is
if External_Source'Pos (N.Source) <
External_Source'Pos (Source)
then
- if Current_Verbosity = High then
+ if not Silent then
Debug_Output
- ("Not overridding existing variable '" & External_Name
- & "', value was defined in " & N.Source'Img);
+ ("Not overridding existing external reference '"
+ & External_Name & "', value was defined in "
+ & N.Source'Img);
end if;
+
return;
end if;
end if;
@@ -105,7 +134,7 @@ package body Prj.Ext is
Value => Name_Find,
Next => null);
- if Current_Verbosity = High then
+ if not Silent then
Debug_Output ("Add external (" & External_Name & ") is", N.Value);
end if;