[llvm-branch-commits] [cfe-branch] r252286 - Merging r248379:
Tom Stellard via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Nov 6 03:38:39 PST 2015
Author: tstellar
Date: Fri Nov 6 05:38:38 2015
New Revision: 252286
URL: http://llvm.org/viewvc/llvm-project?rev=252286&view=rev
Log:
Merging r248379:
------------------------------------------------------------------------
r248379 | joerg | 2015-09-23 10:06:52 -0400 (Wed, 23 Sep 2015) | 3 lines
Refactor library decision for -fopenmp support from Darwin into a
function for sharing with other platforms.
------------------------------------------------------------------------
Modified:
cfe/branches/release_37/lib/Driver/Tools.cpp
Modified: cfe/branches/release_37/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_37/lib/Driver/Tools.cpp?rev=252286&r1=252285&r2=252286&view=diff
==============================================================================
--- cfe/branches/release_37/lib/Driver/Tools.cpp (original)
+++ cfe/branches/release_37/lib/Driver/Tools.cpp Fri Nov 6 05:38:38 2015
@@ -2460,6 +2460,28 @@ static OpenMPRuntimeKind getOpenMPRuntim
return RT;
}
+static void addOpenMPRuntime(ArgStringList &CmdArgs, const ToolChain &TC,
+ const ArgList &Args) {
+ if (!Args.hasFlag(options::OPT_fopenmp, options::OPT_fopenmp_EQ,
+ options::OPT_fno_openmp, false))
+ return;
+
+ switch (getOpenMPRuntime(TC, Args)) {
+ case OMPRT_OMP:
+ CmdArgs.push_back("-lomp");
+ break;
+ case OMPRT_GOMP:
+ CmdArgs.push_back("-lgomp");
+ break;
+ case OMPRT_IOMP5:
+ CmdArgs.push_back("-liomp5");
+ break;
+ case OMPRT_Unknown:
+ // Already diagnosed.
+ break;
+ }
+}
+
static void addSanitizerRuntime(const ToolChain &TC, const ArgList &Args,
ArgStringList &CmdArgs, StringRef Sanitizer,
bool IsShared) {
@@ -6527,23 +6549,7 @@ void darwin::Linker::ConstructJob(Compil
Args.AddAllArgs(CmdArgs, options::OPT_L);
- if (Args.hasFlag(options::OPT_fopenmp, options::OPT_fopenmp_EQ,
- options::OPT_fno_openmp, false)) {
- switch (getOpenMPRuntime(getToolChain(), Args)) {
- case OMPRT_OMP:
- CmdArgs.push_back("-lomp");
- break;
- case OMPRT_GOMP:
- CmdArgs.push_back("-lgomp");
- break;
- case OMPRT_IOMP5:
- CmdArgs.push_back("-liomp5");
- break;
- case OMPRT_Unknown:
- // Already diagnosed.
- break;
- }
- }
+ addOpenMPRuntime(CmdArgs, getToolChain(), Args);
AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
// Build the input file for -filelist (list of linker input files) in case we
More information about the llvm-branch-commits
mailing list