[PATCH] D60283: [clang-cl] Don't emit checksums when compiling a preprocessed CPP

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 4 13:32:41 PDT 2019


rnk added inline comments.


================
Comment at: lib/CodeGen/CGDebugInfo.cpp:429-430
+  const FileEntry *fileEntry = SM.getFileEntryForID(foundIdFromLoc);
+  if (!fileEntry || fileEntry->getName().empty() ||
+      fileEntry->getName().equals(FileName)) {
+    CSKind = computeChecksum(foundIdFromLoc, Checksum);
----------------
I was unhappy with this check. It seems a bit ridiculous to compare the filenames by string when we surely have ids we could look at, but I wasn't able to figure out how.


================
Comment at: test/Driver/cl-preprocess-md5.cpp:1
+// RUN: %clang_cl /c %s /Z7 /Fo%t.obj
+// RUN: llvm-pdbutil dump -l %t.obj | grep -E " \(MD5: ([0-9A-F]+)\)" | sed -n -e 's/^.*MD5: //p' | sort | uniq | wc -l | FileCheck %s --check-prefix=GOOD-SIZE
----------------
This should be a much smaller test in test/CodeGen. You can check in an already pre-processed file with line markers in it, run clang -cc1 -emit-llvm, and check that the DIFile has no checksum. Clang's test suite can't depend on lld, and I'm not sure if it has deps on llvm-pdbutil either.


Repository:
  rC Clang

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

https://reviews.llvm.org/D60283





More information about the cfe-commits mailing list