summaryrefslogtreecommitdiff
path: root/gcc/ada/tbuild.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-28 13:31:51 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-28 13:31:51 +0000
commitc4853f2e3cc64aad591da8e9c5609e60279290b9 (patch)
tree148343d7b85f6796a501d41f02588446c25abfd8 /gcc/ada/tbuild.adb
parent119147d12d323bafa652a1dff5962c9a1b800bd7 (diff)
downloadgcc-c4853f2e3cc64aad591da8e9c5609e60279290b9.tar.gz
2009-10-28 Robert Dewar <dewar@adacore.com>
* a-ztexio.adb, a-ztexio.ads, a-witeio.ads, a-witeio.adb, a-textio.ads, a-textio.adb: Reorganize (moving specs from private part to body). (Initialize_Standard_Files): New procedure. * a-tienau.adb: Minor change to make EOF directly visible * a-tirsfi.ads, a-wrstfi.adb, a-wrstfi.ads, a-zrstfi.adb, a-zrstfi.ads, a-tirsfi.adb: New unit, initial version. * gnat_rm.texi: Add documentation for Ada.[Wide_[Wide_]]Text_IO.Reset_Standard_Files. * Makefile.rtl: Add entries for Ada.[Wide_[Wide_]]Text_IO.Reset_Standard_Files 2009-10-28 Thomas Quinot <quinot@adacore.com> * exp_ch9.ads: Minor reformatting * sem_ch3.adb: Minor reformatting * sem_aggr.adb: Minor reformatting. * sem_attr.adb: Minor reformatting * tbuild.adb, tbuild.ads, par-ch4.adb, exp_ch4.adb (Tbuild.New_Op_Node): New subprogram. Minor code reorganization/factoring. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153656 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/tbuild.adb')
-rw-r--r--gcc/ada/tbuild.adb51
1 files changed, 50 insertions, 1 deletions
diff --git a/gcc/ada/tbuild.adb b/gcc/ada/tbuild.adb
index 7273fde6703..f1004d5a5c3 100644
--- a/gcc/ada/tbuild.adb
+++ b/gcc/ada/tbuild.adb
@@ -33,7 +33,6 @@ with Opt; use Opt;
with Restrict; use Restrict;
with Rident; use Rident;
with Sem_Aux; use Sem_Aux;
-with Sinfo; use Sinfo;
with Snames; use Snames;
with Stand; use Stand;
with Stringt; use Stringt;
@@ -626,6 +625,56 @@ package body Tbuild is
return Occurrence;
end New_Occurrence_Of;
+ -----------------
+ -- New_Op_Node --
+ -----------------
+
+ function New_Op_Node
+ (New_Node_Kind : Node_Kind;
+ New_Sloc : Source_Ptr) return Node_Id
+ is
+ type Name_Of_Type is array (N_Op) of Name_Id;
+ Name_Of : constant Name_Of_Type := Name_Of_Type'(
+ N_Op_And => Name_Op_And,
+ N_Op_Or => Name_Op_Or,
+ N_Op_Xor => Name_Op_Xor,
+ N_Op_Eq => Name_Op_Eq,
+ N_Op_Ne => Name_Op_Ne,
+ N_Op_Lt => Name_Op_Lt,
+ N_Op_Le => Name_Op_Le,
+ N_Op_Gt => Name_Op_Gt,
+ N_Op_Ge => Name_Op_Ge,
+ N_Op_Add => Name_Op_Add,
+ N_Op_Subtract => Name_Op_Subtract,
+ N_Op_Concat => Name_Op_Concat,
+ N_Op_Multiply => Name_Op_Multiply,
+ N_Op_Divide => Name_Op_Divide,
+ N_Op_Mod => Name_Op_Mod,
+ N_Op_Rem => Name_Op_Rem,
+ N_Op_Expon => Name_Op_Expon,
+ N_Op_Plus => Name_Op_Add,
+ N_Op_Minus => Name_Op_Subtract,
+ N_Op_Abs => Name_Op_Abs,
+ N_Op_Not => Name_Op_Not,
+
+ -- We don't really need these shift operators, since they never
+ -- appear as operators in the source, but the path of least
+ -- resistance is to put them in (the aggregate must be complete)
+
+ N_Op_Rotate_Left => Name_Rotate_Left,
+ N_Op_Rotate_Right => Name_Rotate_Right,
+ N_Op_Shift_Left => Name_Shift_Left,
+ N_Op_Shift_Right => Name_Shift_Right,
+ N_Op_Shift_Right_Arithmetic => Name_Shift_Right_Arithmetic);
+
+ Nod : constant Node_Id := New_Node (New_Node_Kind, New_Sloc);
+ begin
+ if New_Node_Kind in Name_Of'Range then
+ Set_Chars (Nod, Name_Of (New_Node_Kind));
+ end if;
+ return Nod;
+ end New_Op_Node;
+
----------------------
-- New_Reference_To --
----------------------