<div dir="auto">When trying to run an EmitLLVMOnlyAction via ClangTool::run(act_factory) I get the following error:<br></div>
<div dir="auto">Clang: Not enough positional command line arguments specified!<br><br></div>
<div dir="auto">Stepping through the code I found that there seems to be a problem in setCommandLineOpts in clang/lib/CodeGen/BackendUtils.cpp, the BackendArgs.push_back with literals doesn't seem to work and a corrupt SmallVector is passed to ParseCommandLineOptions.<br></div>
<div dir="auto">Why is setCommandLineOpts even called, isn't EmitLLVMOnlyAction supposed to create llvm::Module in memory only without without outputting it to a file? Did I misinterpret the Emit_Nothing flag? What does EmitLLVMOnlyAction do?<br></div>
<div dir="auto">What command line args does EmitLLVMOnlyAction expect?<br><br></div>
<div dir="auto">Cmd line: mytool test.cpp -p=compile_commands.json<br><br></div>
<div dir="auto">Compile_commands:<br></div>
<div dir="auto">{<br></div>
<div dir="auto">"directory":"path/to/build",<br></div>
<div dir="auto">"command": "/usr/local/bin/clang++   -Ipath/to/include - std=c++11 -Wall -o path/to/test.cpp.o -c /path/to/test.cpp",<br></div>
<div dir="auto">"file": "/path/to/test.cpp"<br></div>
<div dir="auto">}<br><br></div>
<div dir="auto">Thanks, <br></div>
<div dir="auto">Viktor<br></div>