2004-11-23 Marek Safar <marek.safar@seznam.cz>
authorMarek Safar <marek.safar@gmail.com>
Tue, 23 Nov 2004 05:58:54 +0000 (05:58 -0000)
committerMarek Safar <marek.safar@gmail.com>
Tue, 23 Nov 2004 05:58:54 +0000 (05:58 -0000)
commit28776e66837c35ad00ca409831350697af055b78
treed3e93407590a5d54cf41ff48811a6de2c3e7c3ed
parent7602dadcc36316fa08d06eab3a757c34b3348c7d
2004-11-23  Marek Safar  <marek.safar@seznam.cz>

Fix bug #69177 (Implemented decimal constant support)

* cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
(BinaryFold): Add DecimalConstant.

* const.cs (Define): Decimal constant
(is not constant.
(ChangeType): Add decimal type handling.
(LookupConstantValue): Don't set value for decimal type but
emit DecimalConstantAttribute. Needed for constant optimization.

* constant.cs (ToDecimal): New method.
(ConvertToDecimal): New method.
(IntConstant): Implemented ConvertToDecimal.
(DecimalConstant.Emit): Emit optimized version for decimals in
int range.

* expression.cs (ResolveOperator): Changed order of constant
reduction to work correctly with native types which have
overloaded operators.
(ResolveMemberAccess): Extract constant value from attribute
for decimal type.

* rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.

* typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
(ChangeType): Decimal is special.
(TypeToCoreType): Add decimal type.

svn path=/trunk/mcs/; revision=36411
mcs/mcs/ChangeLog
mcs/mcs/cfold.cs
mcs/mcs/const.cs
mcs/mcs/constant.cs
mcs/mcs/ecore.cs
mcs/mcs/expression.cs
mcs/mcs/rootcontext.cs
mcs/mcs/typemanager.cs