private void RealizeSequencePoints() { if (this.SeqPointsOpt != null) { // we keep track of the latest sequence point location to make sure // we don't emit multiple sequence points for the same location int lastOffset = -1; ArrayBuilder <RawSequencePoint> seqPoints = ArrayBuilder <RawSequencePoint> .GetInstance(); foreach (var seqPoint in this.SeqPointsOpt) { int offset = this.GetILOffsetFromMarker(seqPoint.ILMarker); if (offset >= 0) { // valid IL offset if (lastOffset != offset) { Debug.Assert(lastOffset < offset); // if there are any sequence points, there must // be a sequence point at offset 0. #if !XSHARP Debug.Assert((lastOffset >= 0) || (offset == 0)); #endif // the first sequence point on tree/offset location lastOffset = offset; seqPoints.Add(seqPoint); } else { // override previous sequence point at the same location seqPoints[seqPoints.Count - 1] = seqPoint; } } } if (seqPoints.Count > 0) { this.RealizedSequencePoints = SequencePointList.Create(seqPoints, this); } seqPoints.Free(); } }