+2018-06-11 Arnaud Charlet <charlet@adacore.com>
+
+ * exp_ch4.adb (Expand_Record_Equality): Remove extraneous "True and
+ then" and general logical "ada" in codepeer mode.
+
2018-06-11 Javier Miranda <miranda@adacore.com>
* exp_ch9.adb (Expand_N_Protected_Body): Add missing handling of
-- Generates the following code: (assuming that Typ has one Discr and
-- component C2 is also a record)
- -- True
- -- and then Lhs.Discr1 = Rhs.Discr1
- -- and then Lhs.C1 = Rhs.C1
- -- and then Lhs.C2.C1=Rhs.C2.C1 and then ... Lhs.C2.Cn=Rhs.C2.Cn
- -- and then ...
- -- and then Lhs.Cmpn = Rhs.Cmpn
+ -- Lhs.Discr1 = Rhs.Discr1
+ -- and then Lhs.C1 = Rhs.C1
+ -- and then Lhs.C2.C1=Rhs.C2.C1 and then ... Lhs.C2.Cn=Rhs.C2.Cn
+ -- and then ...
+ -- and then Lhs.Cmpn = Rhs.Cmpn
Result := New_Occurrence_Of (Standard_True, Loc);
C := Element_To_Compare (First_Entity (Typ));
begin
if First_Time then
- First_Time := False;
New_Lhs := Lhs;
New_Rhs := Rhs;
else
Set_Etype (Result, Standard_Boolean);
exit;
else
- Result :=
- Make_And_Then (Loc,
- Left_Opnd => Result,
- Right_Opnd => Check);
+ if First_Time then
+ Result := Check;
+
+ -- Generate logical "and" for CodePeer to simplify the
+ -- generated code and analysis.
+
+ elsif CodePeer_Mode then
+ Result :=
+ Make_Op_And (Loc,
+ Left_Opnd => Result,
+ Right_Opnd => Check);
+
+ else
+ Result :=
+ Make_And_Then (Loc,
+ Left_Opnd => Result,
+ Right_Opnd => Check);
+ end if;
end if;
end;
+ First_Time := False;
C := Element_To_Compare (Next_Entity (C));
end loop;