當前位置: 首頁>>代碼示例>>C#>>正文


C# Operand.EmitAddressOf方法代碼示例

本文整理匯總了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);
        }
開發者ID:jimmmeh,項目名稱:runsharp,代碼行數:22,代碼來源:CodeGen.Helpers.cs

示例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]);
        }
開發者ID:jimmmeh,項目名稱:runsharp,代碼行數:15,代碼來源:OverloadResolver.cs

示例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);
        }
開發者ID:AqlaSolutions,項目名稱:runsharp,代碼行數:9,代碼來源:CodeGen.Helpers.cs

示例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);
        }
開發者ID:AqlaSolutions,項目名稱:runsharp,代碼行數:17,代碼來源:CodeGen.Helpers.cs

示例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);
		}
開發者ID:amithasan,項目名稱:Framework-Class-Library-Extension,代碼行數:10,代碼來源:CodeGen.Statements.cs


注:本文中的TriAxis.RunSharp.Operand.EmitAddressOf方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。