[clang] Explicitly set the EmulatedTLS codegen option. NFC.
Set the EmulatedTLS option based on `Triple::hasDefaultEmulatedTLS()` if the user didn't specify it; set `ExplicitEmulatedTLS` to true in `llvm::TargetOptions` and set `EmulatedTLS` to Clang's opinion of what the default or preference is. This avoids any risk of deviance between the two. This affects one check of `getCodeGenOpts().EmulatedTLS` in `shouldAssumeDSOLocal` in CodeGenModule, but as that check only is done for `TT.isWindowsGNUEnvironment()`, and `hasDefaultEmulatedTLS()` returns false for such environments it doesn't make any current testable difference - thus NFC. 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. Differential Revision: https://reviews.llvm.org/D132916
Loading
Please sign in to comment