/// <summary> /// Constructor /// </summary> /// <param name="method">Method</param> /// <param name="statement">Statement</param> public MethodSourceStatement(MethodDef method, SourceStatement statement) { if (method == null) { throw new ArgumentNullException(nameof(method)); } Method = method; Statement = statement; }
/// <summary> /// Gets step ranges /// </summary> /// <param name="sourceStatement">Source statement</param> /// <returns></returns> public uint[] GetRanges(SourceStatement sourceStatement) { var list = new List <BinSpan>(GetUnusedBinSpans().Length + 1); list.Add(sourceStatement.BinSpan); list.AddRange(GetUnusedBinSpans()); var orderedList = BinSpan.OrderAndCompactList(list); if (orderedList.Count == 0) { return(Array.Empty <uint>()); } var binSpanArray = new uint[orderedList.Count * 2]; for (int i = 0; i < orderedList.Count; i++) { binSpanArray[i * 2 + 0] = orderedList[i].Start; binSpanArray[i * 2 + 1] = orderedList[i].End; } return(binSpanArray); }
/// <summary> /// Adds a <see cref="SourceStatement"/> /// </summary> /// <param name="statement">Statement</param> public void Add(SourceStatement statement) => statements.Add(statement);
/// <summary> /// Constructor /// </summary> /// <param name="method">Method</param> /// <param name="statement">Statement</param> public MethodSourceStatement(MethodDef method, SourceStatement statement) { Method = method ?? throw new ArgumentNullException(nameof(method)); Statement = statement; }