Browse Source

Merge branch 'split-variables'

pull/1213/head
Daniel Grunwald 7 years ago
parent
commit
238d2900a8
  1. 6
      ICSharpCode.Decompiler.Tests/TestCases/ILPretty/FSharpUsing_Debug.cs
  2. 6
      ICSharpCode.Decompiler.Tests/TestCases/ILPretty/FSharpUsing_Release.cs
  3. 36
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.cs
  4. 122
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.il
  5. 107
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.opt.il
  6. 135
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.opt.roslyn.il
  7. 150
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.roslyn.il
  8. 9
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/CustomAttributes.cs
  9. 9
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/CustomAttributes.il
  10. 9
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/CustomAttributes.opt.il
  11. 9
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/CustomAttributes.opt.roslyn.il
  12. 9
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/CustomAttributes.roslyn.il
  13. 6
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/NullPropagation.cs
  14. 501
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/NullPropagation.opt.roslyn.il
  15. 503
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/NullPropagation.roslyn.il
  16. 20
      ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs
  17. 12
      ICSharpCode.Decompiler/CSharp/StatementBuilder.cs
  18. 16
      ICSharpCode.Decompiler/CSharp/Transforms/DeclareVariables.cs
  19. 2
      ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj
  20. 1
      ICSharpCode.Decompiler/IL/ControlFlow/YieldReturnDecompiler.cs
  21. 12
      ICSharpCode.Decompiler/IL/ILVariable.cs
  22. 9
      ICSharpCode.Decompiler/IL/Instructions/CompoundAssignmentInstruction.cs
  23. 117
      ICSharpCode.Decompiler/IL/Transforms/SplitVariables.cs
  24. 20
      ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs
  25. 4
      ICSharpCode.Decompiler/TypeSystem/ByReferenceType.cs
  26. 5
      ICSharpCode.Decompiler/TypeSystem/IType.cs
  27. 4
      ICSharpCode.Decompiler/TypeSystem/Implementation/AbstractType.cs
  28. 2
      ICSharpCode.Decompiler/TypeSystem/Implementation/AbstractTypeParameter.cs
  29. 2
      ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataTypeDefinition.cs
  30. 2
      ICSharpCode.Decompiler/TypeSystem/Implementation/MinimalCorlib.cs
  31. 1
      ICSharpCode.Decompiler/TypeSystem/Implementation/PinnedType.cs
  32. 1
      ICSharpCode.Decompiler/TypeSystem/ModifiedType.cs
  33. 5
      ICSharpCode.Decompiler/TypeSystem/ParameterizedType.cs
  34. 8
      ICSharpCode.Decompiler/TypeSystem/TypeSystemExtensions.cs

6
ICSharpCode.Decompiler.Tests/TestCases/ILPretty/FSharpUsing_Debug.cs

@ -31,7 +31,7 @@ public static class FSharpUsingPatterns @@ -31,7 +31,7 @@ public static class FSharpUsingPatterns
public static void sample4()
{
Console.WriteLine("some text");
int num = default(int);
int num;
using (FileStream fileStream = File.OpenRead("x.txt")) {
num = fileStream.ReadByte();
}
@ -42,12 +42,12 @@ public static class FSharpUsingPatterns @@ -42,12 +42,12 @@ public static class FSharpUsingPatterns
public static void sample5()
{
Console.WriteLine("some text");
int num = default(int);
int num;
using (FileStream fileStream = File.OpenRead("x.txt")) {
num = fileStream.ReadByte();
}
int num2 = num;
int num3 = default(int);
int num3;
using (FileStream fileStream = File.OpenRead("x.txt")) {
fileStream.ReadByte();
num3 = fileStream.ReadByte();

6
ICSharpCode.Decompiler.Tests/TestCases/ILPretty/FSharpUsing_Release.cs

@ -31,7 +31,7 @@ public static class FSharpUsingPatterns @@ -31,7 +31,7 @@ public static class FSharpUsingPatterns
public static void sample4()
{
Console.WriteLine("some text");
int num = default(int);
int num;
using (FileStream fileStream = File.OpenRead("x.txt")) {
num = fileStream.ReadByte();
}
@ -42,12 +42,12 @@ public static class FSharpUsingPatterns @@ -42,12 +42,12 @@ public static class FSharpUsingPatterns
public static void sample5()
{
Console.WriteLine("some text");
int num = default(int);
int num;
using (FileStream fileStream = File.OpenRead("x.txt")) {
num = fileStream.ReadByte();
}
int num2 = num;
int num3 = default(int);
int num3;
using (FileStream fileStream = File.OpenRead("x.txt")) {
fileStream.ReadByte();
num3 = fileStream.ReadByte();

36
ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.cs

@ -120,6 +120,10 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -120,6 +120,10 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
get;
set;
}
public string StringProp {
get;
set;
}
public CustomClass CustomClassProp {
get;
@ -411,6 +415,11 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -411,6 +415,11 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
set;
}
public static string StaticStringProperty {
get;
set;
}
#if CS70
private static ref CustomStruct2 GetStruct()
{
@ -4540,5 +4549,32 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -4540,5 +4549,32 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
items[num++] = item;
items[num++] = item;
}
#if !LEGACY_CSC
// Legacy csc generates a slightly different pattern for string compound assignment
// as for all other compound assignments. We'll ignore that edge case.
// Note: it's possible that the pre-CopyPropagation run of TransformAssignments is causing trouble there,
// and that the compound assignment transform would be fine if it didn't get disrupted.
private static void Issue1082(string[] strings, List<char> chars, bool flag, int i)
{
// The 'chars[i]' result is stored in a temporary, and both branches use the
// same temporary. In order to inline the generated value-type temporary, we
// need to split it, even though it has the address taken for the ToString() call.
if (flag) {
strings[1] += chars[i].ToString();
} else {
strings[0] += chars[i].ToString();
}
}
#endif
private static void StringPropertyCompoundAssign()
{
StaticStringProperty += "a";
StaticStringProperty += 1;
new CustomClass().StringProp += "a";
new CustomClass().StringProp += 1;
}
}
}

122
ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.il

@ -163,8 +163,8 @@ @@ -163,8 +163,8 @@
.property instance int32 Property()
{
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::set_Property(int32)
.get instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::get_Property()
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::set_Property(int32)
} // end of property MutableClass::Property
.property instance uint8 ByteProperty()
{
@ -224,6 +224,8 @@ @@ -224,6 +224,8 @@
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private uint64 '<UlongProp>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private string '<StringProp>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass '<CustomClassProp>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomStruct '<CustomStructProp>k__BackingField'
@ -452,6 +454,34 @@ @@ -452,6 +454,34 @@
IL_0007: ret
} // end of method CustomClass::set_UlongProp
.method public hidebysig specialname
instance string get_StringProp() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 11 (0xb)
.maxstack 1
.locals init (string V_0)
IL_0000: ldarg.0
IL_0001: ldfld string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::'<StringProp>k__BackingField'
IL_0006: stloc.0
IL_0007: br.s IL_0009
IL_0009: ldloc.0
IL_000a: ret
} // end of method CustomClass::get_StringProp
.method public hidebysig specialname
instance void set_StringProp(string 'value') cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: stfld string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::'<StringProp>k__BackingField'
IL_0007: ret
} // end of method CustomClass::set_StringProp
.method public hidebysig specialname
instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass
get_CustomClassProp() cil managed
@ -676,8 +706,8 @@ @@ -676,8 +706,8 @@
.property instance uint8 ByteProp()
{
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_ByteProp(uint8)
.get instance uint8 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::get_ByteProp()
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_ByteProp(uint8)
} // end of property CustomClass::ByteProp
.property instance int8 SbyteProp()
{
@ -711,14 +741,19 @@ @@ -711,14 +741,19 @@
} // end of property CustomClass::LongProp
.property instance uint64 UlongProp()
{
.get instance uint64 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::get_UlongProp()
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_UlongProp(uint64)
.get instance uint64 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::get_UlongProp()
} // end of property CustomClass::UlongProp
.property instance string StringProp()
{
.get instance string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::get_StringProp()
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_StringProp(string)
} // end of property CustomClass::StringProp
.property instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass
CustomClassProp()
{
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_CustomClassProp(class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass)
.get instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::get_CustomClassProp()
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_CustomClassProp(class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass)
} // end of property CustomClass::CustomClassProp
.property instance valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomStruct
CustomStructProp()
@ -1161,8 +1196,8 @@ @@ -1161,8 +1196,8 @@
} // end of property CustomStruct::CustomClassProp
.property instance uint8 ByteProp()
{
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomStruct::set_ByteProp(uint8)
.get instance uint8 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomStruct::get_ByteProp()
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomStruct::set_ByteProp(uint8)
} // end of property CustomStruct::ByteProp
.property instance int8 SbyteProp()
{
@ -1191,8 +1226,8 @@ @@ -1191,8 +1226,8 @@
} // end of property CustomStruct::UintProp
.property instance int64 LongProp()
{
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomStruct::set_LongProp(int64)
.get instance int64 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomStruct::get_LongProp()
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomStruct::set_LongProp(int64)
} // end of property CustomStruct::LongProp
.property instance uint64 UlongProp()
{
@ -1613,6 +1648,8 @@ @@ -1613,6 +1648,8 @@
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/ShortEnum '<StaticShortProperty>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static string '<StaticStringProperty>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.method private hidebysig specialname static
class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass
get_CustomClassProp() cil managed
@ -1928,6 +1965,32 @@ @@ -1928,6 +1965,32 @@
IL_0006: ret
} // end of method CompoundAssignmentTest::set_StaticShortProperty
.method public hidebysig specialname static
string get_StaticStringProperty() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 10 (0xa)
.maxstack 1
.locals init (string V_0)
IL_0000: ldsfld string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::'<StaticStringProperty>k__BackingField'
IL_0005: stloc.0
IL_0006: br.s IL_0008
IL_0008: ldloc.0
IL_0009: ret
} // end of method CompoundAssignmentTest::get_StaticStringProperty
.method public hidebysig specialname static
void set_StaticStringProperty(string 'value') cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: stsfld string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::'<StaticStringProperty>k__BackingField'
IL_0006: ret
} // end of method CompoundAssignmentTest::set_StaticStringProperty
.method private hidebysig static class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass
GetClass() cil managed
{
@ -21495,6 +21558,44 @@ @@ -21495,6 +21558,44 @@
IL_0025: ret
} // end of method CompoundAssignmentTest::Issue1007
.method private hidebysig static void StringPropertyCompoundAssign() cil managed
{
// Code size 100 (0x64)
.maxstack 3
IL_0000: nop
IL_0001: call string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticStringProperty()
IL_0006: ldstr "a"
IL_000b: call string [mscorlib]System.String::Concat(string,
string)
IL_0010: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::set_StaticStringProperty(string)
IL_0015: nop
IL_0016: call string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticStringProperty()
IL_001b: ldc.i4.1
IL_001c: box [mscorlib]System.Int32
IL_0021: call string [mscorlib]System.String::Concat(object,
object)
IL_0026: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::set_StaticStringProperty(string)
IL_002b: nop
IL_002c: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::.ctor()
IL_0031: dup
IL_0032: call instance string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::get_StringProp()
IL_0037: ldstr "a"
IL_003c: call string [mscorlib]System.String::Concat(string,
string)
IL_0041: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_StringProp(string)
IL_0046: nop
IL_0047: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::.ctor()
IL_004c: dup
IL_004d: call instance string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::get_StringProp()
IL_0052: ldc.i4.1
IL_0053: box [mscorlib]System.Int32
IL_0058: call string [mscorlib]System.String::Concat(object,
object)
IL_005d: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_StringProp(string)
IL_0062: nop
IL_0063: ret
} // end of method CompoundAssignmentTest::StringPropertyCompoundAssign
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
@ -21563,15 +21664,20 @@ @@ -21563,15 +21664,20 @@
} // end of property CompoundAssignmentTest::UlongProp
.property int32 StaticProperty()
{
.get int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticProperty()
.set void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::set_StaticProperty(int32)
.get int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticProperty()
} // end of property CompoundAssignmentTest::StaticProperty
.property valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/ShortEnum
StaticShortProperty()
{
.get valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/ShortEnum ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticShortProperty()
.set void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::set_StaticShortProperty(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/ShortEnum)
.get valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/ShortEnum ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticShortProperty()
} // end of property CompoundAssignmentTest::StaticShortProperty
.property string StaticStringProperty()
{
.get string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticStringProperty()
.set void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::set_StaticStringProperty(string)
} // end of property CompoundAssignmentTest::StaticStringProperty
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest

