* sem_ch3.adb (Analyze_Object_Declaration): Properly
handle Current_Value for volatile variables (also propagate
Treat_As_Volatile from type to object).
2012-01-23 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch12.adb (Install_Body): Detect the case
where the enclosing context is a package with a stub body that
has already been replaced by the actual body. In such cases,
the freeze node for the enclosing context must be inserted after
the real body.
2012-01-23 Ed Schonberg <schonberg@adacore.com>
* sem_prag.adb (Analyze_Pragma, case Debug): Freeze the called
subprogram before expanding the pragma into an if-statement with
a block, to ensure that when the subprogram is null its body is
properly generated before expansion.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183420
138bc75d-0d04-0410-961f-
82ee72b054a4
+2012-01-23 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch3.adb (Analyze_Object_Declaration): Properly
+ handle Current_Value for volatile variables (also propagate
+ Treat_As_Volatile from type to object).
+
+2012-01-23 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_ch12.adb (Install_Body): Detect the case
+ where the enclosing context is a package with a stub body that
+ has already been replaced by the actual body. In such cases,
+ the freeze node for the enclosing context must be inserted after
+ the real body.
+
+2012-01-23 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_prag.adb (Analyze_Pragma, case Debug): Freeze the called
+ subprogram before expanding the pragma into an if-statement with
+ a block, to ensure that when the subprogram is null its body is
+ properly generated before expansion.
+
2012-01-23 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch12.adb (Analyze_Associations): Alphabetize local variables and
(Corresponding_Stub (Parent (Parent (N))),
Freeze_Node (Enclosing));
+ -- The enclosing context is a package with a stub body
+ -- which has already been replaced by the real body.
+ -- Insert the freeze node after the actual body.
+
+ elsif Ekind (Enclosing) = E_Package
+ and then Present (Body_Entity (Enclosing))
+ and then Was_Originally_Stub
+ (Parent (Body_Entity (Enclosing)))
+ then
+ Insert_Freeze_Node_For_Instance
+ (Parent (Body_Entity (Enclosing)),
+ Freeze_Node (Enclosing));
+
-- The parent instance has been frozen before the body of
-- the enclosing package, insert the freeze node after
-- the body.
end if;
end if;
+ -- Object is marked pure if it is in a pure scope
+
Set_Is_Pure (Id, Is_Pure (Current_Scope));
-- If deferred constant, make sure context is appropriate. We detect
Set_Etype (Id, Act_T);
+ -- Object is marked to be treated as volatile if type is volatile and
+ -- we clear the Current_Value setting that may have been set above.
+
+ if Treat_As_Volatile (Etype (Id)) then
+ Set_Treat_As_Volatile (Id);
+ Set_Current_Value (Id, Empty);
+ end if;
+
-- Deal with controlled types
if Has_Controlled_Component (Etype (Id))
-- use of the secondary stack does not generate execution overhead
-- for suppressed conditions.
+ -- Normally the analysis that follows will freeze the subprogram
+ -- being called. However, if the call is to a null procedure,
+ -- we want to freeze it before creating the block, because the
+ -- analysis that follows may be done with expansion disabled, and
+ -- and the body will not be generated, leading to spurious errors.
+
+ if Nkind (Call) = N_Procedure_Call_Statement
+ and then Is_Entity_Name (Name (Call))
+ then
+ Analyze (Name (Call));
+ Freeze_Before (N, Entity (Name (Call)));
+ end if;
+
Rewrite (N, Make_Implicit_If_Statement (N,
Condition => Cond,
Then_Statements => New_List (