[PATCH] D30380: Teach lit to expand glob expressions

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 25 13:51:52 PST 2017


mehdi_amini added inline comments.


================
Comment at: llvm/utils/lit/lit/TestRunner.py:727
 
-def applySubstitutions(script, substitutions):
+def applySubstitutions(script, substitutions, tmpDir):
     """Apply substitutions to the script.  Allow full regular expression syntax.
----------------
Where is tmpDir used?


================
Comment at: llvm/utils/lit/lit/TestRunner.py:750
+            expanded = " ".join(result)
+            ln = ln.replace(m.group(), expanded)
+        ln = doDirectSubstitutions(ln)
----------------
I'm not totally sure about why a loop is needed here? Can't it be done in a single pass?
Also could we write a pattern that would infinite loop this?

I was expecting first to do `ln = doDirectSubstitutions(ln)` and then process the "glob" expressions.


https://reviews.llvm.org/D30380





More information about the llvm-commits mailing list