]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Minor tweak
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 27 Sep 2023 08:00:03 +0000 (10:00 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Wed, 27 Sep 2023 08:16:28 +0000 (10:16 +0200)
gcc/ada/
* gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Variable>: Tweak.

gcc/ada/gcc-interface/decl.cc

index 20f43de9ea9f125ad6257474e96841eb8bad766b..37b949865a68cef7fee19282f1c2da7e9c837831 100644 (file)
@@ -1077,7 +1077,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
                /* We need to detect the case where a temporary is created to
                   hold the return value, since we cannot safely rename it at
                   top level as it lives only in the elaboration routine.  */
-               || (TREE_CODE (inner) == VAR_DECL
+               || (VAR_P (inner)
                    && DECL_RETURN_VALUE_P (inner))
                /* We also need to detect the case where the front-end creates
                   a dangling 'reference to a function call at top level and
@@ -1093,10 +1093,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
 
                   We cannot safely rename the rewritten expression since the
                   underlying object lives only in the elaboration routine.  */
-               || (TREE_CODE (inner) == INDIRECT_REF
+               || (INDIRECT_REF_P (inner)
                    && (inner
                        = remove_conversions (TREE_OPERAND (inner, 0), true))
-                   && TREE_CODE (inner) == VAR_DECL
+                   && VAR_P (inner)
                    && DECL_RETURN_VALUE_P (inner)))
              ;