diff options
author | Chih-Hung Hsieh <chh@google.com> | 2018-03-01 22:26:19 +0000 |
---|---|---|
committer | Chih-Hung Hsieh <chh@google.com> | 2018-03-01 22:26:19 +0000 |
commit | ca552b8d31e12d1068bbd3ac01f8b490712596f0 (patch) | |
tree | c8b489b149bd661ae49d539ab7259f135bb693c3 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 2e4bcb00956effb5f8bd950fc19a50c5a2b9380a (diff) | |
download | bcm5719-llvm-ca552b8d31e12d1068bbd3ac01f8b490712596f0.tar.gz bcm5719-llvm-ca552b8d31e12d1068bbd3ac01f8b490712596f0.zip |
[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
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 7e060bbcdf2..a8b7dd96644 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(); |