@@ -618,7 +618,7 @@ inline void Compiler::impAppendStmt(Statement* stmt, unsigned chkLevel)
618
618
// Once we set the current offset as debug info in an appended tree, we are
619
619
// ready to report the following offsets. Note that we need to compare
620
620
// offsets here instead of debug info, since we do not set the "is call"
621
- // debug in impCurStmtDI.
621
+ // bit in impCurStmtDI.
622
622
623
623
if (impLastStmt->GetDebugInfo().GetLocation().GetOffset() == impCurStmtDI.GetLocation().GetOffset())
624
624
{
@@ -3021,11 +3021,6 @@ unsigned Compiler::impInitBlockLineInfo()
3021
3021
impCurStmtOffsSet(blockOffs);
3022
3022
}
3023
3023
3024
- if (false && (info.compStmtOffsetsImplicit & ICorDebugInfo::CALL_SITE_BOUNDARIES))
3025
- {
3026
- impCurStmtOffsSet(blockOffs);
3027
- }
3028
-
3029
3024
/* Always report IL offset 0 or some tests get confused.
3030
3025
Probably a good idea anyways */
3031
3026
@@ -11721,111 +11716,108 @@ void Compiler::impImportBlockCode(BasicBlock* block)
11721
11716
if (opts.compDbgInfo)
11722
11717
#endif
11723
11718
{
11724
- if (!compIsForInlining())
11725
- {
11726
- nxtStmtOffs =
11727
- (nxtStmtIndex < info.compStmtOffsetsCount) ? info.compStmtOffsets[nxtStmtIndex] : BAD_IL_OFFSET;
11719
+ nxtStmtOffs =
11720
+ (nxtStmtIndex < info.compStmtOffsetsCount) ? info.compStmtOffsets[nxtStmtIndex] : BAD_IL_OFFSET;
11721
+
11722
+ /* Have we reached the next stmt boundary ? */
11728
11723
11729
- /* Have we reached the next stmt boundary ? */
11724
+ if (nxtStmtOffs != BAD_IL_OFFSET && opcodeOffs >= nxtStmtOffs)
11725
+ {
11726
+ assert(nxtStmtOffs == info.compStmtOffsets[nxtStmtIndex]);
11730
11727
11731
- if (nxtStmtOffs != BAD_IL_OFFSET && opcodeOffs >= nxtStmtOffs )
11728
+ if (verCurrentState.esStackDepth != 0 && opts.compDbgCode )
11732
11729
{
11733
- assert(nxtStmtOffs == info.compStmtOffsets[nxtStmtIndex]);
11730
+ /* We need to provide accurate IP-mapping at this point.
11731
+ So spill anything on the stack so that it will form
11732
+ gtStmts with the correct stmt offset noted */
11734
11733
11735
- if (verCurrentState.esStackDepth != 0 && opts.compDbgCode)
11736
- {
11737
- /* We need to provide accurate IP-mapping at this point.
11738
- So spill anything on the stack so that it will form
11739
- gtStmts with the correct stmt offset noted */
11734
+ impSpillStackEnsure(true);
11735
+ }
11740
11736
11741
- impSpillStackEnsure(true);
11742
- }
11737
+ // Have we reported debug info for any tree?
11743
11738
11744
- // Have we reported debug info for any tree?
11739
+ if (impCurStmtDI.IsValid() && opts.compDbgCode)
11740
+ {
11741
+ GenTree* placeHolder = new (this, GT_NO_OP) GenTree(GT_NO_OP, TYP_VOID);
11742
+ impAppendTree(placeHolder, (unsigned)CHECK_SPILL_NONE, impCurStmtDI);
11745
11743
11746
- if (impCurStmtDI.IsValid() && opts.compDbgCode)
11747
- {
11748
- GenTree* placeHolder = new (this, GT_NO_OP) GenTree(GT_NO_OP, TYP_VOID);
11749
- impAppendTree(placeHolder, (unsigned)CHECK_SPILL_NONE, impCurStmtDI);
11744
+ assert(!impCurStmtDI.IsValid());
11745
+ }
11750
11746
11751
- assert(!impCurStmtDI.IsValid());
11752
- }
11747
+ if (!impCurStmtDI.IsValid())
11748
+ {
11749
+ /* Make sure that nxtStmtIndex is in sync with opcodeOffs.
11750
+ If opcodeOffs has gone past nxtStmtIndex, catch up */
11753
11751
11754
- if (!impCurStmtDI.IsValid())
11752
+ while ((nxtStmtIndex + 1) < info.compStmtOffsetsCount &&
11753
+ info.compStmtOffsets[nxtStmtIndex + 1] <= opcodeOffs)
11755
11754
{
11756
- /* Make sure that nxtStmtIndex is in sync with opcodeOffs.
11757
- If opcodeOffs has gone past nxtStmtIndex, catch up */
11758
-
11759
- while ((nxtStmtIndex + 1) < info.compStmtOffsetsCount &&
11760
- info.compStmtOffsets[nxtStmtIndex + 1] <= opcodeOffs)
11761
- {
11762
- nxtStmtIndex++;
11763
- }
11755
+ nxtStmtIndex++;
11756
+ }
11764
11757
11765
- /* Go to the new stmt */
11758
+ /* Go to the new stmt */
11766
11759
11767
- impCurStmtOffsSet(info.compStmtOffsets[nxtStmtIndex]);
11760
+ impCurStmtOffsSet(info.compStmtOffsets[nxtStmtIndex]);
11768
11761
11769
- /* Update the stmt boundary index */
11762
+ /* Update the stmt boundary index */
11770
11763
11771
- nxtStmtIndex++;
11772
- assert(nxtStmtIndex <= info.compStmtOffsetsCount);
11764
+ nxtStmtIndex++;
11765
+ assert(nxtStmtIndex <= info.compStmtOffsetsCount);
11773
11766
11774
- /* Are there any more line# entries after this one? */
11767
+ /* Are there any more line# entries after this one? */
11775
11768
11776
- if (nxtStmtIndex < info.compStmtOffsetsCount)
11777
- {
11778
- /* Remember where the next line# starts */
11769
+ if (nxtStmtIndex < info.compStmtOffsetsCount)
11770
+ {
11771
+ /* Remember where the next line# starts */
11779
11772
11780
- nxtStmtOffs = info.compStmtOffsets[nxtStmtIndex];
11781
- }
11782
- else
11783
- {
11784
- /* No more line# entries */
11773
+ nxtStmtOffs = info.compStmtOffsets[nxtStmtIndex];
11774
+ }
11775
+ else
11776
+ {
11777
+ /* No more line# entries */
11785
11778
11786
- nxtStmtOffs = BAD_IL_OFFSET;
11787
- }
11779
+ nxtStmtOffs = BAD_IL_OFFSET;
11788
11780
}
11789
11781
}
11790
- else if ((info.compStmtOffsetsImplicit & ICorDebugInfo::STACK_EMPTY_BOUNDARIES) &&
11791
- (verCurrentState.esStackDepth == 0))
11792
- {
11793
- /* At stack-empty locations, we have already added the tree to
11794
- the stmt list with the last offset. We just need to update
11795
- impCurStmtDI
11796
- */
11782
+ }
11783
+ else if ((info.compStmtOffsetsImplicit & ICorDebugInfo::STACK_EMPTY_BOUNDARIES) &&
11784
+ (verCurrentState.esStackDepth == 0))
11785
+ {
11786
+ /* At stack-empty locations, we have already added the tree to
11787
+ the stmt list with the last offset. We just need to update
11788
+ impCurStmtDI
11789
+ */
11797
11790
11791
+ impCurStmtOffsSet(opcodeOffs);
11792
+ }
11793
+ else if ((info.compStmtOffsetsImplicit & ICorDebugInfo::CALL_SITE_BOUNDARIES) &&
11794
+ impOpcodeIsCallSiteBoundary(prevOpcode))
11795
+ {
11796
+ /* Make sure we have a type cached */
11797
+ assert(callTyp != TYP_COUNT);
11798
+
11799
+ if (callTyp == TYP_VOID)
11800
+ {
11798
11801
impCurStmtOffsSet(opcodeOffs);
11799
11802
}
11800
- else if ((info.compStmtOffsetsImplicit & ICorDebugInfo::CALL_SITE_BOUNDARIES) &&
11801
- impOpcodeIsCallSiteBoundary(prevOpcode))
11803
+ else if (opts.compDbgCode)
11802
11804
{
11803
- /* Make sure we have a type cached */
11804
- assert(callTyp != TYP_COUNT);
11805
-
11806
- if (callTyp == TYP_VOID)
11807
- {
11808
- impCurStmtOffsSet(opcodeOffs);
11809
- }
11810
- else if (opts.compDbgCode)
11811
- {
11812
- impSpillStackEnsure(true);
11813
- impCurStmtOffsSet(opcodeOffs);
11814
- }
11805
+ impSpillStackEnsure(true);
11806
+ impCurStmtOffsSet(opcodeOffs);
11815
11807
}
11816
- else if ((info.compStmtOffsetsImplicit & ICorDebugInfo::NOP_BOUNDARIES) && (prevOpcode == CEE_NOP))
11808
+ }
11809
+ else if ((info.compStmtOffsetsImplicit & ICorDebugInfo::NOP_BOUNDARIES) && (prevOpcode == CEE_NOP))
11810
+ {
11811
+ if (opts.compDbgCode)
11817
11812
{
11818
- if (opts.compDbgCode)
11819
- {
11820
- impSpillStackEnsure(true);
11821
- }
11822
-
11823
- impCurStmtOffsSet(opcodeOffs);
11813
+ impSpillStackEnsure(true);
11824
11814
}
11825
11815
11826
- assert(!impCurStmtDI.IsValid() || (nxtStmtOffs == BAD_IL_OFFSET) ||
11827
- (impCurStmtDI.GetLocation().GetOffset() <= nxtStmtOffs));
11816
+ impCurStmtOffsSet(opcodeOffs);
11828
11817
}
11818
+
11819
+ assert(!impCurStmtDI.IsValid() || (nxtStmtOffs == BAD_IL_OFFSET) ||
11820
+ (impCurStmtDI.GetLocation().GetOffset() <= nxtStmtOffs));
11829
11821
}
11830
11822
11831
11823
CORINFO_CLASS_HANDLE clsHnd = DUMMY_INIT(NULL);
0 commit comments