[llvm-branch-commits] [cfe-branch] r318346 - Merging r312748:
Tom Stellard via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Nov 15 14:41:48 PST 2017
Author: tstellar
Date: Wed Nov 15 14:41:48 2017
New Revision: 318346
URL: http://llvm.org/viewvc/llvm-project?rev=318346&view=rev
Log:
Merging r312748:
------------------------------------------------------------------------
r312748 | jroelofs | 2017-09-07 15:01:25 -0700 (Thu, 07 Sep 2017) | 10 lines
Fix validation of the -mthread-model flag in the Clang driver
The ToolChain class validates the -mthread-model flag in the constructor which
doesn't work correctly since the thread model methods are virtual methods. The
check is moved into Clang::ConstructJob() when constructing the internal
command line.
https://reviews.llvm.org/D37496
Patch by: Ian Tessier!
------------------------------------------------------------------------
Modified:
cfe/branches/release_50/lib/Driver/ToolChain.cpp
cfe/branches/release_50/lib/Driver/ToolChains/Clang.cpp
Modified: cfe/branches/release_50/lib/Driver/ToolChain.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_50/lib/Driver/ToolChain.cpp?rev=318346&r1=318345&r2=318346&view=diff
==============================================================================
--- cfe/branches/release_50/lib/Driver/ToolChain.cpp (original)
+++ cfe/branches/release_50/lib/Driver/ToolChain.cpp Wed Nov 15 14:41:48 2017
@@ -74,11 +74,6 @@ ToolChain::ToolChain(const Driver &D, co
: D(D), Triple(T), Args(Args), CachedRTTIArg(GetRTTIArgument(Args)),
CachedRTTIMode(CalculateRTTIMode(Args, Triple, CachedRTTIArg)),
EffectiveTriple() {
- if (Arg *A = Args.getLastArg(options::OPT_mthread_model))
- if (!isThreadModelSupported(A->getValue()))
- D.Diag(diag::err_drv_invalid_thread_model_for_target)
- << A->getValue() << A->getAsString(Args);
-
std::string CandidateLibPath = getArchSpecificLibPath();
if (getVFS().exists(CandidateLibPath))
getFilePaths().push_back(CandidateLibPath);
Modified: cfe/branches/release_50/lib/Driver/ToolChains/Clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_50/lib/Driver/ToolChains/Clang.cpp?rev=318346&r1=318345&r2=318346&view=diff
==============================================================================
--- cfe/branches/release_50/lib/Driver/ToolChains/Clang.cpp (original)
+++ cfe/branches/release_50/lib/Driver/ToolChains/Clang.cpp Wed Nov 15 14:41:48 2017
@@ -2227,8 +2227,12 @@ void Clang::ConstructJob(Compilation &C,
}
CmdArgs.push_back("-mthread-model");
- if (Arg *A = Args.getLastArg(options::OPT_mthread_model))
+ if (Arg *A = Args.getLastArg(options::OPT_mthread_model)) {
+ if (!getToolChain().isThreadModelSupported(A->getValue()))
+ D.Diag(diag::err_drv_invalid_thread_model_for_target)
+ << A->getValue() << A->getAsString(Args);
CmdArgs.push_back(A->getValue());
+ }
else
CmdArgs.push_back(Args.MakeArgString(getToolChain().getThreadModel()));
More information about the llvm-branch-commits
mailing list