[PATCH] D110612: [Utils] Use common substs in update_cc_test_checks

Alexander Richardson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 28 02:24:23 PDT 2021


arichardson added reviewers: jdoerfert, ggeorgakoudis.
arichardson added inline comments.


================
Comment at: llvm/utils/update_cc_test_checks.py:223
 def exec_run_line(exe):
   popen = subprocess.Popen(exe, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
   stdout, stderr = popen.communicate()
----------------
I think `common.applySubstitutions` should be called here and not below.


================
Comment at: llvm/utils/update_cc_test_checks.py:242
+    subs = common.getSubstitutions(ti.path)
+    subs.append(('%t', tempfile.NamedTemporaryFile().name))
 
----------------
Shouldn't %t be supported in all tools? We could move this common.py. However, before doing that we should also fix temporary files to be cleaned up on exit. Looks like that bug was introduced in D98712.

I think the easiest solution would be to use a filename inside a TemporaryDirectory() that is cleaned up on exit.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110612



More information about the cfe-commits mailing list