-- Cleanup processing after completing main analysis
- -- In GNATprove_Mode we do not perform most expansions but body
- -- instantiation is needed.
+ pragma Assert (Operating_Mode in Check_Semantics | Generate_Code);
- pragma Assert
- (Operating_Mode = Generate_Code
- or else Operating_Mode = Check_Semantics);
+ if Operating_Mode = Generate_Code or else GNATprove_Mode then
+
+ -- In GNATprove_Mode we do not perform most expansions but body
+ -- instantiation is needed.
- if Operating_Mode = Generate_Code
- or else GNATprove_Mode
- then
Instantiate_Bodies;
- end if;
- -- Analyze all inlined bodies, check access-before-elaboration
- -- rules, and remove ignored Ghost code when generating code or
- -- compiling for GNATprove.
+ -- Analyze inlined bodies if required
- if Operating_Mode = Generate_Code or else GNATprove_Mode then
if Inline_Processing_Required then
Analyze_Inlined_Bodies;
end if;
Collect_Garbage_Entities;
end if;
+ -- Check access-before-elaboration rules
+
if Legacy_Elaboration_Checks then
Check_Elab_Calls;
end if;