We shouldn't just check the clang options, we also should check
Triple::hasDefaultEmulatedTLS().
This doesn't make any testable difference in this commit, because
the check for emulated TLS is within a block for
TT.isWindowsGNUEnvironment(), and hasDefaultEmulatedTLS() returns
false for any such environment - but it makes the code from
0e4cf807aeaf54a10e02176498a7df13ac722b37 / D102970 more correct and
generic.
Some mingw distributions carry a downstream patch, that enables
emulated TLS by default for mingw targets in hasDefaultEmulatedTLS()
- and for such cases, this patch does make a difference and fixes the
detection of emulated TLS, if it is implicitly enabled.
I'm open for better suggestions on where to place the useEmulatedTLS()
helper function; it's a parallel to the preexisting
TargetMachine::useEmulatedTLS() which does the same, within llvm.