[PATCH] D59440: add steps to preprocess file and reduce command line args

Amy Huang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 18 17:40:05 PDT 2019


akhuang marked an inline comment as done.
akhuang added inline comments.


================
Comment at: clang/utils/creduce-clang-crash.py:106-117
+  # Check that an empty file is not interesting
+  # file_to_reduce is hardcoded into the test, so this is a roundabout
+  # way to run it on an empty file
+  _, tmpfile = tempfile.mkstemp()
+  _, empty_file = tempfile.mkstemp()
+  shutil.copy(file_to_reduce, tmpfile)
+  shutil.copy(empty_file, file_to_reduce)
----------------
rnk wrote:
> Another way to do this without the complexity of swapping the files around is to construct the interestingness test to take the path to the file as a parameter (`$1`). CReduce always passes the path to the file being reduced as the first argument.
It seems like creduce isn't actually passing the filename as an argument  (creduce had problems when I accidentally used the absolute path of the file as the default value when no arguments are found)


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

https://reviews.llvm.org/D59440





More information about the cfe-commits mailing list