示例#1
0
 // note. this ctor is only necessary for the decompiler pipeline
 // so it's only internal but not public
 // ahhh... why don't we have friend classes/methods?!
 internal Lambda(MethodBase method, Sig decompiledSig, Block decompiledBody)
     : base(NodeType.Lambda)
 {
     Method = method;
     Sig    = decompiledSig;
     _body  = decompiledBody;
 }
示例#2
0
 public Lambda(MethodBase method, InvocationStyle invocationStyle)
     : base(NodeType.Lambda)
 {
     Method          = method.AssertNotNull();
     InvocationStyle = invocationStyle;
     Sig             = new Sig(this);
 }
示例#3
0
 // note. we need this constructor to provide information
 // about method's parameters without having to decompile it
 //
 // the point is that to get sig's symbols we've got to know their ids
 // but the ids need to be synchronized with Refs in decompiled body
 // that's why a simple call to Sig::Syms need to decompile the entire body
 public ParamInfo(Sig sig, int index, String name, Type type)
 {
     Sig   = sig;
     Index = index;
     Name  = name.IsNullOrEmpty() ? "$p" + index : name;
     Type  = type;
 }
示例#4
0
 public ParamInfo(Sig sig, int index)
 {
     Sig   = sig;
     Index = index;
     Name  = Sym.Name;
     Type  = Sym.Type;
 }
示例#5
0
 protected override int EigenHashCode()
 {
     return(base.EigenHashCode() ^ InvocationStyle.SafeHashCode() ^
            Sig.SafeHashCode() ^ Method.SafeHashCode());
 }
示例#6
0
 public Lambda(Sig sig)
     : base(NodeType.Lambda)
 {
     Sig = sig;
 }
示例#7
0
 // note. this one is necessary to preserve all metadata that we might need later on
 // e.g. for the purpose of determining whether this particular argument is an "out" one
 public ParamInfo(Sig sig, int index, ParameterInfo metadata)
     : this(sig, index, metadata.AssertNotNull().Name, metadata.AssertNotNull().ParameterType)
 {
     Metadata = metadata;
 }