[PATCH] D59725: Additions to creduce script

Amy Huang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 27 12:53:55 PDT 2019


akhuang added inline comments.


================
Comment at: clang/utils/creduce-clang-crash.py:198
+    # Instead of modifying the filename in the test file, just run the command
+    fd, empty_file = tempfile.mkstemp()
+    if self.check_expected_output(filename=empty_file):
----------------
george.burgess.iv wrote:
> Did we want to use `NamedTemporaryFile` here as rnk suggested?
> 
> (If not, you can lift the `os.close`s to immediately after this line.)
switched to using `NamedTemporaryFile` here - 


================
Comment at: clang/utils/creduce-clang-crash.py:206
+    print("\nTrying to preprocess the source file...")
+    fd, tmpfile = tempfile.mkstemp()
+
----------------
george.burgess.iv wrote:
> Similar question about `NamedTemporaryFile`.
> 
> Please note that you'll probably have to pass `delete=False`, since apparently `delete=True` sets O_TEMPORARY on Windows, which... might follow the file across renames? I'm unsure.
moved to `NamedTemporaryFile` with comment about `delete=False`


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

https://reviews.llvm.org/D59725





More information about the cfe-commits mailing list