aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSteve Baird <baird@adacore.com>2015-11-12 10:44:37 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2015-11-12 11:44:37 +0100
commit0fe797c5849ca33b50a69995ce5aaccb1476ec8a (patch)
tree1b95a112ae8cd91ec9ac1bc5c0d148c29729f8f0 /gcc
parentb420ba79dea984c78388047f07ab542665b22ab4 (diff)
downloadgcc-0fe797c5849ca33b50a69995ce5aaccb1476ec8a.zip
gcc-0fe797c5849ca33b50a69995ce5aaccb1476ec8a.tar.gz
gcc-0fe797c5849ca33b50a69995ce5aaccb1476ec8a.tar.bz2
2015-11-12 Steve Baird <baird@adacore.com>
* sem_ch6.adb (Analyze_Procedure_Call) If CodePeer_Mode is True, do not analyze the expression of a machine code insertion. * sem_ch13.adb (Analyze_Code_Statement) If CodePeer_Mode is True, mark the N_Code_Statement node as analyzed and do nothing else. From-SVN: r230225
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/sem_ch13.adb18
-rw-r--r--gcc/ada/sem_ch6.adb18
3 files changed, 32 insertions, 11 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 3e98a5d..5144c2d 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,10 @@
+2015-11-12 Steve Baird <baird@adacore.com>
+
+ * sem_ch6.adb (Analyze_Procedure_Call) If CodePeer_Mode is True,
+ do not analyze the expression of a machine code insertion.
+ * sem_ch13.adb (Analyze_Code_Statement) If CodePeer_Mode is True,
+ mark the N_Code_Statement node as analyzed and do nothing else.
+
2015-11-12 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Check_Limited_Return): Make global to package
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 36eb7ad..f368957 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -6043,9 +6043,17 @@ package body Sem_Ch13 is
DeclO : Node_Id;
begin
+ -- Accept foreign code statements for CodePeer. The analysis is skipped
+ -- to avoid rejecting unrecognized constructs.
+
+ if CodePeer_Mode then
+ Set_Analyzed (N);
+ return;
+ end if;
+
-- Analyze and check we get right type, note that this implements the
- -- requirement (RM 13.8(1)) that Machine_Code be with'ed, since that
- -- is the only way that Asm_Insn could possibly be visible.
+ -- requirement (RM 13.8(1)) that Machine_Code be with'ed, since that is
+ -- the only way that Asm_Insn could possibly be visible.
Analyze_And_Resolve (Expression (N));
@@ -6058,8 +6066,8 @@ package body Sem_Ch13 is
Check_Code_Statement (N);
- -- Make sure we appear in the handled statement sequence of a
- -- subprogram (RM 13.8(3)).
+ -- Make sure we appear in the handled statement sequence of a subprogram
+ -- (RM 13.8(3)).
if Nkind (HSS) /= N_Handled_Sequence_Of_Statements
or else Nkind (SBody) /= N_Subprogram_Body
@@ -6112,7 +6120,7 @@ package body Sem_Ch13 is
while Present (Stmt) loop
StmtO := Original_Node (Stmt);
- -- A procedure call transformed into a code statement is OK.
+ -- A procedure call transformed into a code statement is OK
if Ada_Version >= Ada_2012
and then Nkind (StmtO) = N_Procedure_Call_Statement
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index ea5ca61..91e41e2 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -1559,11 +1559,17 @@ package body Sem_Ch6 is
-- parameterless member of an entry family. Resolution of these various
-- interpretations is delicate.
- Analyze (P);
+ -- Do not analyze machine code statements to avoid rejecting them in
+ -- CodePeer mode.
- -- If this is a call of the form Obj.Op, the call may have been
- -- analyzed and possibly rewritten into a block, in which case
- -- we are done.
+ if CodePeer_Mode and then Nkind (P) = N_Qualified_Expression then
+ Set_Etype (P, Standard_Void_Type);
+ else
+ Analyze (P);
+ end if;
+
+ -- If this is a call of the form Obj.Op, the call may have been analyzed
+ -- and possibly rewritten into a block, in which case we are done.
if Analyzed (N) then
return;
@@ -1632,8 +1638,8 @@ package body Sem_Ch6 is
Analyze_Call_And_Resolve;
- -- If the prefix is the simple name of an entry family, this is
- -- a parameterless call from within the task body itself.
+ -- If the prefix is the simple name of an entry family, this is a
+ -- parameterless call from within the task body itself.
elsif Is_Entity_Name (P)
and then Nkind (P) = N_Identifier