From 0d333bf0e3aa37e2e6ae211e3aa80631c3e01b85 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 23 Apr 2023 11:55:12 -0700 Subject: Remove ExplicitEmulatedTLS and simplify -femulated-tls handling Currently clangDriver passes -femulated-tls and -fno-emulated-tls to cc1. cc1 forwards the option to LLVMCodeGen and ExplicitEmulatedTLS is used to decide the value. Simplify this by moving the Clang decision to clangDriver and moving the LLVM decision to InitTargetOptionsFromCodeGenFlags. --- clang/lib/Frontend/CompilerInvocation.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 1ecf116..cb29049 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1536,8 +1536,8 @@ void CompilerInvocation::GenerateCodeGenArgs( F.Filename, SA); } - GenerateArg( - Args, Opts.EmulatedTLS ? OPT_femulated_tls : OPT_fno_emulated_tls, SA); + if (Opts.EmulatedTLS) + GenerateArg(Args, OPT_femulated_tls, SA); if (Opts.FPDenormalMode != llvm::DenormalMode::getIEEE()) GenerateArg(Args, OPT_fdenormal_fp_math_EQ, Opts.FPDenormalMode.str(), SA); @@ -1890,11 +1890,6 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Opts.LinkBitcodeFiles.push_back(F); } - if (!Args.getLastArg(OPT_femulated_tls) && - !Args.getLastArg(OPT_fno_emulated_tls)) { - Opts.EmulatedTLS = T.hasDefaultEmulatedTLS(); - } - if (Arg *A = Args.getLastArg(OPT_ftlsmodel_EQ)) { if (T.isOSAIX()) { StringRef Name = A->getValue(); -- cgit v1.1