On mingw, the llvm shlib gets built without a prefix or version suffix as just LLVM.dll, see
https://github.com/llvm-mirror/llvm/blob/edd4534a45df348c4ae87cfa8d08e719ae0c7085/cmake/modules/AddLLVM.cmake#L453-L471
llvm-config looks for and fails to find LLVM-3.9.dll, giving
$ ./llvm-config.exe --link-shared --libs
llvm-config: error: LLVM-3.9.dll is missing
I've fixed this by modifying SharedVersionedExt (and moving where the "-" for the version gets set).
That makes llvm-config look for the right file name and find it, but because the
GetComponentLibraryNameSlice function only checks Lib.startswith("lib") to determine
whether or not to remove both prefix and extension, it would output -lLLVM.dll which the
mingw linker doesn't handle correctly. Fixed that by making GetComponentLibraryNameSlice
check Lib.startswith(SharedPrefix), so now the output is just -lLLVM which links correctly.