107
ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.opt.il

@ -146,8 +146,8 @@ @@ -146,8 +146,8 @@
.property instance int32 Property()
{
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::set_Property(int32)
.get instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::get_Property()
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::set_Property(int32)
} // end of property MutableClass::Property
.property instance uint8 ByteProperty()
{
@ -207,6 +207,8 @@ @@ -207,6 +207,8 @@
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private uint64 '<UlongProp>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private string '<StringProp>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass '<CustomClassProp>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomStruct '<CustomStructProp>k__BackingField'
@ -395,6 +397,29 @@ @@ -395,6 +397,29 @@
IL_0007: ret
} // end of method CustomClass::set_UlongProp
.method public hidebysig specialname
instance string get_StringProp() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldfld string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::'<StringProp>k__BackingField'
IL_0006: ret
} // end of method CustomClass::get_StringProp
.method public hidebysig specialname
instance void set_StringProp(string 'value') cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: stfld string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::'<StringProp>k__BackingField'
IL_0007: ret
} // end of method CustomClass::set_StringProp
.method public hidebysig specialname
instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass
get_CustomClassProp() cil managed
@ -596,8 +621,8 @@ @@ -596,8 +621,8 @@
.property instance uint8 ByteProp()
{
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_ByteProp(uint8)
.get instance uint8 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::get_ByteProp()
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_ByteProp(uint8)
} // end of property CustomClass::ByteProp
.property instance int8 SbyteProp()
{
@ -631,14 +656,19 @@ @@ -631,14 +656,19 @@
} // end of property CustomClass::LongProp
.property instance uint64 UlongProp()
{
.get instance uint64 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::get_UlongProp()
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_UlongProp(uint64)
.get instance uint64 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::get_UlongProp()
} // end of property CustomClass::UlongProp
.property instance string StringProp()
{
.get instance string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::get_StringProp()
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_StringProp(string)
} // end of property CustomClass::StringProp
.property instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass
CustomClassProp()
{
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_CustomClassProp(class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass)
.get instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::get_CustomClassProp()
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_CustomClassProp(class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass)
} // end of property CustomClass::CustomClassProp
.property instance valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomStruct
CustomStructProp()
@ -1024,8 +1054,8 @@ @@ -1024,8 +1054,8 @@
} // end of property CustomStruct::CustomClassProp
.property instance uint8 ByteProp()
{
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomStruct::set_ByteProp(uint8)
.get instance uint8 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomStruct::get_ByteProp()
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomStruct::set_ByteProp(uint8)
} // end of property CustomStruct::ByteProp
.property instance int8 SbyteProp()
{
@ -1054,8 +1084,8 @@ @@ -1054,8 +1084,8 @@
} // end of property CustomStruct::UintProp
.property instance int64 LongProp()
{
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomStruct::set_LongProp(int64)
.get instance int64 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomStruct::get_LongProp()
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomStruct::set_LongProp(int64)
} // end of property CustomStruct::LongProp
.property instance uint64 UlongProp()
{
@ -1426,6 +1456,8 @@ @@ -1426,6 +1456,8 @@
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/ShortEnum '<StaticShortProperty>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static string '<StaticStringProperty>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.method private hidebysig specialname static
class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass
get_CustomClassProp() cil managed
@ -1681,6 +1713,27 @@ @@ -1681,6 +1713,27 @@
IL_0006: ret
} // end of method CompoundAssignmentTest::set_StaticShortProperty
.method public hidebysig specialname static
string get_StaticStringProperty() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 6 (0x6)
.maxstack 8
IL_0000: ldsfld string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::'<StaticStringProperty>k__BackingField'
IL_0005: ret
} // end of method CompoundAssignmentTest::get_StaticStringProperty
.method public hidebysig specialname static
void set_StaticStringProperty(string 'value') cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: stsfld string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::'<StaticStringProperty>k__BackingField'
IL_0006: ret
} // end of method CompoundAssignmentTest::set_StaticStringProperty
.method private hidebysig static class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass
GetClass() cil managed
{
@ -19787,6 +19840,39 @@ @@ -19787,6 +19840,39 @@
IL_0024: ret
} // end of method CompoundAssignmentTest::Issue1007
.method private hidebysig static void StringPropertyCompoundAssign() cil managed
{
// Code size 95 (0x5f)
.maxstack 3
IL_0000: call string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticStringProperty()
IL_0005: ldstr "a"
IL_000a: call string [mscorlib]System.String::Concat(string,
string)
IL_000f: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::set_StaticStringProperty(string)
IL_0014: call string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticStringProperty()
IL_0019: ldc.i4.1
IL_001a: box [mscorlib]System.Int32
IL_001f: call string [mscorlib]System.String::Concat(object,
object)
IL_0024: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::set_StaticStringProperty(string)
IL_0029: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::.ctor()
IL_002e: dup
IL_002f: call instance string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::get_StringProp()
IL_0034: ldstr "a"
IL_0039: call string [mscorlib]System.String::Concat(string,
string)
IL_003e: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_StringProp(string)
IL_0043: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::.ctor()
IL_0048: dup
IL_0049: call instance string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::get_StringProp()
IL_004e: ldc.i4.1
IL_004f: box [mscorlib]System.Int32
IL_0054: call string [mscorlib]System.String::Concat(object,
object)
IL_0059: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_StringProp(string)
IL_005e: ret
} // end of method CompoundAssignmentTest::StringPropertyCompoundAssign
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
@ -19854,15 +19940,20 @@ @@ -19854,15 +19940,20 @@
} // end of property CompoundAssignmentTest::UlongProp
.property int32 StaticProperty()
{
.get int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticProperty()
.set void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::set_StaticProperty(int32)
.get int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticProperty()
} // end of property CompoundAssignmentTest::StaticProperty
.property valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/ShortEnum
StaticShortProperty()
{
.get valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/ShortEnum ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticShortProperty()
.set void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::set_StaticShortProperty(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/ShortEnum)
.get valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/ShortEnum ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticShortProperty()
} // end of property CompoundAssignmentTest::StaticShortProperty
.property string StaticStringProperty()
{
.get string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticStringProperty()
.set void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::set_StaticStringProperty(string)
} // end of property CompoundAssignmentTest::StaticStringProperty
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest

135
ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.opt.roslyn.il

@ -211,6 +211,8 @@ @@ -211,6 +211,8 @@
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private uint64 '<UlongProp>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private string '<StringProp>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass '<CustomClassProp>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomStruct '<CustomStructProp>k__BackingField'
@ -399,6 +401,29 @@ @@ -399,6 +401,29 @@
IL_0007: ret
} // end of method CustomClass::set_UlongProp
.method public hidebysig specialname
instance string get_StringProp() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldfld string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::'<StringProp>k__BackingField'
IL_0006: ret
} // end of method CustomClass::get_StringProp
.method public hidebysig specialname
instance void set_StringProp(string 'value') cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: stfld string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::'<StringProp>k__BackingField'
IL_0007: ret
} // end of method CustomClass::set_StringProp
.method public hidebysig specialname
instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass
get_CustomClassProp() cil managed
@ -638,6 +663,11 @@ @@ -638,6 +663,11 @@
.get instance uint64 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::get_UlongProp()
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_UlongProp(uint64)
} // end of property CustomClass::UlongProp
.property instance string StringProp()
{
.get instance string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::get_StringProp()
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_StringProp(string)
} // end of property CustomClass::StringProp
.property instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass
CustomClassProp()
{
@ -1430,6 +1460,8 @@ @@ -1430,6 +1460,8 @@
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/ShortEnum '<StaticShortProperty>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static string '<StaticStringProperty>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.method private hidebysig specialname static
class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass
get_CustomClassProp() cil managed
@ -1685,6 +1717,27 @@ @@ -1685,6 +1717,27 @@
IL_0006: ret
} // end of method CompoundAssignmentTest::set_StaticShortProperty
.method public hidebysig specialname static
string get_StaticStringProperty() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 6 (0x6)
.maxstack 8
IL_0000: ldsfld string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::'<StaticStringProperty>k__BackingField'
IL_0005: ret
} // end of method CompoundAssignmentTest::get_StaticStringProperty
.method public hidebysig specialname static
void set_StaticStringProperty(string 'value') cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: stsfld string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::'<StaticStringProperty>k__BackingField'
IL_0006: ret
} // end of method CompoundAssignmentTest::set_StaticStringProperty
.method private hidebysig static valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomStruct2&
GetStruct() cil managed
{
@ -23089,6 +23142,83 @@ @@ -23089,6 +23142,83 @@
IL_001a: ret
} // end of method CompoundAssignmentTest::Issue1007
.method private hidebysig static void Issue1082(string[] strings,
class [mscorlib]System.Collections.Generic.List`1<char> chars,
bool flag,
int32 i) cil managed
{
// Code size 65 (0x41)
.maxstack 4
.locals init (char V_0)
IL_0000: ldarg.2
IL_0001: brfalse.s IL_0022
IL_0003: ldarg.0
IL_0004: ldc.i4.1
IL_0005: ldelema [mscorlib]System.String
IL_000a: dup
IL_000b: ldind.ref
IL_000c: ldarg.1
IL_000d: ldarg.3
IL_000e: callvirt instance !0 class [mscorlib]System.Collections.Generic.List`1<char>::get_Item(int32)
IL_0013: stloc.0
IL_0014: ldloca.s V_0
IL_0016: call instance string [mscorlib]System.Char::ToString()
IL_001b: call string [mscorlib]System.String::Concat(string,
string)
IL_0020: stind.ref
IL_0021: ret
IL_0022: ldarg.0
IL_0023: ldc.i4.0
IL_0024: ldelema [mscorlib]System.String
IL_0029: dup
IL_002a: ldind.ref
IL_002b: ldarg.1
IL_002c: ldarg.3
IL_002d: callvirt instance !0 class [mscorlib]System.Collections.Generic.List`1<char>::get_Item(int32)
IL_0032: stloc.0
IL_0033: ldloca.s V_0
IL_0035: call instance string [mscorlib]System.Char::ToString()
IL_003a: call string [mscorlib]System.String::Concat(string,
string)
IL_003f: stind.ref
IL_0040: ret
} // end of method CompoundAssignmentTest::Issue1082
.method private hidebysig static void StringPropertyCompoundAssign() cil managed
{
// Code size 95 (0x5f)
.maxstack 3
IL_0000: call string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticStringProperty()
IL_0005: ldstr "a"
IL_000a: call string [mscorlib]System.String::Concat(string,
string)
IL_000f: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::set_StaticStringProperty(string)
IL_0014: call string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticStringProperty()
IL_0019: ldc.i4.1
IL_001a: box [mscorlib]System.Int32
IL_001f: call string [mscorlib]System.String::Concat(object,
object)
IL_0024: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::set_StaticStringProperty(string)
IL_0029: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::.ctor()
IL_002e: dup
IL_002f: callvirt instance string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::get_StringProp()
IL_0034: ldstr "a"
IL_0039: call string [mscorlib]System.String::Concat(string,
string)
IL_003e: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_StringProp(string)
IL_0043: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::.ctor()
IL_0048: dup
IL_0049: callvirt instance string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::get_StringProp()
IL_004e: ldc.i4.1
IL_004f: box [mscorlib]System.Int32
IL_0054: call string [mscorlib]System.String::Concat(object,
object)
IL_0059: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_StringProp(string)
IL_005e: ret
} // end of method CompoundAssignmentTest::StringPropertyCompoundAssign
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
@ -23165,6 +23295,11 @@ @@ -23165,6 +23295,11 @@
.get valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/ShortEnum ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticShortProperty()
.set void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::set_StaticShortProperty(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/ShortEnum)
} // end of property CompoundAssignmentTest::StaticShortProperty
.property string StaticStringProperty()
{
.get string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticStringProperty()
.set void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::set_StaticStringProperty(string)
} // end of property CompoundAssignmentTest::StaticStringProperty
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest

150
ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.roslyn.il

@ -230,6 +230,9 @@ @@ -230,6 +230,9 @@
.field private uint64 '<UlongProp>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
.field private string '<StringProp>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
.field private class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass '<CustomClassProp>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
@ -420,6 +423,29 @@ @@ -420,6 +423,29 @@
IL_0007: ret
} // end of method CustomClass::set_UlongProp
.method public hidebysig specialname
instance string get_StringProp() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldfld string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::'<StringProp>k__BackingField'
IL_0006: ret
} // end of method CustomClass::get_StringProp
.method public hidebysig specialname
instance void set_StringProp(string 'value') cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: stfld string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::'<StringProp>k__BackingField'
IL_0007: ret
} // end of method CustomClass::set_StringProp
.method public hidebysig specialname
instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass
get_CustomClassProp() cil managed
@ -673,6 +699,11 @@ @@ -673,6 +699,11 @@
.get instance uint64 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::get_UlongProp()
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_UlongProp(uint64)
} // end of property CustomClass::UlongProp
.property instance string StringProp()
{
.get instance string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::get_StringProp()
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_StringProp(string)
} // end of property CustomClass::StringProp
.property instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass
CustomClassProp()
{
@ -1508,6 +1539,9 @@ @@ -1508,6 +1539,9 @@
.field private static valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/ShortEnum '<StaticShortProperty>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
.field private static string '<StaticStringProperty>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
.method private hidebysig specialname static
class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass
get_CustomClassProp() cil managed
@ -1763,6 +1797,27 @@ @@ -1763,6 +1797,27 @@
IL_0006: ret
} // end of method CompoundAssignmentTest::set_StaticShortProperty
.method public hidebysig specialname static
string get_StaticStringProperty() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 6 (0x6)
.maxstack 8
IL_0000: ldsfld string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::'<StaticStringProperty>k__BackingField'
IL_0005: ret
} // end of method CompoundAssignmentTest::get_StaticStringProperty
.method public hidebysig specialname static
void set_StaticStringProperty(string 'value') cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: stsfld string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::'<StaticStringProperty>k__BackingField'
IL_0006: ret
} // end of method CompoundAssignmentTest::set_StaticStringProperty
.method private hidebysig static valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomStruct2&
GetStruct() cil managed
{
@ -25447,6 +25502,96 @@ @@ -25447,6 +25502,96 @@
IL_001b: ret
} // end of method CompoundAssignmentTest::Issue1007
.method private hidebysig static void Issue1082(string[] strings,
class [mscorlib]System.Collections.Generic.List`1<char> chars,
bool flag,
int32 i) cil managed
{
// Code size 73 (0x49)
.maxstack 4
.locals init (bool V_0,
char V_1)
IL_0000: nop
IL_0001: ldarg.2
IL_0002: stloc.0
IL_0003: ldloc.0
IL_0004: brfalse.s IL_0028
IL_0006: nop
IL_0007: ldarg.0
IL_0008: ldc.i4.1
IL_0009: ldelema [mscorlib]System.String
IL_000e: dup
IL_000f: ldind.ref
IL_0010: ldarg.1
IL_0011: ldarg.3
IL_0012: callvirt instance !0 class [mscorlib]System.Collections.Generic.List`1<char>::get_Item(int32)
IL_0017: stloc.1
IL_0018: ldloca.s V_1
IL_001a: call instance string [mscorlib]System.Char::ToString()
IL_001f: call string [mscorlib]System.String::Concat(string,
string)
IL_0024: stind.ref
IL_0025: nop
IL_0026: br.s IL_0048
IL_0028: nop
IL_0029: ldarg.0
IL_002a: ldc.i4.0
IL_002b: ldelema [mscorlib]System.String
IL_0030: dup
IL_0031: ldind.ref
IL_0032: ldarg.1
IL_0033: ldarg.3
IL_0034: callvirt instance !0 class [mscorlib]System.Collections.Generic.List`1<char>::get_Item(int32)
IL_0039: stloc.1
IL_003a: ldloca.s V_1
IL_003c: call instance string [mscorlib]System.Char::ToString()
IL_0041: call string [mscorlib]System.String::Concat(string,
string)
IL_0046: stind.ref
IL_0047: nop
IL_0048: ret
} // end of method CompoundAssignmentTest::Issue1082
.method private hidebysig static void StringPropertyCompoundAssign() cil managed
{
// Code size 100 (0x64)
.maxstack 3
IL_0000: nop
IL_0001: call string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticStringProperty()
IL_0006: ldstr "a"
IL_000b: call string [mscorlib]System.String::Concat(string,
string)
IL_0010: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::set_StaticStringProperty(string)
IL_0015: nop
IL_0016: call string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticStringProperty()
IL_001b: ldc.i4.1
IL_001c: box [mscorlib]System.Int32
IL_0021: call string [mscorlib]System.String::Concat(object,
object)
IL_0026: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::set_StaticStringProperty(string)
IL_002b: nop
IL_002c: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::.ctor()
IL_0031: dup
IL_0032: callvirt instance string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::get_StringProp()
IL_0037: ldstr "a"
IL_003c: call string [mscorlib]System.String::Concat(string,
string)
IL_0041: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_StringProp(string)
IL_0046: nop
IL_0047: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::.ctor()
IL_004c: dup
IL_004d: callvirt instance string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::get_StringProp()
IL_0052: ldc.i4.1
IL_0053: box [mscorlib]System.Int32
IL_0058: call string [mscorlib]System.String::Concat(object,
object)
IL_005d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/CustomClass::set_StringProp(string)
IL_0062: nop
IL_0063: ret
} // end of method CompoundAssignmentTest::StringPropertyCompoundAssign
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
@ -25524,6 +25669,11 @@ @@ -25524,6 +25669,11 @@
.get valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/ShortEnum ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticShortProperty()
.set void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::set_StaticShortProperty(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/ShortEnum)
} // end of property CompoundAssignmentTest::StaticShortProperty
.property string StaticStringProperty()
{
.get string ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticStringProperty()
.set void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::set_StaticStringProperty(string)
} // end of property CompoundAssignmentTest::StaticStringProperty
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest

