Format Style Fixes
This commit is contained in:
@@ -27,16 +27,9 @@ public class CodeGenerator
|
||||
return new CodeInstruction(code.OpCode) { labels = GetLabelList(code) };
|
||||
}
|
||||
|
||||
if (
|
||||
code.OpCode == OpCodes.Ldfld
|
||||
|| code.OpCode == OpCodes.Ldflda
|
||||
|| code.OpCode == OpCodes.Stfld
|
||||
)
|
||||
if (code.OpCode == OpCodes.Ldfld || code.OpCode == OpCodes.Ldflda || code.OpCode == OpCodes.Stfld)
|
||||
{
|
||||
return new CodeInstruction(
|
||||
code.OpCode,
|
||||
AccessTools.Field(code.CallerType, code.OperandTarget as string)
|
||||
)
|
||||
return new CodeInstruction(code.OpCode, AccessTools.Field(code.CallerType, code.OperandTarget as string))
|
||||
{
|
||||
labels = GetLabelList(code),
|
||||
};
|
||||
@@ -44,10 +37,7 @@ public class CodeGenerator
|
||||
|
||||
if (code.OpCode == OpCodes.Call || code.OpCode == OpCodes.Callvirt)
|
||||
{
|
||||
return new CodeInstruction(
|
||||
code.OpCode,
|
||||
AccessTools.Method(code.CallerType, code.OperandTarget as string, code.Parameters)
|
||||
)
|
||||
return new CodeInstruction(code.OpCode, AccessTools.Method(code.CallerType, code.OperandTarget as string, code.Parameters))
|
||||
{
|
||||
labels = GetLabelList(code),
|
||||
};
|
||||
@@ -55,10 +45,7 @@ public class CodeGenerator
|
||||
|
||||
if (code.OpCode == OpCodes.Box)
|
||||
{
|
||||
return new CodeInstruction(code.OpCode, code.CallerType)
|
||||
{
|
||||
labels = GetLabelList(code),
|
||||
};
|
||||
return new CodeInstruction(code.OpCode, code.CallerType) { labels = GetLabelList(code) };
|
||||
}
|
||||
|
||||
if (
|
||||
@@ -70,18 +57,12 @@ public class CodeGenerator
|
||||
|| code.OpCode == OpCodes.Br_S
|
||||
)
|
||||
{
|
||||
return new CodeInstruction(code.OpCode, code.OperandTarget)
|
||||
{
|
||||
labels = GetLabelList(code),
|
||||
};
|
||||
return new CodeInstruction(code.OpCode, code.OperandTarget) { labels = GetLabelList(code) };
|
||||
}
|
||||
|
||||
if (code.OpCode == OpCodes.Ldftn)
|
||||
{
|
||||
return new CodeInstruction(
|
||||
code.OpCode,
|
||||
AccessTools.Method(code.CallerType, code.OperandTarget as string, code.Parameters)
|
||||
)
|
||||
return new CodeInstruction(code.OpCode, AccessTools.Method(code.CallerType, code.OperandTarget as string, code.Parameters))
|
||||
{
|
||||
labels = GetLabelList(code),
|
||||
};
|
||||
@@ -91,8 +72,7 @@ public class CodeGenerator
|
||||
{
|
||||
return new CodeInstruction(
|
||||
code.OpCode,
|
||||
code.CallerType.GetConstructors()
|
||||
.FirstOrDefault(x => x.GetParameters().Length == code.Parameters.Length)
|
||||
code.CallerType.GetConstructors().FirstOrDefault(x => x.GetParameters().Length == code.Parameters.Length)
|
||||
)
|
||||
{
|
||||
labels = GetLabelList(code),
|
||||
|
||||
@@ -24,13 +24,7 @@ public class CodeWithLabel : Code
|
||||
Label = label;
|
||||
}
|
||||
|
||||
public CodeWithLabel(
|
||||
OpCode opCode,
|
||||
Label label,
|
||||
Type callerType,
|
||||
object operandTarget,
|
||||
Type[] parameters = null
|
||||
)
|
||||
public CodeWithLabel(OpCode opCode, Label label, Type callerType, object operandTarget, Type[] parameters = null)
|
||||
: base(opCode, callerType, operandTarget, parameters)
|
||||
{
|
||||
Label = label;
|
||||
|
||||
Reference in New Issue
Block a user