diff options
author | Victor Huang <wei.huang@ibm.com> | 2021-05-11 16:35:13 -0500 |
---|---|---|
committer | Victor Huang <wei.huang@ibm.com> | 2021-05-11 17:21:08 -0500 |
commit | 46475a79f85b230fde3e7de8966c96bef14f0d24 (patch) | |
tree | 4a0604d36cb9a965149744adc0276e32d9b25ccb /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | d3f89d4d16883b2bcf5f032152f10e384b53d92a (diff) | |
download | llvm-46475a79f85b230fde3e7de8966c96bef14f0d24.zip llvm-46475a79f85b230fde3e7de8966c96bef14f0d24.tar.gz llvm-46475a79f85b230fde3e7de8966c96bef14f0d24.tar.bz2 |
[AIX][TLS] Diagnose use of unimplemented TLS models
Add front end diagnostics to report error for unimplemented TLS models set by
- compiler option `-ftls-model`
- attributes like `__thread int __attribute__((tls_model("local-exec"))) var_name;`
Reviewed by: aaron.ballman, nemanjai, PowerPC
Differential Revision: https://reviews.llvm.org/D102070
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 4b0bd30..0c5066a 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1808,6 +1808,14 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Opts.ExplicitEmulatedTLS = true; } + if (Arg *A = Args.getLastArg(OPT_ftlsmodel_EQ)) { + if (T.isOSAIX()) { + StringRef Name = A->getValue(); + if (Name != "global-dynamic") + Diags.Report(diag::err_aix_unsupported_tls_model) << Name; + } + } + if (Arg *A = Args.getLastArg(OPT_fdenormal_fp_math_EQ)) { StringRef Val = A->getValue(); Opts.FPDenormalMode = llvm::parseDenormalFPAttribute(Val); |