[PATCH] D76178: [lit] Recursively apply substitutions

Julian Lettner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 15 11:29:21 PDT 2020


yln added a comment.

I think this is a great plan! I am not too worried about performance in this case, but I am always a fan for keeping things simple.  Doing things at once is justified IMO.
@jdenny also has provided a lot of good feedback for me.

> 2. The sort required for longest-match and the one for recursive substitutions might not agree. For example, consider the following set of substitutions: `[('%clang_exe', '/usr/bin/c++'), ('%clang', '%clang_exe')]`. The recursive substitution sort tells us to apply `%clang` before `%clang_exe`, but the longest-match consideration would require that we do the opposite. I can't think of a way to satisfy both these criteria.

This is the only part that I am not completely following.  Are there any situations for which the recursive order is preferable?  In this example, wouldn't substituting `%clang` first result in infinite recursion?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76178





More information about the llvm-commits mailing list