本文整理汇总了C#中PHP.Core.Emit.ILEmitter.GetTemporaryLocal方法的典型用法代码示例。如果您正苦于以下问题:C# ILEmitter.GetTemporaryLocal方法的具体用法?C# ILEmitter.GetTemporaryLocal怎么用?C# ILEmitter.GetTemporaryLocal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHP.Core.Emit.ILEmitter
的用法示例。
在下文中一共展示了ILEmitter.GetTemporaryLocal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EmitConvertToClr
/// <summary>
/// Converts a PHP value to the given CLR type (the caller is not interested in the success of the conversion).
/// </summary>
public static void EmitConvertToClr(ILEmitter/*!*/ il, PhpTypeCode typeCode, Type/*!*/ formalType)
{
EmitConvertToClr(il, typeCode, formalType, il.GetTemporaryLocal(typeof(ConversionStrictness), true));
}
示例2: EmitSetConversion
internal void EmitSetConversion(ILEmitter/*!*/ il, PhpTypeCode sourceTypeCode, Type/*!*/ targetType)
{
LocalBuilder strictness = il.GetTemporaryLocal(typeof(PHP.Core.ConvertToClr.ConversionStrictness));
if (!ClrOverloadBuilder.EmitConvertToClr(il, sourceTypeCode, targetType, strictness))
{
Label label_ok = il.DefineLabel();
il.Ldloc(strictness);
il.LdcI4((int)PHP.Core.ConvertToClr.ConversionStrictness.Failed);
il.Emit(OpCodes.Ceq);
il.Emit(OpCodes.Brfalse, label_ok);
il.Emit(OpCodes.Ldstr, Property.DeclaringType.FullName);
il.Emit(OpCodes.Ldstr, Property.FullName);
il.Emit(OpCodes.Call, Methods.PhpException.PropertyTypeMismatch);
il.MarkLabel(label_ok, true);
}
il.ReturnTemporaryLocal(strictness);
}