There are approximately 20 tests in tests/Driver that assume the clang binary is called "clang(.*)"; I would like to remove that assumption
Why is this a good idea?
Several modifications to clang require changing in-tree source files, for example, the clang internals manual has a section on how to add a new expressions and statements (http://clang.llvm.org/docs/InternalsManual.html#how-to-add-an-expression-or-statement).
Not everyone who wants to do this is making a change that can be contributed back upstream. I maintain a code generator which works by adding extensions to the language. This isn't the kind of thing either party would want in the official LLVM, so it is best implemented as a fork of clang (sadly it can't be a libtooling plugin, because in-tree files like StmtNodes.def need to be changed).
So that users can install such tools safely alongside clang, I think its a good idea to change the name of the executables and the intrinsics header directory. To avoid confusion, I think calling any such tool "clang" anywhere in the file name is a bad idea. I was pleasently surprised by how little of the build system I needed to change to get this to work. The system is pretty flexible, except for this part:
There are quite a few driver test files that assume a "%clang" driver invocation's -### printout expands into calls to "{{[^"]*}}clang{{[^"]*}}" "-cc1" or something similar. However, that's not the case in some other driver tests, where it just starts matching at "-cc1". For example, in test/Driver/freebsd.c:5 we just try to match "-cc1" <other stuff>, whereas in test/Driver/netbsd.c:102, we try to match a clang substring, then "-cc1", then <other stuff>. This patch would introduce a single way of doing it, one which is also friendlier to "renamed clang" tools. Changing these tests will ensure that this behavior doesn't get copy-and-pasted back, as people write new driver tests.