本文整理汇总了C#中TriAxis.RunSharp.Operand.EmitAddressOf方法的典型用法代码示例。如果您正苦于以下问题:C# Operand.EmitAddressOf方法的具体用法?C# Operand.EmitAddressOf怎么用?C# Operand.EmitAddressOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TriAxis.RunSharp.Operand
的用法示例。
在下文中一共展示了Operand.EmitAddressOf方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EmitGetHelper
internal void EmitGetHelper(Operand op, Type desiredType, bool allowExplicitConversion)
{
if (desiredType.IsByRef)
{
if (op.Type != desiredType.GetElementType())
throw new InvalidOperationException(Properties.Messages.ErrByRefTypeMismatch);
op.EmitAddressOf(this);
return;
}
if ((object)op == null)
{
if (desiredType.IsValueType)
throw new ArgumentNullException("op");
il.Emit(OpCodes.Ldnull);
return;
}
op.EmitGet(this);
Convert(op, desiredType, allowExplicitConversion);
}
示例2: EmitArg
void EmitArg(CodeGen g, int index, Operand arg)
{
if (appliedSignature[index].IsByRef)
{
arg.EmitAddressOf(g);
return;
}
if ((object)arg == null)
g.IL.Emit(OpCodes.Ldnull);
else
arg.EmitGet(g);
conversions[index].Emit(g, paramsSignature[index], appliedSignature[index]);
}
示例3: EmitGetHelper_Ref
void EmitGetHelper_Ref(Operand op, Type desiredType)
{
if (ReferenceEquals(op, null))
throw new ArgumentException("Ref argument can't be null, expected " + desiredType.Name);
if (op.GetReturnType(TypeMapper) != desiredType.GetElementType())
throw new InvalidOperationException(Properties.Messages.ErrByRefTypeMismatch);
op.EmitAddressOf(this);
}
示例4: EmitGetHelper_Conversion
void EmitGetHelper_Conversion(Operand op, Type desiredType, Conversion conv, Type from = null)
{
if (conv.RequiresAddress)
{
if (ReferenceEquals(op, null))
throw new ArgumentException("Conversion from nullref to " + desiredType.Name + " is impossible; for nullables variable it's required to load address.");
op.EmitAddressOf(this);
}
else if (ReferenceEquals(op, null))
IL.Emit(OpCodes.Ldnull);
else
op.EmitGet(this);
if (from == null)
from = (object)op == null ? null : op.GetReturnType(TypeMapper);
conv.Emit(this, from, desiredType);
}
示例5: InitObj
public void InitObj(Operand target)
{
if ((object)target == null)
throw new ArgumentNullException("target");
BeforeStatement();
target.EmitAddressOf(this);
il.Emit(OpCodes.Initobj, target.Type);
}