本文整理匯總了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);
}