<div dir="ltr">There is no single LLVM IR for the entire compilation process in such a command line - separate IR is created for each source file, an object file is created, then those (native, non-IR) object files are linked together. So it's somewhat a invalid concept.<br><br>In your case, since there's only one file anyway, just add -c and you should be fine (your IR won't include the standard library/other thingsn that would be linked into the program - but those would be native objects and not IR in any case)<br><br>- Dave</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 30, 2016 at 5:33 AM, Lorenzo Laneve via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">When I try to do <div><br></div><div>clang++ main.cpp -emit-llvm</div><div><br></div><div>without -S, clang says that he can’t:</div><div><br></div><div><div style="margin:0px;line-height:normal;font-family:'Andale Mono';color:rgb(41,249,20);background-color:rgb(0,0,0)"><span>clang: error: -emit-llvm cannot be used when linking</span></div></div><div><br></div><div><br></div><div>why can’t it emit the IR in a complete compilation process?</div><div><br></div><div>Is there a particular technical reason or just to avoid confusing jobs?</div></div><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>