summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_intr.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-30 10:45:42 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-30 10:45:42 +0000
commit82b93248867ca525206c3368bea69847cef18ba5 (patch)
tree1349fa352faceacd002257f1bbe9c0a29a330470 /gcc/ada/exp_intr.adb
parent727560195b5a1be9e2e1a708a72a3edfe60f2333 (diff)
downloadgcc-82b93248867ca525206c3368bea69847cef18ba5.tar.gz
2014-07-30 Robert Dewar <dewar@adacore.com>
* debug.adb: Document that d7 suppresses compilation time output. * errout.adb (Write_Header): Include compilation time in header output. * exp_intr.adb (Expand_Intrinsic_Call): Add Compilation_Date/Compilation_Time (Expand_Source_Info): Expand Compilation_Date/Compilation_Time. * g-souinf.ads (Compilation_Date): New function (Compilation_Time): New function. * gnat1drv.adb (Gnat1drv): Set Opt.Compilation_Time. * gnat_rm.texi (Compilation_Date): New function (Compilation_Time): New function. * opt.ads (Compilation_Time): New variable. * s-os_lib.ads, s-os_lib.adb (Current_Time_String): New function. * sem_intr.adb (Compilation_Date): New function. (Compilation_Time): New function. * snames.ads-tmpl (Name_Compilation_Date): New entry. (Name_Compilation_Time): New entry. 2014-07-30 Yannick Moy <moy@adacore.com> * inline.adb: Add comment. 2014-07-30 Ed Schonberg <schonberg@adacore.com> * par-ch4.adb (Is_Parameterless_Attribute): 'Result is a parameterless attribute, and a postondition can mention an indexed component or a slice whose prefix is an attribute reference F'Result. 2014-07-30 Robert Dewar <dewar@adacore.com> * sprint.adb (Sprint_Node_Actual, case Object_Declaration): Avoid bomb when printing package Standard. 2014-07-30 Ed Schonberg <schonberg@adacore.com> * sem_elab.adb (Check_Internal_Call_Continue): If an elaboration entity is created at this point, ensure that the name of the flag is unique, because the subprogram may be overloaded and other homonyms may also have elaboration flags created on the fly. 2014-07-30 Hristian Kirtchev <kirtchev@adacore.com> * sem_attr.adb (Analyze_Array_Component_Update): New routine. (Analyze_Attribute): Major cleanup of attribute 'Update. The logic is now split into two distinct routines depending on the type of the prefix. The use of <> is now illegal in attribute 'Update. (Analyze_Record_Component_Update): New routine. (Check_Component_Reference): Removed. (Resolve_Attribute): Remove the return statement and ??? comment following the processing for attribute 'Update. As a result, the attribute now freezes its prefix. 2014-07-30 Javier Miranda <miranda@adacore.com> * exp_ch4.adb (Apply_Accessibility_Check): Do not call Base_Address() in VM targets. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213246 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_intr.adb')
-rw-r--r--gcc/ada/exp_intr.adb43
1 files changed, 38 insertions, 5 deletions
diff --git a/gcc/ada/exp_intr.adb b/gcc/ada/exp_intr.adb
index 3c6eb7468fa..f0ca3e3afc6 100644
--- a/gcc/ada/exp_intr.adb
+++ b/gcc/ada/exp_intr.adb
@@ -109,10 +109,12 @@ package body Exp_Intr is
procedure Expand_Source_Info (N : Node_Id; Nam : Name_Id);
-- Rewrite the node by the appropriate string or positive constant.
-- Nam can be one of the following:
- -- Name_File - expand string that is the name of source file
- -- Name_Line - expand integer line number
- -- Name_Source_Location - expand string of form file:line
- -- Name_Enclosing_Entity - expand string with name of enclosing entity
+ -- Name_File - expand string name of source file
+ -- Name_Line - expand integer line number
+ -- Name_Source_Location - expand string of form file:line
+ -- Name_Enclosing_Entity - expand string name of enclosing entity
+ -- Name_Compilation_Date - expand string with compilation date
+ -- Name_Compilation_Time - expand string with compilation time
---------------------------------
-- Expand_Binary_Operator_Call --
@@ -557,7 +559,9 @@ package body Exp_Intr is
elsif Nam_In (Nam, Name_File,
Name_Line,
Name_Source_Location,
- Name_Enclosing_Entity)
+ Name_Enclosing_Entity,
+ Name_Compilation_Date,
+ Name_Compilation_Time)
then
Expand_Source_Info (N, Nam);
@@ -806,6 +810,35 @@ package body Exp_Intr is
Write_Entity_Name (Ent);
+ when Name_Compilation_Date =>
+ declare
+ subtype S13 is String (1 .. 3);
+ Months : constant array (1 .. 12) of S13 :=
+ ("Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
+
+ M1 : constant Character := Opt.Compilation_Time (6);
+ M2 : constant Character := Opt.Compilation_Time (7);
+
+ MM : constant Natural range 1 .. 12 :=
+ (Character'Pos (M1) - Character'Pos ('0')) * 10 +
+ (Character'Pos (M2) - Character'Pos ('0'));
+
+ begin
+ -- Reformat ISO date into MMM DD YYYY (__DATE__) format
+
+ Name_Buffer (1 .. 3) := Months (MM);
+ Name_Buffer (4) := ' ';
+ Name_Buffer (5 .. 6) := Opt.Compilation_Time (9 .. 10);
+ Name_Buffer (7) := ' ';
+ Name_Buffer (8 .. 11) := Opt.Compilation_Time (1 .. 4);
+ Name_Len := 11;
+ end;
+
+ when Name_Compilation_Time =>
+ Name_Buffer (1 .. 8) := Opt.Compilation_Time (12 .. 19);
+ Name_Len := 8;
+
when others =>
raise Program_Error;
end case;