+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
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));
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
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
-- 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;
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