9
ICSharpCode.Decompiler.Tests/TestCases/Pretty/CustomAttributes.cs

@ -133,7 +133,14 @@ namespace CustomAttributes @@ -133,7 +133,14 @@ namespace CustomAttributes
1f,
2.0,
"text",
null
null,
typeof(int),
new object[] {
1
},
new int[] {
1
}
})]
public static void BoxedLiteralsArray()
{

9
ICSharpCode.Decompiler.Tests/TestCases/Pretty/CustomAttributes.il

@ -321,11 +321,18 @@ @@ -321,11 +321,18 @@
.method public hidebysig static void BoxedLiteralsArray() cil managed
{
.custom instance void CustomAttributes.CustomAttributes/MyAttribute::.ctor(object) = ( 01 00 1D 51 10 00 00 00 08 01 00 00 00 09 02 00 // ...Q............
.custom instance void CustomAttributes.CustomAttributes/MyAttribute::.ctor(object) = ( 01 00 1D 51 13 00 00 00 08 01 00 00 00 09 02 00 // ...Q............
00 00 0A 03 00 00 00 00 00 00 00 0B 04 00 00 00
00 00 00 00 06 05 00 07 06 00 05 07 04 08 03 61 // ...............a
00 03 00 00 03 FF FE 03 FF FF 0C 00 00 80 3F 0D // ..............?.
00 00 00 00 00 00 00 40 0E 04 74 65 78 74 0E FF // .......@..text..
50 59 53 79 73 74 65 6D 2E 49 6E 74 33 32 2C 20 // PYSystem.Int32,
6D 73 63 6F 72 6C 69 62 2C 20 56 65 72 73 69 6F // mscorlib, Versio
6E 3D 34 2E 30 2E 30 2E 30 2C 20 43 75 6C 74 75 // n=4.0.0.0, Cultu
72 65 3D 6E 65 75 74 72 61 6C 2C 20 50 75 62 6C // re=neutral, Publ
69 63 4B 65 79 54 6F 6B 65 6E 3D 62 37 37 61 35 // icKeyToken=b77a5
63 35 36 31 39 33 34 65 30 38 39 1D 51 01 00 00 // c561934e089.Q...
00 08 01 00 00 00 1D 08 01 00 00 00 01 00 00 00
00 00 )
// Code size 2 (0x2)
.maxstack 8

9
ICSharpCode.Decompiler.Tests/TestCases/Pretty/CustomAttributes.opt.il

@ -306,11 +306,18 @@ @@ -306,11 +306,18 @@
.method public hidebysig static void BoxedLiteralsArray() cil managed
{
.custom instance void CustomAttributes.CustomAttributes/MyAttribute::.ctor(object) = ( 01 00 1D 51 10 00 00 00 08 01 00 00 00 09 02 00 // ...Q............
.custom instance void CustomAttributes.CustomAttributes/MyAttribute::.ctor(object) = ( 01 00 1D 51 13 00 00 00 08 01 00 00 00 09 02 00 // ...Q............
00 00 0A 03 00 00 00 00 00 00 00 0B 04 00 00 00
00 00 00 00 06 05 00 07 06 00 05 07 04 08 03 61 // ...............a
00 03 00 00 03 FF FE 03 FF FF 0C 00 00 80 3F 0D // ..............?.
00 00 00 00 00 00 00 40 0E 04 74 65 78 74 0E FF // .......@..text..
50 59 53 79 73 74 65 6D 2E 49 6E 74 33 32 2C 20 // PYSystem.Int32,
6D 73 63 6F 72 6C 69 62 2C 20 56 65 72 73 69 6F // mscorlib, Versio
6E 3D 34 2E 30 2E 30 2E 30 2C 20 43 75 6C 74 75 // n=4.0.0.0, Cultu
72 65 3D 6E 65 75 74 72 61 6C 2C 20 50 75 62 6C // re=neutral, Publ
69 63 4B 65 79 54 6F 6B 65 6E 3D 62 37 37 61 35 // icKeyToken=b77a5
63 35 36 31 39 33 34 65 30 38 39 1D 51 01 00 00 // c561934e089.Q...
00 08 01 00 00 00 1D 08 01 00 00 00 01 00 00 00
00 00 )
// Code size 1 (0x1)
.maxstack 8

9
ICSharpCode.Decompiler.Tests/TestCases/Pretty/CustomAttributes.opt.roslyn.il

@ -310,11 +310,18 @@ @@ -310,11 +310,18 @@
.method public hidebysig static void BoxedLiteralsArray() cil managed
{
.custom instance void CustomAttributes.CustomAttributes/MyAttribute::.ctor(object) = ( 01 00 1D 51 10 00 00 00 08 01 00 00 00 09 02 00 // ...Q............
.custom instance void CustomAttributes.CustomAttributes/MyAttribute::.ctor(object) = ( 01 00 1D 51 13 00 00 00 08 01 00 00 00 09 02 00 // ...Q............
00 00 0A 03 00 00 00 00 00 00 00 0B 04 00 00 00
00 00 00 00 06 05 00 07 06 00 05 07 04 08 03 61 // ...............a
00 03 00 00 03 FF FE 03 FF FF 0C 00 00 80 3F 0D // ..............?.
00 00 00 00 00 00 00 40 0E 04 74 65 78 74 0E FF // .......@..text..
50 59 53 79 73 74 65 6D 2E 49 6E 74 33 32 2C 20 // PYSystem.Int32,
6D 73 63 6F 72 6C 69 62 2C 20 56 65 72 73 69 6F // mscorlib, Versio
6E 3D 34 2E 30 2E 30 2E 30 2C 20 43 75 6C 74 75 // n=4.0.0.0, Cultu
72 65 3D 6E 65 75 74 72 61 6C 2C 20 50 75 62 6C // re=neutral, Publ
69 63 4B 65 79 54 6F 6B 65 6E 3D 62 37 37 61 35 // icKeyToken=b77a5
63 35 36 31 39 33 34 65 30 38 39 1D 51 01 00 00 // c561934e089.Q...
00 08 01 00 00 00 1D 08 01 00 00 00 01 00 00 00
00 00 )
// Code size 1 (0x1)
.maxstack 8

9
ICSharpCode.Decompiler.Tests/TestCases/Pretty/CustomAttributes.roslyn.il

@ -325,11 +325,18 @@ @@ -325,11 +325,18 @@
.method public hidebysig static void BoxedLiteralsArray() cil managed
{
.custom instance void CustomAttributes.CustomAttributes/MyAttribute::.ctor(object) = ( 01 00 1D 51 10 00 00 00 08 01 00 00 00 09 02 00 // ...Q............
.custom instance void CustomAttributes.CustomAttributes/MyAttribute::.ctor(object) = ( 01 00 1D 51 13 00 00 00 08 01 00 00 00 09 02 00 // ...Q............
00 00 0A 03 00 00 00 00 00 00 00 0B 04 00 00 00
00 00 00 00 06 05 00 07 06 00 05 07 04 08 03 61 // ...............a
00 03 00 00 03 FF FE 03 FF FF 0C 00 00 80 3F 0D // ..............?.
00 00 00 00 00 00 00 40 0E 04 74 65 78 74 0E FF // .......@..text..
50 59 53 79 73 74 65 6D 2E 49 6E 74 33 32 2C 20 // PYSystem.Int32,
6D 73 63 6F 72 6C 69 62 2C 20 56 65 72 73 69 6F // mscorlib, Versio
6E 3D 34 2E 30 2E 30 2E 30 2C 20 43 75 6C 74 75 // n=4.0.0.0, Cultu
72 65 3D 6E 65 75 74 72 61 6C 2C 20 50 75 62 6C // re=neutral, Publ
69 63 4B 65 79 54 6F 6B 65 6E 3D 62 37 37 61 35 // icKeyToken=b77a5
63 35 36 31 39 33 34 65 30 38 39 1D 51 01 00 00 // c561934e089.Q...
00 08 01 00 00 00 1D 08 01 00 00 00 01 00 00 00
00 00 )
// Code size 2 (0x2)
.maxstack 8

6
ICSharpCode.Decompiler.Tests/TestCases/Pretty/NullPropagation.cs

@ -127,7 +127,6 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -127,7 +127,6 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public void CallDoneStruct()
{
GetMyStruct()?.Done();
#if STRUCT_SPLITTING_IMPROVED
GetMyStruct()?.Field?.Done();
GetMyStruct()?.Field.Done();
GetMyStruct()?.Property1?.Done();
@ -135,16 +134,13 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -135,16 +134,13 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
GetMyStruct()?.Method1(GetInt())?.Done();
GetMyStruct()?.Method2(GetInt()).Done();
GetMyStruct()?[GetInt()]?.Done();
#endif
}
public void RequiredParentheses()
{
(GetMyClass()?.Field).Done();
(GetMyClass()?.Method(GetInt())).Done();
#if STRUCT_SPLITTING_IMPROVED
(GetMyStruct()?.Property2)?.Done();
#endif
}
public int?[] ChainsOnClass()
@ -162,7 +158,6 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -162,7 +158,6 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
};
}
#if STRUCT_SPLITTING_IMPROVED
public int?[] ChainsStruct()
{
return new int?[8] {
@ -176,7 +171,6 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -176,7 +171,6 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
GetMyStruct()?[GetInt()]?.IntVal
};
}
#endif
public int CoalescingReturn()
{

501
ICSharpCode.Decompiler.Tests/TestCases/Pretty/NullPropagation.opt.roslyn.il

@ -238,7 +238,7 @@ @@ -238,7 +238,7 @@
} // end of class ITest
.class abstract auto ansi sealed nested private beforefieldinit '<>o__26'
.class abstract auto ansi sealed nested private beforefieldinit '<>o__27'
extends [mscorlib]System.Object
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
@ -246,7 +246,7 @@ @@ -246,7 +246,7 @@
.field public static class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> '<>p__1'
.field public static class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> '<>p__2'
.field public static class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> '<>p__3'
} // end of class '<>o__26'
} // end of class '<>o__27'
.method private hidebysig instance int32
GetInt() cil managed
@ -467,33 +467,197 @@ @@ -467,33 +467,197 @@
.method public hidebysig instance void
CallDoneStruct() cil managed
{
// Code size 33 (0x21)
// Code size 388 (0x184)
.maxstack 2
.locals init (valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> V_0,
valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct V_1)
valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct V_1,
valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> V_2)
IL_0000: ldarg.0
IL_0001: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_0006: stloc.0
IL_0007: ldloca.s V_0
IL_0009: dup
IL_000a: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_000f: brtrue.s IL_0013
IL_000f: brtrue.s IL_0014
IL_0011: pop
IL_0012: ret
IL_0012: br.s IL_0021
IL_0014: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_0019: stloc.1
IL_001a: ldloca.s V_1
IL_001c: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Done()
IL_0021: ldarg.0
IL_0022: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_0027: stloc.0
IL_0028: ldloca.s V_0
IL_002a: dup
IL_002b: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_0030: brtrue.s IL_0035
IL_0032: pop
IL_0033: br.s IL_004a
IL_0035: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_003a: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Field
IL_003f: dup
IL_0040: brtrue.s IL_0045
IL_0042: pop
IL_0043: br.s IL_004a
IL_0045: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass::Done()
IL_004a: ldarg.0
IL_004b: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_0050: stloc.0
IL_0051: ldloca.s V_0
IL_0053: dup
IL_0054: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_0059: brtrue.s IL_005e
IL_005b: pop
IL_005c: br.s IL_006d
IL_005e: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_0063: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Field
IL_0068: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass::Done()
IL_006d: ldarg.0
IL_006e: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_0073: stloc.0
IL_0074: ldloca.s V_0
IL_0076: dup
IL_0077: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_007c: brtrue.s IL_0081
IL_0013: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_0018: stloc.1
IL_0019: ldloca.s V_1
IL_001b: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Done()
IL_0020: ret
IL_007e: pop
IL_007f: br.s IL_00a9
IL_0081: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_0086: stloc.1
IL_0087: ldloca.s V_1
IL_0089: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::get_Property1()
IL_008e: stloc.2
IL_008f: ldloca.s V_2
IL_0091: dup
IL_0092: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_0097: brtrue.s IL_009c
IL_0099: pop
IL_009a: br.s IL_00a9
IL_009c: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_00a1: stloc.1
IL_00a2: ldloca.s V_1
IL_00a4: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Done()
IL_00a9: ldarg.0
IL_00aa: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_00af: stloc.0
IL_00b0: ldloca.s V_0
IL_00b2: dup
IL_00b3: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_00b8: brtrue.s IL_00bd
IL_00ba: pop
IL_00bb: br.s IL_00d2
IL_00bd: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_00c2: stloc.1
IL_00c3: ldloca.s V_1
IL_00c5: call instance valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::get_Property2()
IL_00ca: stloc.1
IL_00cb: ldloca.s V_1
IL_00cd: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Done()
IL_00d2: ldarg.0
IL_00d3: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_00d8: stloc.0
IL_00d9: ldloca.s V_0
IL_00db: dup
IL_00dc: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_00e1: brtrue.s IL_00e6
IL_00e3: pop
IL_00e4: br.s IL_0114
IL_00e6: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_00eb: stloc.1
IL_00ec: ldloca.s V_1
IL_00ee: ldarg.0
IL_00ef: call instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetInt()
IL_00f4: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Method1(int32)
IL_00f9: stloc.2
IL_00fa: ldloca.s V_2
IL_00fc: dup
IL_00fd: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_0102: brtrue.s IL_0107
IL_0104: pop
IL_0105: br.s IL_0114
IL_0107: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_010c: stloc.1
IL_010d: ldloca.s V_1
IL_010f: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Done()
IL_0114: ldarg.0
IL_0115: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_011a: stloc.0
IL_011b: ldloca.s V_0
IL_011d: dup
IL_011e: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_0123: brtrue.s IL_0128
IL_0125: pop
IL_0126: br.s IL_0143
IL_0128: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_012d: stloc.1
IL_012e: ldloca.s V_1
IL_0130: ldarg.0
IL_0131: call instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetInt()
IL_0136: call instance valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Method2(int32)
IL_013b: stloc.1
IL_013c: ldloca.s V_1
IL_013e: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Done()
IL_0143: ldarg.0
IL_0144: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_0149: stloc.0
IL_014a: ldloca.s V_0
IL_014c: dup
IL_014d: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_0152: brtrue.s IL_0156
IL_0154: pop
IL_0155: ret
IL_0156: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_015b: stloc.1
IL_015c: ldloca.s V_1
IL_015e: ldarg.0
IL_015f: call instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetInt()
IL_0164: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::get_Item(int32)
IL_0169: stloc.2
IL_016a: ldloca.s V_2
IL_016c: dup
IL_016d: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_0172: brtrue.s IL_0176
IL_0174: pop
IL_0175: ret
IL_0176: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_017b: stloc.1
IL_017c: ldloca.s V_1
IL_017e: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Done()
IL_0183: ret
} // end of method NullPropagation::CallDoneStruct
.method public hidebysig instance void
RequiredParentheses() cil managed
{
// Code size 53 (0x35)
.maxstack 8
// Code size 126 (0x7e)
.maxstack 2
.locals init (valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> V_0,
valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> V_1,
valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct V_2)
IL_0000: ldarg.0
IL_0001: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyClass()
IL_0006: dup
@ -518,7 +682,39 @@ @@ -518,7 +682,39 @@
IL_0025: call instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetInt()
IL_002a: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass::Method(int32)
IL_002f: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass::Done()
IL_0034: ret
IL_0034: ldarg.0
IL_0035: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_003a: stloc.0
IL_003b: ldloca.s V_0
IL_003d: dup
IL_003e: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_0043: brtrue.s IL_0051
IL_0045: pop
IL_0046: ldloca.s V_1
IL_0048: initobj valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>
IL_004e: ldloc.1
IL_004f: br.s IL_0063
IL_0051: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_0056: stloc.2
IL_0057: ldloca.s V_2
IL_0059: call instance valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::get_Property2()
IL_005e: newobj instance void valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::.ctor(!0)
IL_0063: stloc.0
IL_0064: ldloca.s V_0
IL_0066: dup
IL_0067: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_006c: brtrue.s IL_0070
IL_006e: pop
IL_006f: ret
IL_0070: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_0075: stloc.2
IL_0076: ldloca.s V_2
IL_0078: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Done()
IL_007d: ret
} // end of method NullPropagation::RequiredParentheses
.method public hidebysig instance valuetype [mscorlib]System.Nullable`1<int32>[]
@ -728,6 +924,251 @@ @@ -728,6 +924,251 @@
IL_01d9: ret
} // end of method NullPropagation::ChainsOnClass
.method public hidebysig instance valuetype [mscorlib]System.Nullable`1<int32>[]
ChainsStruct() cil managed
{
// Code size 582 (0x246)
.maxstack 5
.locals init (valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> V_0,
valuetype [mscorlib]System.Nullable`1<int32> V_1,
valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct V_2,
valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> V_3)
IL_0000: ldc.i4.8
IL_0001: newarr valuetype [mscorlib]System.Nullable`1<int32>
IL_0006: dup
IL_0007: ldc.i4.0
IL_0008: ldarg.0
IL_0009: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_000e: stloc.0
IL_000f: ldloca.s V_0
IL_0011: dup
IL_0012: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_0017: brtrue.s IL_0025
IL_0019: pop
IL_001a: ldloca.s V_1
IL_001c: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_0022: ldloc.1
IL_0023: br.s IL_0034
IL_0025: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_002a: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::IntVal
IL_002f: newobj instance void valuetype [mscorlib]System.Nullable`1<int32>::.ctor(!0)
IL_0034: stelem valuetype [mscorlib]System.Nullable`1<int32>
IL_0039: dup
IL_003a: ldc.i4.1
IL_003b: ldarg.0
IL_003c: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_0041: stloc.0
IL_0042: ldloca.s V_0
IL_0044: dup
IL_0045: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_004a: brtrue.s IL_0058
IL_004c: pop
IL_004d: ldloca.s V_1
IL_004f: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_0055: ldloc.1
IL_0056: br.s IL_006c
IL_0058: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_005d: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Field
IL_0062: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass::IntVal
IL_0067: newobj instance void valuetype [mscorlib]System.Nullable`1<int32>::.ctor(!0)
IL_006c: stelem valuetype [mscorlib]System.Nullable`1<int32>
IL_0071: dup
IL_0072: ldc.i4.2
IL_0073: ldarg.0
IL_0074: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_0079: stloc.0
IL_007a: ldloca.s V_0
IL_007c: dup
IL_007d: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_0082: brtrue.s IL_0090
IL_0084: pop
IL_0085: ldloca.s V_1
IL_0087: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_008d: ldloc.1
IL_008e: br.s IL_00b3
IL_0090: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_0095: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Field
IL_009a: dup
IL_009b: brtrue.s IL_00a9
IL_009d: pop
IL_009e: ldloca.s V_1
IL_00a0: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_00a6: ldloc.1
IL_00a7: br.s IL_00b3
IL_00a9: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass::IntVal
IL_00ae: newobj instance void valuetype [mscorlib]System.Nullable`1<int32>::.ctor(!0)
IL_00b3: stelem valuetype [mscorlib]System.Nullable`1<int32>
IL_00b8: dup
IL_00b9: ldc.i4.3
IL_00ba: ldarg.0
IL_00bb: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_00c0: stloc.0
IL_00c1: ldloca.s V_0
IL_00c3: dup
IL_00c4: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_00c9: brtrue.s IL_00d7
IL_00cb: pop
IL_00cc: ldloca.s V_1
IL_00ce: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_00d4: ldloc.1
IL_00d5: br.s IL_00ee
IL_00d7: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_00dc: stloc.2
IL_00dd: ldloca.s V_2
IL_00df: call instance valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::get_Property2()
IL_00e4: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::IntVal
IL_00e9: newobj instance void valuetype [mscorlib]System.Nullable`1<int32>::.ctor(!0)
IL_00ee: stelem valuetype [mscorlib]System.Nullable`1<int32>
IL_00f3: dup
IL_00f4: ldc.i4.4
IL_00f5: ldarg.0
IL_00f6: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_00fb: stloc.0
IL_00fc: ldloca.s V_0
IL_00fe: dup
IL_00ff: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_0104: brtrue.s IL_0112
IL_0106: pop
IL_0107: ldloca.s V_1
IL_0109: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_010f: ldloc.1
IL_0110: br.s IL_0145
IL_0112: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_0117: stloc.2
IL_0118: ldloca.s V_2
IL_011a: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::get_Property1()
IL_011f: stloc.3
IL_0120: ldloca.s V_3
IL_0122: dup
IL_0123: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_0128: brtrue.s IL_0136
IL_012a: pop
IL_012b: ldloca.s V_1
IL_012d: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_0133: ldloc.1
IL_0134: br.s IL_0145
IL_0136: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_013b: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::IntVal
IL_0140: newobj instance void valuetype [mscorlib]System.Nullable`1<int32>::.ctor(!0)
IL_0145: stelem valuetype [mscorlib]System.Nullable`1<int32>
IL_014a: dup
IL_014b: ldc.i4.5
IL_014c: ldarg.0
IL_014d: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_0152: stloc.0
IL_0153: ldloca.s V_0
IL_0155: dup
IL_0156: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_015b: brtrue.s IL_0169
IL_015d: pop
IL_015e: ldloca.s V_1
IL_0160: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_0166: ldloc.1
IL_0167: br.s IL_0186
IL_0169: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_016e: stloc.2
IL_016f: ldloca.s V_2
IL_0171: ldarg.0
IL_0172: call instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetInt()
IL_0177: call instance valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Method2(int32)
IL_017c: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::IntVal
IL_0181: newobj instance void valuetype [mscorlib]System.Nullable`1<int32>::.ctor(!0)
IL_0186: stelem valuetype [mscorlib]System.Nullable`1<int32>
IL_018b: dup
IL_018c: ldc.i4.6
IL_018d: ldarg.0
IL_018e: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_0193: stloc.0
IL_0194: ldloca.s V_0
IL_0196: dup
IL_0197: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_019c: brtrue.s IL_01aa
IL_019e: pop
IL_019f: ldloca.s V_1
IL_01a1: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_01a7: ldloc.1
IL_01a8: br.s IL_01e3
IL_01aa: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_01af: stloc.2
IL_01b0: ldloca.s V_2
IL_01b2: ldarg.0
IL_01b3: call instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetInt()
IL_01b8: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Method1(int32)
IL_01bd: stloc.3
IL_01be: ldloca.s V_3
IL_01c0: dup
IL_01c1: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_01c6: brtrue.s IL_01d4
IL_01c8: pop
IL_01c9: ldloca.s V_1
IL_01cb: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_01d1: ldloc.1
IL_01d2: br.s IL_01e3
IL_01d4: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_01d9: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::IntVal
IL_01de: newobj instance void valuetype [mscorlib]System.Nullable`1<int32>::.ctor(!0)
IL_01e3: stelem valuetype [mscorlib]System.Nullable`1<int32>
IL_01e8: dup
IL_01e9: ldc.i4.7
IL_01ea: ldarg.0
IL_01eb: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_01f0: stloc.0
IL_01f1: ldloca.s V_0
IL_01f3: dup
IL_01f4: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_01f9: brtrue.s IL_0207
IL_01fb: pop
IL_01fc: ldloca.s V_1
IL_01fe: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_0204: ldloc.1
IL_0205: br.s IL_0240
IL_0207: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_020c: stloc.2
IL_020d: ldloca.s V_2
IL_020f: ldarg.0
IL_0210: call instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetInt()
IL_0215: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::get_Item(int32)
IL_021a: stloc.3
IL_021b: ldloca.s V_3
IL_021d: dup
IL_021e: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_0223: brtrue.s IL_0231
IL_0225: pop
IL_0226: ldloca.s V_1
IL_0228: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_022e: ldloc.1
IL_022f: br.s IL_0240
IL_0231: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_0236: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::IntVal
IL_023b: newobj instance void valuetype [mscorlib]System.Nullable`1<int32>::.ctor(!0)
IL_0240: stelem valuetype [mscorlib]System.Nullable`1<int32>
IL_0245: ret
} // end of method NullPropagation::ChainsStruct
.method public hidebysig instance int32
CoalescingReturn() cil managed
{
@ -1015,7 +1456,7 @@ @@ -1015,7 +1456,7 @@
IL_0005: ldnull
IL_0006: ret
IL_0007: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__1'
IL_0007: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__1'
IL_000c: brtrue.s IL_0048
IL_000e: ldc.i4.0
@ -1045,11 +1486,11 @@ @@ -1045,11 +1486,11 @@
class [mscorlib]System.Type,
class [mscorlib]System.Collections.Generic.IEnumerable`1<class [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo>)
IL_003e: call class [System.Core]System.Runtime.CompilerServices.CallSite`1<!0> class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>>::Create(class [System.Core]System.Runtime.CompilerServices.CallSiteBinder)
IL_0043: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__1'
IL_0048: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__1'
IL_0043: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__1'
IL_0048: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__1'
IL_004d: ldfld !0 class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>>::Target
IL_0052: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__1'
IL_0057: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__0'
IL_0052: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__1'
IL_0057: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__0'
IL_005c: brtrue.s IL_008d
IL_005e: ldc.i4.0
@ -1070,10 +1511,10 @@ @@ -1070,10 +1511,10 @@
class [mscorlib]System.Type,
class [mscorlib]System.Collections.Generic.IEnumerable`1<class [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo>)
IL_0083: call class [System.Core]System.Runtime.CompilerServices.CallSite`1<!0> class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>>::Create(class [System.Core]System.Runtime.CompilerServices.CallSiteBinder)
IL_0088: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__0'
IL_008d: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__0'
IL_0088: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__0'
IL_008d: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__0'
IL_0092: ldfld !0 class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>>::Target
IL_0097: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__0'
IL_0097: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__0'
IL_009c: ldloc.0
IL_009d: callvirt instance !2 class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>::Invoke(!0,
!1)
@ -1088,7 +1529,7 @@ @@ -1088,7 +1529,7 @@
IL_00ac: ldnull
IL_00ad: ret
IL_00ae: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__3'
IL_00ae: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__3'
IL_00b3: brtrue.s IL_00e9
IL_00b5: ldc.i4.0
@ -1114,11 +1555,11 @@ @@ -1114,11 +1555,11 @@
class [mscorlib]System.Type,
class [mscorlib]System.Collections.Generic.IEnumerable`1<class [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo>)
IL_00df: call class [System.Core]System.Runtime.CompilerServices.CallSite`1<!0> class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>>::Create(class [System.Core]System.Runtime.CompilerServices.CallSiteBinder)
IL_00e4: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__3'
IL_00e9: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__3'
IL_00e4: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__3'
IL_00e9: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__3'
IL_00ee: ldfld !0 class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>>::Target
IL_00f3: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__3'
IL_00f8: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__2'
IL_00f3: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__3'
IL_00f8: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__2'
IL_00fd: brtrue.s IL_012f
IL_00ff: ldc.i4.s 64
@ -1139,10 +1580,10 @@ @@ -1139,10 +1580,10 @@
class [mscorlib]System.Type,
class [mscorlib]System.Collections.Generic.IEnumerable`1<class [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo>)
IL_0125: call class [System.Core]System.Runtime.CompilerServices.CallSite`1<!0> class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>>::Create(class [System.Core]System.Runtime.CompilerServices.CallSiteBinder)
IL_012a: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__2'
IL_012f: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__2'
IL_012a: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__2'
IL_012f: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__2'
IL_0134: ldfld !0 class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>>::Target
IL_0139: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__2'
IL_0139: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__2'
IL_013e: ldloc.1
IL_013f: callvirt instance !2 class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>::Invoke(!0,
!1)

503
ICSharpCode.Decompiler.Tests/TestCases/Pretty/NullPropagation.roslyn.il

@ -272,7 +272,7 @@ @@ -272,7 +272,7 @@
} // end of class ITest
.class abstract auto ansi sealed nested private beforefieldinit '<>o__26'
.class abstract auto ansi sealed nested private beforefieldinit '<>o__27'
extends [mscorlib]System.Object
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
@ -280,7 +280,7 @@ @@ -280,7 +280,7 @@
.field public static class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> '<>p__1'
.field public static class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> '<>p__2'
.field public static class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> '<>p__3'
} // end of class '<>o__26'
} // end of class '<>o__27'
.method private hidebysig instance int32
GetInt() cil managed
@ -543,10 +543,11 @@ @@ -543,10 +543,11 @@
.method public hidebysig instance void
CallDoneStruct() cil managed
{
// Code size 36 (0x24)
// Code size 399 (0x18f)
.maxstack 2
.locals init (valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> V_0,
valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct V_1)
valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct V_1,
valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> V_2)
IL_0000: nop
IL_0001: ldarg.0
IL_0002: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
@ -564,14 +565,184 @@ @@ -564,14 +565,184 @@
IL_001b: ldloca.s V_1
IL_001d: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Done()
IL_0022: nop
IL_0023: ret
IL_0023: ldarg.0
IL_0024: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_0029: stloc.0
IL_002a: ldloca.s V_0
IL_002c: dup
IL_002d: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_0032: brtrue.s IL_0037
IL_0034: pop
IL_0035: br.s IL_004d
IL_0037: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_003c: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Field
IL_0041: dup
IL_0042: brtrue.s IL_0047
IL_0044: pop
IL_0045: br.s IL_004d
IL_0047: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass::Done()
IL_004c: nop
IL_004d: ldarg.0
IL_004e: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_0053: stloc.0
IL_0054: ldloca.s V_0
IL_0056: dup
IL_0057: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_005c: brtrue.s IL_0061
IL_005e: pop
IL_005f: br.s IL_0071
IL_0061: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_0066: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Field
IL_006b: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass::Done()
IL_0070: nop
IL_0071: ldarg.0
IL_0072: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_0077: stloc.0
IL_0078: ldloca.s V_0
IL_007a: dup
IL_007b: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_0080: brtrue.s IL_0085
IL_0082: pop
IL_0083: br.s IL_00ae
IL_0085: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_008a: stloc.1
IL_008b: ldloca.s V_1
IL_008d: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::get_Property1()
IL_0092: stloc.2
IL_0093: ldloca.s V_2
IL_0095: dup
IL_0096: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_009b: brtrue.s IL_00a0
IL_009d: pop
IL_009e: br.s IL_00ae
IL_00a0: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_00a5: stloc.1
IL_00a6: ldloca.s V_1
IL_00a8: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Done()
IL_00ad: nop
IL_00ae: ldarg.0
IL_00af: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_00b4: stloc.0
IL_00b5: ldloca.s V_0
IL_00b7: dup
IL_00b8: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_00bd: brtrue.s IL_00c2
IL_00bf: pop
IL_00c0: br.s IL_00d8
IL_00c2: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_00c7: stloc.1
IL_00c8: ldloca.s V_1
IL_00ca: call instance valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::get_Property2()
IL_00cf: stloc.1
IL_00d0: ldloca.s V_1
IL_00d2: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Done()
IL_00d7: nop
IL_00d8: ldarg.0
IL_00d9: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_00de: stloc.0
IL_00df: ldloca.s V_0
IL_00e1: dup
IL_00e2: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_00e7: brtrue.s IL_00ec
IL_00e9: pop
IL_00ea: br.s IL_011b
IL_00ec: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_00f1: stloc.1
IL_00f2: ldloca.s V_1
IL_00f4: ldarg.0
IL_00f5: call instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetInt()
IL_00fa: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Method1(int32)
IL_00ff: stloc.2
IL_0100: ldloca.s V_2
IL_0102: dup
IL_0103: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_0108: brtrue.s IL_010d
IL_010a: pop
IL_010b: br.s IL_011b
IL_010d: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_0112: stloc.1
IL_0113: ldloca.s V_1
IL_0115: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Done()
IL_011a: nop
IL_011b: ldarg.0
IL_011c: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_0121: stloc.0
IL_0122: ldloca.s V_0
IL_0124: dup
IL_0125: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_012a: brtrue.s IL_012f
IL_012c: pop
IL_012d: br.s IL_014b
IL_012f: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_0134: stloc.1
IL_0135: ldloca.s V_1
IL_0137: ldarg.0
IL_0138: call instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetInt()
IL_013d: call instance valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Method2(int32)
IL_0142: stloc.1
IL_0143: ldloca.s V_1
IL_0145: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Done()
IL_014a: nop
IL_014b: ldarg.0
IL_014c: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_0151: stloc.0
IL_0152: ldloca.s V_0
IL_0154: dup
IL_0155: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_015a: brtrue.s IL_015f
IL_015c: pop
IL_015d: br.s IL_018e
IL_015f: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_0164: stloc.1
IL_0165: ldloca.s V_1
IL_0167: ldarg.0
IL_0168: call instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetInt()
IL_016d: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::get_Item(int32)
IL_0172: stloc.2
IL_0173: ldloca.s V_2
IL_0175: dup
IL_0176: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_017b: brtrue.s IL_0180
IL_017d: pop
IL_017e: br.s IL_018e
IL_0180: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_0185: stloc.1
IL_0186: ldloca.s V_1
IL_0188: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Done()
IL_018d: nop
IL_018e: ret
} // end of method NullPropagation::CallDoneStruct
.method public hidebysig instance void
RequiredParentheses() cil managed
{
// Code size 56 (0x38)
.maxstack 8
// Code size 131 (0x83)
.maxstack 2
.locals init (valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> V_0,
valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> V_1,
valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct V_2)
IL_0000: nop
IL_0001: ldarg.0
IL_0002: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyClass()
@ -599,7 +770,40 @@ @@ -599,7 +770,40 @@
IL_002c: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass::Method(int32)
IL_0031: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass::Done()
IL_0036: nop
IL_0037: ret
IL_0037: ldarg.0
IL_0038: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_003d: stloc.0
IL_003e: ldloca.s V_0
IL_0040: dup
IL_0041: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_0046: brtrue.s IL_0054
IL_0048: pop
IL_0049: ldloca.s V_1
IL_004b: initobj valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>
IL_0051: ldloc.1
IL_0052: br.s IL_0066
IL_0054: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_0059: stloc.2
IL_005a: ldloca.s V_2
IL_005c: call instance valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::get_Property2()
IL_0061: newobj instance void valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::.ctor(!0)
IL_0066: stloc.0
IL_0067: ldloca.s V_0
IL_0069: dup
IL_006a: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_006f: brtrue.s IL_0074
IL_0071: pop
IL_0072: br.s IL_0082
IL_0074: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_0079: stloc.2
IL_007a: ldloca.s V_2
IL_007c: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Done()
IL_0081: nop
IL_0082: ret
} // end of method NullPropagation::RequiredParentheses
.method public hidebysig instance valuetype [mscorlib]System.Nullable`1<int32>[]
@ -815,6 +1019,257 @@ @@ -815,6 +1019,257 @@
IL_01de: ret
} // end of method NullPropagation::ChainsOnClass
.method public hidebysig instance valuetype [mscorlib]System.Nullable`1<int32>[]
ChainsStruct() cil managed
{
// Code size 589 (0x24d)
.maxstack 5
.locals init (valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> V_0,
valuetype [mscorlib]System.Nullable`1<int32> V_1,
valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct V_2,
valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> V_3,
valuetype [mscorlib]System.Nullable`1<int32>[] V_4)
IL_0000: nop
IL_0001: ldc.i4.8
IL_0002: newarr valuetype [mscorlib]System.Nullable`1<int32>
IL_0007: dup
IL_0008: ldc.i4.0
IL_0009: ldarg.0
IL_000a: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_000f: stloc.0
IL_0010: ldloca.s V_0
IL_0012: dup
IL_0013: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_0018: brtrue.s IL_0026
IL_001a: pop
IL_001b: ldloca.s V_1
IL_001d: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_0023: ldloc.1
IL_0024: br.s IL_0035
IL_0026: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_002b: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::IntVal
IL_0030: newobj instance void valuetype [mscorlib]System.Nullable`1<int32>::.ctor(!0)
IL_0035: stelem valuetype [mscorlib]System.Nullable`1<int32>
IL_003a: dup
IL_003b: ldc.i4.1
IL_003c: ldarg.0
IL_003d: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_0042: stloc.0
IL_0043: ldloca.s V_0
IL_0045: dup
IL_0046: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_004b: brtrue.s IL_0059
IL_004d: pop
IL_004e: ldloca.s V_1
IL_0050: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_0056: ldloc.1
IL_0057: br.s IL_006d
IL_0059: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_005e: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Field
IL_0063: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass::IntVal
IL_0068: newobj instance void valuetype [mscorlib]System.Nullable`1<int32>::.ctor(!0)
IL_006d: stelem valuetype [mscorlib]System.Nullable`1<int32>
IL_0072: dup
IL_0073: ldc.i4.2
IL_0074: ldarg.0
IL_0075: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_007a: stloc.0
IL_007b: ldloca.s V_0
IL_007d: dup
IL_007e: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_0083: brtrue.s IL_0091
IL_0085: pop
IL_0086: ldloca.s V_1
IL_0088: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_008e: ldloc.1
IL_008f: br.s IL_00b4
IL_0091: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_0096: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Field
IL_009b: dup
IL_009c: brtrue.s IL_00aa
IL_009e: pop
IL_009f: ldloca.s V_1
IL_00a1: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_00a7: ldloc.1
IL_00a8: br.s IL_00b4
IL_00aa: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyClass::IntVal
IL_00af: newobj instance void valuetype [mscorlib]System.Nullable`1<int32>::.ctor(!0)
IL_00b4: stelem valuetype [mscorlib]System.Nullable`1<int32>
IL_00b9: dup
IL_00ba: ldc.i4.3
IL_00bb: ldarg.0
IL_00bc: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_00c1: stloc.0
IL_00c2: ldloca.s V_0
IL_00c4: dup
IL_00c5: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_00ca: brtrue.s IL_00d8
IL_00cc: pop
IL_00cd: ldloca.s V_1
IL_00cf: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_00d5: ldloc.1
IL_00d6: br.s IL_00ef
IL_00d8: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_00dd: stloc.2
IL_00de: ldloca.s V_2
IL_00e0: call instance valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::get_Property2()
IL_00e5: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::IntVal
IL_00ea: newobj instance void valuetype [mscorlib]System.Nullable`1<int32>::.ctor(!0)
IL_00ef: stelem valuetype [mscorlib]System.Nullable`1<int32>
IL_00f4: dup
IL_00f5: ldc.i4.4
IL_00f6: ldarg.0
IL_00f7: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_00fc: stloc.0
IL_00fd: ldloca.s V_0
IL_00ff: dup
IL_0100: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_0105: brtrue.s IL_0113
IL_0107: pop
IL_0108: ldloca.s V_1
IL_010a: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_0110: ldloc.1
IL_0111: br.s IL_0146
IL_0113: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_0118: stloc.2
IL_0119: ldloca.s V_2
IL_011b: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::get_Property1()
IL_0120: stloc.3
IL_0121: ldloca.s V_3
IL_0123: dup
IL_0124: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_0129: brtrue.s IL_0137
IL_012b: pop
IL_012c: ldloca.s V_1
IL_012e: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_0134: ldloc.1
IL_0135: br.s IL_0146
IL_0137: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_013c: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::IntVal
IL_0141: newobj instance void valuetype [mscorlib]System.Nullable`1<int32>::.ctor(!0)
IL_0146: stelem valuetype [mscorlib]System.Nullable`1<int32>
IL_014b: dup
IL_014c: ldc.i4.5
IL_014d: ldarg.0
IL_014e: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_0153: stloc.0
IL_0154: ldloca.s V_0
IL_0156: dup
IL_0157: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_015c: brtrue.s IL_016a
IL_015e: pop
IL_015f: ldloca.s V_1
IL_0161: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_0167: ldloc.1
IL_0168: br.s IL_0187
IL_016a: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_016f: stloc.2
IL_0170: ldloca.s V_2
IL_0172: ldarg.0
IL_0173: call instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetInt()
IL_0178: call instance valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Method2(int32)
IL_017d: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::IntVal
IL_0182: newobj instance void valuetype [mscorlib]System.Nullable`1<int32>::.ctor(!0)
IL_0187: stelem valuetype [mscorlib]System.Nullable`1<int32>
IL_018c: dup
IL_018d: ldc.i4.6
IL_018e: ldarg.0
IL_018f: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_0194: stloc.0
IL_0195: ldloca.s V_0
IL_0197: dup
IL_0198: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_019d: brtrue.s IL_01ab
IL_019f: pop
IL_01a0: ldloca.s V_1
IL_01a2: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_01a8: ldloc.1
IL_01a9: br.s IL_01e4
IL_01ab: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_01b0: stloc.2
IL_01b1: ldloca.s V_2
IL_01b3: ldarg.0
IL_01b4: call instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetInt()
IL_01b9: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::Method1(int32)
IL_01be: stloc.3
IL_01bf: ldloca.s V_3
IL_01c1: dup
IL_01c2: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_01c7: brtrue.s IL_01d5
IL_01c9: pop
IL_01ca: ldloca.s V_1
IL_01cc: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_01d2: ldloc.1
IL_01d3: br.s IL_01e4
IL_01d5: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_01da: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::IntVal
IL_01df: newobj instance void valuetype [mscorlib]System.Nullable`1<int32>::.ctor(!0)
IL_01e4: stelem valuetype [mscorlib]System.Nullable`1<int32>
IL_01e9: dup
IL_01ea: ldc.i4.7
IL_01eb: ldarg.0
IL_01ec: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetMyStruct()
IL_01f1: stloc.0
IL_01f2: ldloca.s V_0
IL_01f4: dup
IL_01f5: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_01fa: brtrue.s IL_0208
IL_01fc: pop
IL_01fd: ldloca.s V_1
IL_01ff: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_0205: ldloc.1
IL_0206: br.s IL_0241
IL_0208: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_020d: stloc.2
IL_020e: ldloca.s V_2
IL_0210: ldarg.0
IL_0211: call instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation::GetInt()
IL_0216: call instance valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::get_Item(int32)
IL_021b: stloc.3
IL_021c: ldloca.s V_3
IL_021e: dup
IL_021f: call instance bool valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::get_HasValue()
IL_0224: brtrue.s IL_0232
IL_0226: pop
IL_0227: ldloca.s V_1
IL_0229: initobj valuetype [mscorlib]System.Nullable`1<int32>
IL_022f: ldloc.1
IL_0230: br.s IL_0241
IL_0232: call instance !0 valuetype [mscorlib]System.Nullable`1<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct>::GetValueOrDefault()
IL_0237: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/MyStruct::IntVal
IL_023c: newobj instance void valuetype [mscorlib]System.Nullable`1<int32>::.ctor(!0)
IL_0241: stelem valuetype [mscorlib]System.Nullable`1<int32>
IL_0246: stloc.s V_4
IL_0248: br.s IL_024a
IL_024a: ldloc.s V_4
IL_024c: ret
} // end of method NullPropagation::ChainsStruct
.method public hidebysig instance int32
CoalescingReturn() cil managed
{
@ -1195,7 +1650,7 @@ @@ -1195,7 +1650,7 @@
IL_0006: ldnull
IL_0007: br IL_015c
IL_000c: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__1'
IL_000c: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__1'
IL_0011: brfalse.s IL_0015
IL_0013: br.s IL_004f
@ -1227,11 +1682,11 @@ @@ -1227,11 +1682,11 @@
class [mscorlib]System.Type,
class [mscorlib]System.Collections.Generic.IEnumerable`1<class [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo>)
IL_0045: call class [System.Core]System.Runtime.CompilerServices.CallSite`1<!0> class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>>::Create(class [System.Core]System.Runtime.CompilerServices.CallSiteBinder)
IL_004a: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__1'
IL_004f: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__1'
IL_004a: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__1'
IL_004f: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__1'
IL_0054: ldfld !0 class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>>::Target
IL_0059: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__1'
IL_005e: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__0'
IL_0059: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__1'
IL_005e: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__0'
IL_0063: brfalse.s IL_0067
IL_0065: br.s IL_0096
@ -1254,10 +1709,10 @@ @@ -1254,10 +1709,10 @@
class [mscorlib]System.Type,
class [mscorlib]System.Collections.Generic.IEnumerable`1<class [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo>)
IL_008c: call class [System.Core]System.Runtime.CompilerServices.CallSite`1<!0> class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>>::Create(class [System.Core]System.Runtime.CompilerServices.CallSiteBinder)
IL_0091: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__0'
IL_0096: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__0'
IL_0091: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__0'
IL_0096: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__0'
IL_009b: ldfld !0 class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>>::Target
IL_00a0: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__0'
IL_00a0: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__0'
IL_00a5: ldloc.0
IL_00a6: callvirt instance !2 class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>::Invoke(!0,
!1)
@ -1272,7 +1727,7 @@ @@ -1272,7 +1727,7 @@
IL_00b5: ldnull
IL_00b6: br IL_015c
IL_00bb: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__3'
IL_00bb: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__3'
IL_00c0: brfalse.s IL_00c4
IL_00c2: br.s IL_00f8
@ -1300,11 +1755,11 @@ @@ -1300,11 +1755,11 @@
class [mscorlib]System.Type,
class [mscorlib]System.Collections.Generic.IEnumerable`1<class [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo>)
IL_00ee: call class [System.Core]System.Runtime.CompilerServices.CallSite`1<!0> class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>>::Create(class [System.Core]System.Runtime.CompilerServices.CallSiteBinder)
IL_00f3: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__3'
IL_00f8: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__3'
IL_00f3: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__3'
IL_00f8: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__3'
IL_00fd: ldfld !0 class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>>::Target
IL_0102: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__3'
IL_0107: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__2'
IL_0102: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`4<class [System.Core]System.Runtime.CompilerServices.CallSite,object,int32,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__3'
IL_0107: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__2'
IL_010c: brfalse.s IL_0110
IL_010e: br.s IL_0140
@ -1327,10 +1782,10 @@ @@ -1327,10 +1782,10 @@
class [mscorlib]System.Type,
class [mscorlib]System.Collections.Generic.IEnumerable`1<class [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo>)
IL_0136: call class [System.Core]System.Runtime.CompilerServices.CallSite`1<!0> class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>>::Create(class [System.Core]System.Runtime.CompilerServices.CallSiteBinder)
IL_013b: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__2'
IL_0140: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__2'
IL_013b: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__2'
IL_0140: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__2'
IL_0145: ldfld !0 class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>>::Target
IL_014a: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__26'::'<>p__2'
IL_014a: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>> ICSharpCode.Decompiler.Tests.TestCases.Pretty.NullPropagation/'<>o__27'::'<>p__2'
IL_014f: ldloc.1
IL_0150: callvirt instance !2 class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite,object,object>::Invoke(!0,
!1)

20
ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs

@ -500,7 +500,17 @@ namespace ICSharpCode.Decompiler.CSharp @@ -500,7 +500,17 @@ namespace ICSharpCode.Decompiler.CSharp
inst.Variable.Type = type;
}
}
return Assignment(ConvertVariable(inst.Variable).WithoutILInstruction(), translatedValue).WithILInstruction(inst);
var lhs = ConvertVariable(inst.Variable).WithoutILInstruction();
if (lhs.Expression is DirectionExpression dirExpr && lhs.ResolveResult is ByReferenceResolveResult lhsRefRR) {
// ref (re-)assignment, emit "ref (a = ref b)".
lhs = lhs.UnwrapChild(dirExpr.Expression);
var assign = new AssignmentExpression(lhs.Expression, translatedValue.Expression)
.WithRR(new OperatorResolveResult(lhs.Type, ExpressionType.Assign, lhsRefRR, translatedValue.ResolveResult));
return new DirectionExpression(FieldDirection.Ref, assign)
.WithoutILInstruction().WithRR(lhsRefRR);
} else {
return Assignment(lhs, translatedValue).WithILInstruction(inst);
}
bool IsOtherValueType(IType type)
{
@ -1111,7 +1121,13 @@ namespace ICSharpCode.Decompiler.CSharp @@ -1111,7 +1121,13 @@ namespace ICSharpCode.Decompiler.CSharp
protected internal override TranslatedExpression VisitUserDefinedCompoundAssign(UserDefinedCompoundAssign inst, TranslationContext context)
{
var target = Translate(inst.Target);
if (inst.Method.Parameters.Count == 2) {
if (UserDefinedCompoundAssign.IsStringConcat(inst.Method)) {
Debug.Assert(inst.Method.Parameters.Count == 2);
var value = Translate(inst.Value).ConvertTo(inst.Method.Parameters[1].Type, this, allowImplicitConversion: true);
return new AssignmentExpression(target, AssignmentOperatorType.Add, value)
.WithILInstruction(inst)
.WithRR(new OperatorResolveResult(inst.Method.ReturnType, ExpressionType.AddAssign, inst.Method, inst.IsLifted, new[] { target.ResolveResult, value.ResolveResult }));
} else if (inst.Method.Parameters.Count == 2) {
var value = Translate(inst.Value).ConvertTo(inst.Method.Parameters[1].Type, this);
AssignmentOperatorType? op = GetAssignmentOperatorTypeFromMetadataName(inst.Method.Name);
Debug.Assert(op != null);

12
ICSharpCode.Decompiler/CSharp/StatementBuilder.cs

@ -65,7 +65,17 @@ namespace ICSharpCode.Decompiler.CSharp @@ -65,7 +65,17 @@ namespace ICSharpCode.Decompiler.CSharp
{
return new ExpressionStatement(exprBuilder.Translate(inst));
}
protected internal override Statement VisitStLoc(StLoc inst)
{
var expr = exprBuilder.Translate(inst);
// strip top-level ref on ref re-assignment
if (expr.Expression is DirectionExpression dirExpr) {
expr = expr.UnwrapChild(dirExpr.Expression);
}
return new ExpressionStatement(expr);
}
protected internal override Statement VisitNop(Nop inst)
{
var stmt = new EmptyStatement();

16
ICSharpCode.Decompiler/CSharp/Transforms/DeclareVariables.cs

@ -386,14 +386,16 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms @@ -386,14 +386,16 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms
bool IsMatchingAssignment(VariableToDeclare v, out AssignmentExpression assignment)
{
assignment = v.InsertionPoint.nextNode as AssignmentExpression ?? (v.InsertionPoint.nextNode as ExpressionStatement)?.Expression as AssignmentExpression;
Expression expectedExpr = new IdentifierExpression(v.Name);
if (v.Type.Kind == TypeKind.ByReference) {
expectedExpr = new DirectionExpression(FieldDirection.Ref, expectedExpr);
assignment = v.InsertionPoint.nextNode as AssignmentExpression;
if (assignment == null) {
assignment = (v.InsertionPoint.nextNode as ExpressionStatement)?.Expression as AssignmentExpression;
if (assignment == null)
return false;
}
if (assignment != null && assignment.Operator == AssignmentOperatorType.Assign && assignment.Left.IsMatch(expectedExpr))
return true;
return false;
return assignment.Operator == AssignmentOperatorType.Assign
&& assignment.Left is IdentifierExpression identExpr
&& identExpr.Identifier == v.Name
&& identExpr.TypeArguments.Count == 0;
}
void InsertVariableDeclarations(TransformContext context)

2
ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj

@ -495,7 +495,7 @@ @@ -495,7 +495,7 @@
<Compile Include="TypeSystem\IMember.cs" />
<Compile Include="TypeSystem\IMethod.cs" />
<Compile Include="TypeSystem\Implementation\AbstractFreezable.cs" />
<Compile Include="TypeSystem\Implementation\AbstractResolvedTypeParameter.cs" />
<Compile Include="TypeSystem\Implementation\AbstractTypeParameter.cs" />
<Compile Include="TypeSystem\Implementation\AbstractType.cs" />
<Compile Include="TypeSystem\Implementation\BaseTypeCollector.cs" />
<Compile Include="TypeSystem\Implementation\DefaultAssemblyReference.cs" />

1
ICSharpCode.Decompiler/IL/ControlFlow/YieldReturnDecompiler.cs

@ -792,6 +792,7 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow @@ -792,6 +792,7 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow
name = fieldDef.Name.Substring(1, pos - 1);
}
v = function.RegisterVariable(VariableKind.Local, ldflda.Field.ReturnType, name);
v.HasInitialValue = true; // the field was default-initialized, so keep those semantics for the variable
v.StateMachineField = ldflda.Field;
fieldToVariableMap.Add(fieldDef, v);
}

12
ICSharpCode.Decompiler/IL/ILVariable.cs

@ -244,7 +244,17 @@ namespace ICSharpCode.Decompiler.IL @@ -244,7 +244,17 @@ namespace ICSharpCode.Decompiler.IL
hasInitialValue = value;
}
}
/// <summary>
/// Gets whether the variable is in SSA form:
/// There is exactly 1 store, and every load sees the value from that store.
/// </summary>
/// <remarks>
/// Note: the single store is not necessary a store instruction, it might also
/// be the use of the implicit initial value.
/// For example: for parameters, IsSingleDefinition will only return true if
/// the parameter is never assigned to within the function.
/// </remarks>
public bool IsSingleDefinition {
get {
return StoreCount == 1 && AddressCount == 0;

9
ICSharpCode.Decompiler/IL/Instructions/CompoundAssignmentInstruction.cs

@ -196,17 +196,22 @@ namespace ICSharpCode.Decompiler.IL @@ -196,17 +196,22 @@ namespace ICSharpCode.Decompiler.IL
public partial class UserDefinedCompoundAssign : CompoundAssignmentInstruction
{
public readonly IMethod Method;
public bool IsLifted => false; // TODO: implement ILi
public bool IsLifted => false; // TODO: implement lifted user-defined compound assignments
public UserDefinedCompoundAssign(IMethod method, CompoundAssignmentType compoundAssignmentType, ILInstruction target, ILInstruction value)
: base(OpCode.UserDefinedCompoundAssign, compoundAssignmentType, target, value)
{
this.Method = method;
Debug.Assert(Method.IsOperator);
Debug.Assert(Method.IsOperator || IsStringConcat(method));
Debug.Assert(compoundAssignmentType == CompoundAssignmentType.EvaluatesToNewValue || (Method.Name == "op_Increment" || Method.Name == "op_Decrement"));
Debug.Assert(IsValidCompoundAssignmentTarget(Target));
}
public static bool IsStringConcat(IMethod method)
{
return method.Name == "Concat" && method.IsStatic && method.DeclaringType.IsKnownType(KnownTypeCode.String);
}
public override StackType ResultType => Method.ReturnType.GetStackType();
public override void WriteTo(ITextOutput output, ILAstWritingOptions options)

117
ICSharpCode.Decompiler/IL/Transforms/SplitVariables.cs

@ -21,6 +21,7 @@ using System.Linq; @@ -21,6 +21,7 @@ using System.Linq;
using ICSharpCode.Decompiler.FlowAnalysis;
using ICSharpCode.Decompiler.Util;
using System.Threading;
using ICSharpCode.Decompiler.TypeSystem;
namespace ICSharpCode.Decompiler.IL.Transforms
{
@ -48,7 +49,9 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -48,7 +49,9 @@ namespace ICSharpCode.Decompiler.IL.Transforms
case VariableKind.Local:
case VariableKind.Exception:
foreach (var ldloca in v.AddressInstructions) {
if (!AddressUsedOnlyForReading(ldloca)) {
if (DetermineAddressUse(ldloca, ldloca.Variable) == AddressUse.Unknown) {
// If we don't understand how the address is being used,
// we can't split the variable.
return false;
}
}
@ -67,32 +70,93 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -67,32 +70,93 @@ namespace ICSharpCode.Decompiler.IL.Transforms
}
}
static bool AddressUsedOnlyForReading(ILInstruction addressLoadingInstruction)
enum AddressUse
{
Unknown,
/// <summary>
/// Address is immediately used for reading and/or writing,
/// without the possibility of the variable being directly stored to (via 'stloc')
/// in between the 'ldloca' and the use of the address.
/// </summary>
Immediate,
/// <summary>
/// We support some limited form of ref locals referring to a target variable,
/// without giving up splitting of the target variable.
/// Requirements:
/// * the ref local is single-assignment
/// * the ref local is initialized directly with 'ldloca target; stloc ref_local',
/// not a derived pointer (e.g. 'ldloca target; ldflda F; stloc ref_local').
/// * all uses of the ref_local are immediate.
/// There may be stores to the target variable in between the 'stloc ref_local' and its uses,
/// but we handle that case by treating each use of the ref_local as an address access
/// of the target variable (as if the ref_local was eliminated via copy propagation).
/// </summary>
WithSupportedRefLocals,
}
static AddressUse DetermineAddressUse(ILInstruction addressLoadingInstruction, ILVariable targetVar)
{
switch (addressLoadingInstruction.Parent) {
case LdObj ldobj:
return true;
return AddressUse.Immediate;
case LdFlda ldflda:
return AddressUsedOnlyForReading(ldflda);
return DetermineAddressUse(ldflda, targetVar);
case Await await:
// Not strictly true as GetAwaiter() could have side-effects,
// but we need to split awaiter variables to make async/await pretty.
return true;
// GetAwaiter() may write to the struct, but shouldn't store the address for later use
return AddressUse.Immediate;
case Call call:
if (call.Method.DeclaringTypeDefinition?.KnownTypeCode == TypeSystem.KnownTypeCode.NullableOfT) {
switch (call.Method.Name) {
case "get_HasValue":
case "get_Value":
case "GetValueOrDefault":
return true;
// Address is passed to method.
// We'll assume the method only uses the address locally,
// unless we can see an address being returned from the method:
if (call.Method.ReturnType.IsByRefLike) {
return AddressUse.Unknown;
}
foreach (var p in call.Method.Parameters) {
// catch "out Span<int>" and similar
if (p.Type.SkipModifiers() is ByReferenceType brt && brt.ElementType.IsByRefLike)
return AddressUse.Unknown;
}
// ensure there's no 'stloc target' in between the ldloca and the call consuming the address
for (int i = addressLoadingInstruction.ChildIndex + 1; i < call.Arguments.Count; i++) {
foreach (var inst in call.Arguments[i].Descendants) {
if (inst is StLoc store && store.Variable == targetVar)
return AddressUse.Unknown;
}
}
return false;
return AddressUse.Immediate;
case StLoc stloc when stloc.Variable.IsSingleDefinition:
// Address stored in local variable: also check all uses of that variable.
if (!(stloc.Variable.Kind == VariableKind.StackSlot || stloc.Variable.Kind == VariableKind.Local))
return AddressUse.Unknown;
if (stloc.Value.OpCode != OpCode.LdLoca) {
// GroupStores.HandleLoad() only detects ref-locals when they are directly initialized with ldloca
return AddressUse.Unknown;
}
foreach (var load in stloc.Variable.LoadInstructions) {
if (DetermineAddressUse(load, targetVar) != AddressUse.Immediate)
return AddressUse.Unknown;
}
return AddressUse.WithSupportedRefLocals;
default:
return false;
return AddressUse.Unknown;
}
}
/// <summary>
/// Given 'ldloc ref_local' and 'ldloca target; stloc ref_local', returns the ldloca.
/// This function must return a non-null LdLoca for every use of a SupportedRefLocal.
/// </summary>
static LdLoca GetAddressLoadForRefLocalUse(LdLoc ldloc)
{
if (!ldloc.Variable.IsSingleDefinition)
return null; // only single-definition variables can be supported ref locals
var store = ldloc.Variable.StoreInstructions.SingleOrDefault();
if (store is StLoc stloc) {
return stloc.Value as LdLoca;
}
return null;
}
/// <summary>
/// Use the union-find structure to merge
/// </summary>
@ -102,7 +166,13 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -102,7 +166,13 @@ namespace ICSharpCode.Decompiler.IL.Transforms
class GroupStores : ReachingDefinitionsVisitor
{
readonly UnionFind<IInstructionWithVariableOperand> unionFind = new UnionFind<IInstructionWithVariableOperand>();
readonly HashSet<IInstructionWithVariableOperand> uninitVariableUsage = new HashSet<IInstructionWithVariableOperand>();
/// <summary>
/// For each uninitialized variable, one representative instruction that
/// potentially observes the unintialized value of the variable.
/// Used to merge together all such loads of the same uninitialized value.
/// </summary>
readonly Dictionary<ILVariable, IInstructionWithVariableOperand> uninitVariableUsage = new Dictionary<ILVariable, IInstructionWithVariableOperand>();
public GroupStores(ILFunction scope, CancellationToken cancellationToken) : base(scope, IsCandidateVariable, cancellationToken)
{
@ -112,6 +182,12 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -112,6 +182,12 @@ namespace ICSharpCode.Decompiler.IL.Transforms
{
base.VisitLdLoc(inst);
HandleLoad(inst);
var refLocalAddressLoad = GetAddressLoadForRefLocalUse(inst);
if (refLocalAddressLoad != null) {
// SupportedRefLocal: act as if we copy-propagated the ldloca
// to the point of use:
HandleLoad(refLocalAddressLoad);
}
}
protected internal override void VisitLdLoca(LdLoca inst)
@ -124,7 +200,12 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -124,7 +200,12 @@ namespace ICSharpCode.Decompiler.IL.Transforms
{
if (IsAnalyzedVariable(inst.Variable)) {
if (IsPotentiallyUninitialized(state, inst.Variable)) {
uninitVariableUsage.Add(inst);
// merge all uninit loads together:
if (uninitVariableUsage.TryGetValue(inst.Variable, out var uninitLoad)) {
unionFind.Merge(inst, uninitLoad);
} else {
uninitVariableUsage.Add(inst.Variable, inst);
}
}
foreach (var store in GetStores(state, inst.Variable)) {
unionFind.Merge(inst, (IInstructionWithVariableOperand)store);
@ -150,7 +231,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -150,7 +231,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
newVariables.Add(representative, v);
inst.Variable.Function.Variables.Add(v);
}
if (uninitVariableUsage.Contains(inst)) {
if (inst.Variable.HasInitialValue && uninitVariableUsage.TryGetValue(inst.Variable, out var uninitLoad) && uninitLoad == inst) {
v.HasInitialValue = true;
}
return v;

20
ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs

@ -298,9 +298,21 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -298,9 +298,21 @@ namespace ICSharpCode.Decompiler.IL.Transforms
return false;
context.Step($"Compound assignment (dynamic binary)", compoundStore);
newInst = new DynamicCompoundAssign(dynamicBinaryOp.Operation, dynamicBinaryOp.BinderFlags, dynamicBinaryOp.Left, dynamicBinaryOp.LeftArgumentInfo, dynamicBinaryOp.Right, dynamicBinaryOp.RightArgumentInfo);
} else if (setterValue is Call concatCall && UserDefinedCompoundAssign.IsStringConcat(concatCall.Method)) {
// setterValue is a string.Concat() invocation
if (concatCall.Arguments.Count != 2)
return false; // for now we only support binary compound assignments
if (!targetType.IsKnownType(KnownTypeCode.String))
return false;
if (!IsMatchingCompoundLoad(concatCall.Arguments[0], compoundStore, forbiddenVariable: storeInSetter?.Variable))
return false;
context.Step($"Compound assignment (string concatenation)", compoundStore);
newInst = new UserDefinedCompoundAssign(concatCall.Method, CompoundAssignmentType.EvaluatesToNewValue,
concatCall.Arguments[0], concatCall.Arguments[1]);
} else {
return false;
}
newInst.AddILRange(setterValue.ILRange);
if (storeInSetter != null) {
storeInSetter.Value = newInst;
newInst = storeInSetter;
@ -338,6 +350,14 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -338,6 +350,14 @@ namespace ICSharpCode.Decompiler.IL.Transforms
// 'stloc l' is implicitly truncating the stack value
return false;
}
if (nextInst.Variable.StackType == StackType.Ref) {
// ref locals need to be initialized when they are declared, so
// we can only use inline assignments when we know that the
// ref local is definitely assigned.
// We don't have an easy way to check for that in this transform,
// so avoid inline assignments to ref locals for now.
return false;
}
context.Step("Inline assignment to local variable", inst);
var value = inst.Value;
var var = nextInst.Variable;

4
ICSharpCode.Decompiler/TypeSystem/ByReferenceType.cs

@ -40,7 +40,9 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -40,7 +40,9 @@ namespace ICSharpCode.Decompiler.TypeSystem
public override bool? IsReferenceType {
get { return null; }
}
public override bool IsByRefLike => true;
public override int GetHashCode()
{
return elementType.GetHashCode() ^ 91725813;

5
ICSharpCode.Decompiler/TypeSystem/IType.cs

@ -64,6 +64,11 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -64,6 +64,11 @@ namespace ICSharpCode.Decompiler.TypeSystem
/// </returns>
bool? IsReferenceType { get; }
/// <summary>
/// Gets whether this type is "ref-like": a ByReferenceType or "ref struct".
/// </summary>
bool IsByRefLike { get; }
/// <summary>
/// Gets the underlying type definition.
/// Can return null for types which do not have a type definition (for example arrays, pointers, type parameters).

4
ICSharpCode.Decompiler/TypeSystem/Implementation/AbstractType.cs

@ -52,7 +52,9 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -52,7 +52,9 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
}
public abstract bool? IsReferenceType { get; }
public virtual bool IsByRefLike => false;
public abstract TypeKind Kind { get; }
public virtual int TypeParameterCount {

2
ICSharpCode.Decompiler/TypeSystem/Implementation/AbstractResolvedTypeParameter.cs → ICSharpCode.Decompiler/TypeSystem/Implementation/AbstractTypeParameter.cs

@ -190,6 +190,8 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -190,6 +190,8 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
return null;
}
}
bool IType.IsByRefLike => false;
IType IType.DeclaringType {
get { return null; }

2
ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataTypeDefinition.cs

@ -44,6 +44,7 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -44,6 +44,7 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
readonly FullTypeName fullTypeName;
readonly TypeAttributes attributes;
public TypeKind Kind { get; }
public bool IsByRefLike { get; }
public ITypeDefinition DeclaringTypeDefinition { get; }
public IReadOnlyList<ITypeParameter> TypeParameters { get; }
public KnownTypeCode KnownTypeCode { get; }
@ -99,6 +100,7 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -99,6 +100,7 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
this.Kind = TypeKind.Void;
} else {
this.Kind = TypeKind.Struct;
this.IsByRefLike = td.GetCustomAttributes().HasKnownAttribute(metadata, KnownAttribute.IsByRefLike);
}
} else if (td.IsDelegate(metadata)) {
this.Kind = TypeKind.Delegate;

2
ICSharpCode.Decompiler/TypeSystem/Implementation/MinimalCorlib.cs

@ -172,6 +172,8 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -172,6 +172,8 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
}
}
bool IType.IsByRefLike => false;
int IType.TypeParameterCount => KnownTypeReference.Get(typeCode).TypeParameterCount;
IReadOnlyList<ITypeParameter> IType.TypeParameters => DummyTypeParameter.GetClassTypeParameterList(KnownTypeReference.Get(typeCode).TypeParameterCount);

1
ICSharpCode.Decompiler/TypeSystem/Implementation/PinnedType.cs

@ -37,6 +37,7 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -37,6 +37,7 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
public override string NameSuffix => " pinned";
public override bool? IsReferenceType => elementType.IsReferenceType;
public override bool IsByRefLike => elementType.IsByRefLike;
public override TypeKind Kind => TypeKind.Other;

1
ICSharpCode.Decompiler/TypeSystem/ModifiedType.cs

@ -41,6 +41,7 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -41,6 +41,7 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
public override string NameSuffix => (kind == TypeKind.ModReq ? "modreq" : "modopt") + $"({modifier.FullName})";
public override bool? IsReferenceType => elementType.IsReferenceType;
public override bool IsByRefLike => elementType.IsByRefLike;
public override ITypeDefinition GetDefinition()
{

5
ICSharpCode.Decompiler/TypeSystem/ParameterizedType.cs

@ -82,9 +82,8 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -82,9 +82,8 @@ namespace ICSharpCode.Decompiler.TypeSystem
get { return genericType; }
}
public bool? IsReferenceType {
get { return genericType.IsReferenceType; }
}
public bool? IsReferenceType => genericType.IsReferenceType;
public bool IsByRefLike => genericType.IsByRefLike;
public IType DeclaringType {
get {

8
ICSharpCode.Decompiler/TypeSystem/TypeSystemExtensions.cs

@ -255,6 +255,14 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -255,6 +255,14 @@ namespace ICSharpCode.Decompiler.TypeSystem
}
#endregion
public static IType SkipModifiers(this IType ty)
{
while (ty is ModifiedType mt) {
ty = mt.ElementType;
}
return ty;
}
#region GetType/Member
/// <summary>
/// Gets all type definitions in the compilation.

Loading…
Cancel
Save