<div dir="ltr">Nope - this sounds good to me. Thanks Davide!<div><br></div><div>- Lang.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 31, 2016 at 9:34 AM, Davide Italiano <span dir="ltr"><<a href="mailto:davide@freebsd.org" target="_blank">davide@freebsd.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Fri, Oct 28, 2016 at 9:52 AM, Lang Hames via llvm-commits<br>
<<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
> Author: lhames<br>
> Date: Fri Oct 28 11:52:34 2016<br>
> New Revision: 285413<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=285413&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=285413&view=rev</a><br>
> Log:<br>
> [lli] Pass command line arguments in to the orc-lazy JIT.<br>
><br>
> This brings the LLI orc-lazy JIT's behavior more closely in-line with LLI's<br>
> mcjit bahavior.<br>
><br>
> Modified:<br>
> llvm/trunk/tools/lli/<wbr>OrcLazyJIT.cpp<br>
> llvm/trunk/tools/lli/<wbr>OrcLazyJIT.h<br>
> llvm/trunk/tools/lli/lli.cpp<br>
><br>
> Modified: llvm/trunk/tools/lli/<wbr>OrcLazyJIT.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lli/OrcLazyJIT.cpp?rev=285413&r1=285412&r2=285413&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/llvm/trunk/tools/lli/<wbr>OrcLazyJIT.cpp?rev=285413&r1=<wbr>285412&r2=285413&view=diff</a><br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- llvm/trunk/tools/lli/<wbr>OrcLazyJIT.cpp (original)<br>
> +++ llvm/trunk/tools/lli/<wbr>OrcLazyJIT.cpp Fri Oct 28 11:52:34 2016<br>
> @@ -104,8 +104,8 @@ static PtrTy fromTargetAddress(JITTarget<br>
> return reinterpret_cast<PtrTy>(<wbr>static_cast<uintptr_t>(Addr));<br>
> }<br>
><br>
> -int llvm::runOrcLazyJIT(std::<wbr>vector<std::unique_ptr<Module><wbr>> Ms, int ArgC,<br>
> - char* ArgV[]) {<br>
> +int llvm::runOrcLazyJIT(std::<wbr>vector<std::unique_ptr<Module><wbr>> Ms,<br>
> + const std::vector<std::string> &Args) {<br>
> // Add the program's symbols into the JIT's search space.<br>
> if (sys::DynamicLibrary::<wbr>LoadLibraryPermanently(<wbr>nullptr)) {<br>
> errs() << "Error loading program symbols.\n";<br>
> @@ -152,7 +152,10 @@ int llvm::runOrcLazyJIT(std::<wbr>vector<std:<br>
> }<br>
><br>
> typedef int (*MainFnPtr)(int, char*[]);<br>
> + std::vector<const char *> ArgV;<br>
> + for (auto &Arg : Args)<br>
> + ArgV.push_back(Arg.c_str());<br>
> auto Main = fromTargetAddress<MainFnPtr>(<wbr>MainSym.getAddress());<br>
> - return Main(ArgC, ArgV);<br>
> + return Main(ArgV.size(), (char**)ArgV.data());<br>
> }<br>
<br>
</div></div>Hi Lang, gcc6.1 complained about a `const` qualifier being stripped.<br>
No bots failed because we haven't such a configuration, but I care a<br>
bit because I build with gcc7 (trunk) and -Werror.<br>
I checked in a fix as r285592. Please let me know if it doesn't make<br>
sense to you.<br>
<br>
Thanks!<br>
<br>
--<br>
Davide<br>
</blockquote></div><br></div>