[PATCH] D137322: [clang][pdb] Don't include -fmessage-length in PDB buildinfo

Tobias Hieta via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 8 01:05:16 PST 2022


thieta updated this revision to Diff 473912.
thieta added a comment.

Updated from feedback


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137322

Files:
  clang/test/CodeGen/debug-info-codeview-buildinfo.c
  llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp


Index: llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -908,6 +908,9 @@
     }
     if (Arg.startswith("-object-file-name") || Arg == MainFilename)
       continue;
+    // Skip fmessage-length for reproduciability.
+    if (Arg.startswith("-fmessage-length"))
+      continue;
     if (PrintedOneArg)
       OS << " ";
     llvm::sys::printArg(OS, Arg, /*Quote=*/true);
Index: clang/test/CodeGen/debug-info-codeview-buildinfo.c
===================================================================
--- clang/test/CodeGen/debug-info-codeview-buildinfo.c
+++ clang/test/CodeGen/debug-info-codeview-buildinfo.c
@@ -8,6 +8,10 @@
 // RUN: %clang_cl -gno-codeview-command-line --target=i686-windows-msvc /c /Z7 /Fo%t.obj -- %s
 // RUN: llvm-pdbutil dump --types %t.obj | FileCheck %s --check-prefix DISABLE
 
+// -fmessage-length shouldn't be included in the command line since it breaks reproducibility
+// RUN: %clang_cl -gcodeview-command-line --target=i686-windows-msvc -Xclang -fmessage-length=100 /c /Z7 /Fo%t.obj -- %s
+// RUN: llvm-pdbutil dump --types %t.obj | FileCheck %s --check-prefix MESSAGELEN
+
 int main(void) { return 42; }
 
 // CHECK:                       Types (.debug$T)
@@ -36,3 +40,8 @@
 // DISABLE-NEXT:          0x{{.+}}: `{{.*}}`
 // DISABLE-NEXT:          0x{{.+}}: ``
 // DISABLE-NEXT:          <no type>: ``
+
+// MESSAGELEN:                       Types (.debug$T)
+// MESSAGELEN: ============================================================
+// MESSAGELEN: 0x{{.+}} | LF_BUILDINFO [size = {{.+}}]
+// MESSAGELEN-NOT: -fmessage-length


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137322.473912.patch
Type: text/x-patch
Size: 1728 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221108/94d07536/attachment-0001.bin>


More information about the cfe-commits mailing list