本文整理汇总了C#中Compiler.GetTarget方法的典型用法代码示例。如果您正苦于以下问题:C# Compiler.GetTarget方法的具体用法?C# Compiler.GetTarget怎么用?C# Compiler.GetTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Compiler
的用法示例。
在下文中一共展示了Compiler.GetTarget方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CompilerFunction
private CompilerFunction(Compiler compiler, FunctionDeclaration prototype)
: base(compiler)
{
Contract.Requires(compiler != null);
Contract.Requires(prototype != null);
_functionPrototype = prototype;
_entryLabel = compiler.DefineLabel();
_exitLabel = compiler.DefineLabel();
_entryTarget = compiler.GetTarget(_entryLabel.Id);
_exitTarget = compiler.GetTarget(_exitLabel.Id);
_end = new CompilerFunctionEnd(compiler, this);
}
示例2: CompilerJmpInstruction
public CompilerJmpInstruction(Compiler compiler, InstructionCode code, Operand[] operands)
: base(compiler, code, operands)
{
if (code < InstructionDescription.JumpBegin || code > InstructionDescription.JumpEnd)
throw new ArgumentException("The specified instruction code is not a valid jump.");
Contract.Requires(compiler != null);
Contract.Requires(operands != null);
Contract.EndContractBlock();
_jumpTarget = compiler.GetTarget(Operands[0].Id);
_jumpTarget.JumpsCount++;
_jumpNext = _jumpTarget.From;
_jumpTarget.From = this;
_isTaken =
Code == InstructionCode.Jmp
|| (Operands.Length > 1 && Operands[1].IsImm && ((Imm)Operands[1]).Value == (IntPtr)Hint.Taken);
}