Add OnInlinedMethod() method
This commit is contained in:
parent
06bef669c5
commit
13ef523d58
|
@ -71,6 +71,7 @@ namespace de4dot.blocks.cflow {
|
||||||
if (instr == null)
|
if (instr == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
bool inlinedMethod;
|
||||||
switch (instr.OpCode.Code) {
|
switch (instr.OpCode.Code) {
|
||||||
case Code.Ldarg:
|
case Code.Ldarg:
|
||||||
case Code.Ldarg_S:
|
case Code.Ldarg_S:
|
||||||
|
@ -83,7 +84,8 @@ namespace de4dot.blocks.cflow {
|
||||||
case Code.Call:
|
case Code.Call:
|
||||||
case Code.Callvirt:
|
case Code.Callvirt:
|
||||||
case Code.Newobj:
|
case Code.Newobj:
|
||||||
return InlineOtherMethod(instrIndex, methodToInline, instr, index);
|
inlinedMethod = InlineOtherMethod(instrIndex, methodToInline, instr, index);
|
||||||
|
break;
|
||||||
|
|
||||||
case Code.Ldc_I4:
|
case Code.Ldc_I4:
|
||||||
case Code.Ldc_I4_0:
|
case Code.Ldc_I4_0:
|
||||||
|
@ -106,11 +108,18 @@ namespace de4dot.blocks.cflow {
|
||||||
case Code.Ldtoken:
|
case Code.Ldtoken:
|
||||||
case Code.Ldsfld:
|
case Code.Ldsfld:
|
||||||
case Code.Ldsflda:
|
case Code.Ldsflda:
|
||||||
return InlineLoadMethod(instrIndex, methodToInline, instr, index);
|
inlinedMethod = InlineLoadMethod(instrIndex, methodToInline, instr, index);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
inlinedMethod = false;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
OnInlinedMethod(methodToInline, inlinedMethod);
|
||||||
|
return inlinedMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void OnInlinedMethod(MethodDef methodToInline, bool inlinedMethod) {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool IsCompatibleType(int paramIndex, IType origType, IType newType) {
|
protected override bool IsCompatibleType(int paramIndex, IType origType, IType newType) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user