[PATCH] D31497: Add a %basename substitution

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 31 10:19:59 PDT 2017


rnk added inline comments.


================
Comment at: utils/lit/lit/TestRunner.py:704
+    tmpName = tmpBase + '.tmp'
+    baseName = os.path.basename(tmpBase)
     substitutions.extend([('%s', sourcepath),
----------------
rnk wrote:
> `%basename` doesn't seem like a very obvious substitution to me. It should be equivalent to the basename of the source path. Can you think of a more intuitive name for it? %sbase? %sbasename? %sourcebasename?
> 
> We have an existing convention that capital letters are the dirname of that substitution, which is OK, but I can't think of another convention that would get the basename of that letter.
> 
> I guess I like %sourcebasename best. It's long and descriptive, but this is only used inside sanitizer lit.common.cfg to form other more high-level substitutions.
%basename_t sounds good. You're right, I thought you were doing the basename of %t before adding .tmp, which would make %basename_s and %basename_t the same.


https://reviews.llvm.org/D31497





More information about the llvm-commits mailing list