Clang discovers the path to it's own executable and uses this
to re-invoke itself when -fno-integrated-cc1 is set, or if there are
multiple jobs, i.e. multiple source files specified. When clang is
invoked as part of the llvm driver, it's executable is going to be the
driver executable 'llvm', not the symlink 'clang', so the invocation
will look like 'llvm -cc1 ...'. The llvm driver will try to find an tool
called '-cc1' and will fail.
This patch changes clang to realize if the executable it found was
the llvm-driver, in which case it will prepend "clang" to the args.
Unconditionally doin'g "clang" is safe because it will only ever
re-invoke itself in cc1 mode, and never need to specify, clang++,
etc.
Instead of storing a boolean and then duplicating this check and hardcoding the name "clang" in multiple places, we could store the name in the Driver (for example as DriverName) and default it to null. It'd be a responsibility of cc1gen_reproducer_main.cpp and driver.cpp to set it.