From ca552b8d31e12d1068bbd3ac01f8b490712596f0 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Thu, 1 Mar 2018 22:26:19 +0000 Subject: [Driver] Pass -f[no-]emulated-tls and set up ExplicitEmulatedTLS Since LLVM r326341, default EmulatedTLS mode is decided in backend according to target triple. Any front-end should pass -f[no]-emulated-tls to backend and set up ExplicitEmulatedTLS only when the flags are used. Differential Revision: https://reviews.llvm.org/D43965 llvm-svn: 326499 --- clang/lib/Frontend/CompilerInvocation.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 7e060bb..a8b7dd9 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -942,8 +942,12 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, } } - Opts.EmulatedTLS = - Args.hasFlag(OPT_femulated_tls, OPT_fno_emulated_tls, false); + if (Args.getLastArg(OPT_femulated_tls) || + Args.getLastArg(OPT_fno_emulated_tls)) { + Opts.ExplicitEmulatedTLS = true; + Opts.EmulatedTLS = + Args.hasFlag(OPT_femulated_tls, OPT_fno_emulated_tls, false); + } if (Arg *A = Args.getLastArg(OPT_ftlsmodel_EQ)) { StringRef Name = A->getValue(); -- cgit v1.1