The GCC makes the similar exceptions. Libs/Snippets from peephole optimizations are technically covered by the compiler's license as they're part of the compiler. So the output program is in a sense a derivative work. This really hasn't been challenged in court, but you can see how this could invoke a rather lengthy case if you say pissed off Peter Thiel.
To cover this the GCC's GPL license has exceptions to the GPLv3 for output programs, or programs that use it's headers. You really can't argue the GCC isn't licensed by the GPL. It merely has a handful of exceptions that are specific to the legal oddity of a program who's copyright copyrights derived works, and its sole purpose is to produce derived works.
The Linux Kernel has similar exceptions as syscall functions are inserted into your program at load time. And really everything links against it's headers.
Makes sense the LLVM would do the same