Commit 9c0d0367 by Mark Mitchell Committed by Jason Merrill

cvt.c (ocp_convert): Obtain the constant values from constant decls even if...

	* cvt.c (ocp_convert): Obtain the constant values from constant
	decls even if the destination type is the same as the type of the
	decl.
	* decl2.c (finish_file): Make sure that static inlines with
	definitions are not marked DECL_EXTERNAL before returning.

From-SVN: r17653
parent cf776105
Tue Feb 3 23:50:52 1998 Mark Mitchell <mmitchell@usa.net>
* cvt.c (ocp_convert): Obtain the constant values from constant
decls even if the destination type is the same as the type of the
decl.
* decl2.c (finish_file): Make sure that static inlines with
definitions are not marked DECL_EXTERNAL before returning.
Tue Feb 3 22:43:42 1998 Jason Merrill <jason@yorick.cygnus.com>
* decl.c: Lose arg_looking_for_template.
......
......@@ -982,6 +982,9 @@ ocp_convert (type, expr, convtype, flags)
|| TREE_TYPE (e) == error_mark_node)
return error_mark_node;
if (TREE_READONLY_DECL_P (e))
e = decl_constant_value (e);
if (IS_AGGR_TYPE (type) && (convtype & CONV_FORCE_TEMP))
/* We need a new temporary; don't take this shortcut. */;
else if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (TREE_TYPE (e)))
......@@ -1015,9 +1018,6 @@ ocp_convert (type, expr, convtype, flags)
if (TREE_CODE (e) == OFFSET_REF)
e = resolve_offset_ref (e);
if (TREE_READONLY_DECL_P (e))
e = decl_constant_value (e);
if (INTEGRAL_CODE_P (code))
{
tree intype = TREE_TYPE (e);
......@@ -1186,7 +1186,7 @@ ocp_convert (type, expr, convtype, flags)
}
/* If TYPE or TREE_TYPE (E) is not on the permanent_obstack,
then the it won't be hashed and hence compare as not equal,
then it won't be hashed and hence compare as not equal,
even when it is. */
if (code == ARRAY_TYPE
&& TREE_TYPE (TREE_TYPE (e)) == TREE_TYPE (type)
......
......@@ -3286,6 +3286,25 @@ finish_file ()
p = &TREE_CHAIN (*p);
}
}
/* It's possible that some of the remaining inlines will still be
needed. For example, a static inline whose address is used in
the initializer for a file-scope static variable will be
needed. Code in compile_file will handle this, but we mustn't
pretend that there are no definitions for the inlines, or it
won't be able to.
FIXME: This won't catch member functions. We should really
unify this stuff with the compile_file stuff. */
for (vars = saved_inlines; vars != NULL_TREE; vars = TREE_CHAIN (vars))
{
tree decl = TREE_VALUE (vars);
if (DECL_NOT_REALLY_EXTERN (decl)
&& !DECL_COMDAT (decl)
&& DECL_INITIAL (decl) != NULL_TREE)
DECL_EXTERNAL (decl) = 0;
}
}
/* Now delete from the chain of variables all virtual function tables.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment