[PATCH] D92590: [CodeView] Fix inline sites that are missing code offsets.

Amy Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 4 10:53:32 PST 2020


akhuang updated this revision to Diff 309581.
akhuang added a comment.

Update failing tests


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92590/new/

https://reviews.llvm.org/D92590

Files:
  llvm/lib/MC/MCCodeView.cpp
  llvm/test/MC/COFF/cv-inline-linetable-infloop.s
  llvm/test/MC/COFF/cv-loc-unreachable-2.s
  llvm/test/MC/COFF/cv-loc-unreachable.s


Index: llvm/test/MC/COFF/cv-loc-unreachable.s
===================================================================
--- llvm/test/MC/COFF/cv-loc-unreachable.s
+++ llvm/test/MC/COFF/cv-loc-unreachable.s
@@ -34,7 +34,7 @@
 
 # CODEVIEW:      S_INLINESITE [size = 26]
 # CODEVIEW-NEXT: inlinee = 0x1002 (do_exit), parent = 0, end = 0
-# CODEVIEW-NEXT:   0602      line 1 (+1)
+# CODEVIEW-NEXT:   0B20      code 0x0 (+0x0) line 1 (+1)
 # CODEVIEW-NEXT:   0409      code end 0x9 (+0x9)
 # CODEVIEW-NEXT:   0B21      code 0xA (+0x1) line 2 (+1)
 # CODEVIEW-NEXT:   0B28      code 0x12 (+0x8) line 3 (+1)
Index: llvm/test/MC/COFF/cv-loc-unreachable-2.s
===================================================================
--- llvm/test/MC/COFF/cv-loc-unreachable-2.s
+++ llvm/test/MC/COFF/cv-loc-unreachable-2.s
@@ -23,7 +23,7 @@
 
 # CODEVIEW:      S_INLINESITE [size = 26]
 # CODEVIEW-NEXT: inlinee = 0x1002 (do_exit), parent = 0, end = 0
-# CODEVIEW-NEXT:   0602      line 1 (+1)
+# CODEVIEW-NEXT:   0B20      code 0x0 (+0x0) line 1 (+1)
 # CODEVIEW-NEXT:   0409      code end 0x9 (+0x9)
 # CODEVIEW-NEXT:   0B21      code 0xA (+0x1) line 2 (+1)
 # CODEVIEW-NEXT:   0B28      code 0x12 (+0x8) line 3 (+1)
Index: llvm/test/MC/COFF/cv-inline-linetable-infloop.s
===================================================================
--- llvm/test/MC/COFF/cv-inline-linetable-infloop.s
+++ llvm/test/MC/COFF/cv-inline-linetable-infloop.s
@@ -2,7 +2,7 @@
 
 # CHECK:    InlineSiteSym {
 # CHECK:      BinaryAnnotations [
-# CHECK:        ChangeLineOffset: 1
+# CHECK:        ChangeCodeOffsetAndLineOffset: {CodeOffset: 0x0, LineOffset: 1}
 # CHECK:        ChangeCodeLength: 0x2
 # CHECK:      ]
 # CHECK:    }
Index: llvm/lib/MC/MCCodeView.cpp
===================================================================
--- llvm/lib/MC/MCCodeView.cpp
+++ llvm/lib/MC/MCCodeView.cpp
@@ -563,10 +563,7 @@
     int LineDelta = CurSourceLoc.Line - LastSourceLoc.Line;
     unsigned EncodedLineDelta = encodeSignedNumber(LineDelta);
     unsigned CodeDelta = computeLabelDiff(Layout, LastLabel, Loc.getLabel());
-    if (CodeDelta == 0 && LineDelta != 0) {
-      compressAnnotation(BinaryAnnotationsOpCode::ChangeLineOffset, Buffer);
-      compressAnnotation(EncodedLineDelta, Buffer);
-    } else if (EncodedLineDelta < 0x8 && CodeDelta <= 0xf) {
+    if (EncodedLineDelta < 0x8 && CodeDelta <= 0xf) {
       // The ChangeCodeOffsetAndLineOffset combination opcode is used when the
       // encoded line delta uses 3 or fewer set bits and the code offset fits
       // in one nibble.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92590.309581.patch
Type: text/x-patch
Size: 2562 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201204/f160c3cc/attachment-0001.bin>


More information about the llvm-commits mailing list