Hi Timothy,<br><br><a href="https://hpcforge.org/scm/viewvc.php/trunk/src/runtime/Platform.cpp?root=kernelgen&view=markup">https://hpcforge.org/scm/viewvc.php/trunk/src/runtime/Platform.cpp?root=kernelgen&view=markup</a><br>
<br>In this example either Host or NVPTX target machine is created and then used for code generation:<br><br><a href="https://hpcforge.org/scm/viewvc.php/trunk/src/runtime/CodeGen.cpp?root=kernelgen&view=markup">https://hpcforge.org/scm/viewvc.php/trunk/src/runtime/CodeGen.cpp?root=kernelgen&view=markup</a><br>
<br>This example in turn was long ago studied from llc.cpp, I think.<br><br>So the basic idea is first to select triple, then create target for this triple, then create target machine from target, triple and extra target-specific options.<br>
<br>If you are compiling for native host, default triple would suffice:<br><pre>Triple triple;
triple.setTriple(sys::getDefaultTargetTriple());</pre>Hope it helps.<br>- D.<br><br><div class="gmail_quote">2012/12/26 Timothy Baldridge <span dir="ltr"><<a href="mailto:tbaldridge@gmail.com" target="_blank">tbaldridge@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I can't seem to get LLVMCreateTargetMachine to work on my box (MBP i7 OS X 10.8). What should the values of triple, cpu and features be? I'm just looking for a way to get this up and going for now, I don't need specific optimizations. <br>
<br>No matter what I send the function, I always get nil back. I'm giving it LLVMGetFirstTarget as the target value.<div><br></div><div>Thanks for the help,</div><div><br></div><div>Timothy</div></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br>