<div dir="ltr"><div class="gmail_quote">Thanks for the review!</div><div class="gmail_quote"><br></div><div class="gmail_quote">I'll make these changes shortly, just responding below:</div><div class="gmail_quote"><br></div><div class="gmail_quote">On Thu, May 28, 2015 at 12:39 AM Justin Bogner <<a href="mailto:mail@justinbogner.com">mail@justinbogner.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Chandler Carruth <<a href="mailto:chandlerc@gmail.com" target="_blank">chandlerc@gmail.com</a>> writes:<br>
> + /// The legacy name for the LLVM OpenMP runtim from when it was the Intel<br>
^~~~~~<br>
Typo.<br></blockquote><div><br></div><div>Good catch!</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> + /// OpenMP runtime. We support this mode for users with existing dependencies<br>
> + /// on this runtime library name.<br>
> + OMPRT_IOMP5<br>
> +};<br>
> +}<br>
> +<br>
> +/// Compute the desired OpenMP runtime from the flag provided.<br>
> +static OpenMPRuntimeKind getOpenMPRuntime(const ToolChain &TC, const ArgList &Args) {<br>
<br>
Long line?<br></blockquote><div><br></div><div>Doh, will fix.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> + StringRef RuntimeName(CLANG_DEFAULT_OPENMP_RUNTIME);<br>
> +<br>
> + const Arg *A = Args.getLastArg(options::OPT_fopenmp_EQ);<br>
> + if (A)<br>
> + RuntimeName = A->getValue();<br>
> +<br>
> + auto RT = llvm::StringSwitch<OpenMPRuntimeKind>(RuntimeName)<br>
> + .Case("libomp", OMPRT_OMP)<br>
> + .Case("libgomp", OMPRT_GOMP)<br>
> + .Case("libiomp5", OMPRT_IOMP5)<br>
> + .Default(OMPRT_Unknown);<br>
> +<br>
> + if (RT == OMPRT_Unknown) {<br>
> + if (A)<br>
> + TC.getDriver().Diag(diag::err_drv_unsupported_option_argument)<br>
> + << A->getOption().getName() << A->getValue();<br>
> + else<br>
> + // FIXME: We could use a nicer diagnostic here.<br>
> + TC.getDriver().Diag(diag::err_drv_unsupported_opt) << "-fopenmp";<br>
<br>
Is this even reachable in a meaningful way? CLANG_DEFAULT_OPENMP_RUNTIME<br>
has to be something we don't understand. If we can somehow get here, the<br>
error is really "You're using a version of LLVM that was configured<br>
wrong, get a better one".<br></blockquote><div><br></div><div>Totally open to suggestions about how to approach this. I wasn't sure of the best one myself, and left a FIXME to try and find a better one. At the least, as you say, this isn't really reachable in any sensible setup. Ideas about how to actually check this?</div></div></div>