VADS inline assembly works by using a qualified expression for one of
the types defined in the Machine_Code package, e.g.
procedure P is
begin
code_2'(INSTR, OPERAND1, OPERAND2);
end y;
This is different from GNAT's own inline assembly machinery, which
instead expects a call to Machine_Code.ASM with a set of
differently-typed arguments.
This incompatibility is preventing GNATSAS' GNAT-Warnings engine from
analyzing VADS code, hence we adapt sem_ch13.adb to not fail on such
constructs when GNAT is running under both Check_Semantics_Only_Mode and
Relaxed_RM_Semantics mode.
gcc/ada/ChangeLog:
* sem_ch13.adb (Analyze_Code_Statement): Do not emit error
message when only checking relaxed semantics.
if Etype (Expression (N)) = Any_Type then
return;
elsif not Is_RTE (Etype (Expression (N)), RE_Asm_Insn) then
- Error_Msg_N ("incorrect type for code statement", N);
+
+ -- Only emit an error message when not running in Relaxed RM
+ -- Semantics. This enables GNATSAS' GNAT Warnings engine to work on
+ -- VADS codebases.
+
+ if not (Check_Semantics_Only_Mode and then Relaxed_RM_Semantics) then
+ Error_Msg_N ("incorrect type for code statement", N);
+ end if;
+
return;
end if;