return;
}
- /* Do not store variables we cannot take the address of,
- but keep the values for purposes of debugging. */
if (!d->canTakeAddressOf ())
{
- /* Don't know if there is a good way to handle instantiations. */
- if (d->isInstantiated ())
- return;
-
- /* Cannot make an expression out of a void initializer. */
- if (!d->_init || d->_init->isVoidInitializer ())
- return;
-
- tree decl = get_symbol_decl (d);
- Expression *ie = initializerToExpression (d->_init);
-
- /* CONST_DECL was initially intended for enumerals and may be used for
- scalars in general, but not for aggregates. Here a non-constant
- value is generated anyway so as the CONST_DECL only serves as a
- placeholder for the value, however the DECL itself should never be
- referenced in any generated code, or passed to the back-end. */
+ /* Do not store variables we cannot take the address of,
+ but keep the values for purposes of debugging. */
if (!d->type->isscalar ())
- DECL_INITIAL (decl) = build_expr (ie, false);
- else
{
- DECL_INITIAL (decl) = build_expr (ie, true);
+ tree decl = get_symbol_decl (d);
d_pushdecl (decl);
rest_of_decl_compilation (decl, 1, 0);
}
if (vd->storage_class & STCextern)
DECL_EXTERNAL (decl->csym) = 1;
+
+ /* CONST_DECL was initially intended for enumerals and may be used for
+ scalars in general, but not for aggregates. Here a non-constant
+ value is generated anyway so as the CONST_DECL only serves as a
+ placeholder for the value, however the DECL itself should never be
+ referenced in any generated code, or passed to the back-end. */
+ if (vd->storage_class & STCmanifest)
+ {
+ /* Cannot make an expression out of a void initializer. */
+ if (vd->_init && !vd->_init->isVoidInitializer ())
+ {
+ Expression *ie = initializerToExpression (vd->_init);
+
+ if (!vd->type->isscalar ())
+ DECL_INITIAL (decl->csym) = build_expr (ie, false);
+ else
+ DECL_INITIAL (decl->csym) = build_expr (ie, true);
+ }
+ }
}
/* Set the declaration mangled identifier if static. */