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) {
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