<p dir="ltr">Hi,</p>
<p dir="ltr">There is a good documentation for writing a backend for sample architecture CPU0.</p>
<p dir="ltr">Please refer this pdf</p>
<p dir="ltr"><a href="https://www.google.co.in/url?sa=t&source=web&rct=j&ei=xhkEVaH-DJO2uATshIKIBw&url=http://jonathan2251.github.io/lbd/TutorialLLVMBackendCpu0.pdf&ved=0CBsQFjAA&usg=AFQjCNFZR2uFivZlsfCuZbMzyJmKJUV7Vg">https://www.google.co.in/url?sa=t&source=web&rct=j&ei=xhkEVaH-DJO2uATshIKIBw&url=http://jonathan2251.github.io/lbd/TutorialLLVMBackendCpu0.pdf&ved=0CBsQFjAA&usg=AFQjCNFZR2uFivZlsfCuZbMzyJmKJUV7Vg</a></p>
<p dir="ltr">Regards,<br>
Suyog</p>
<div class="gmail_quot<blockquote class=" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Is there documentation somewhere about exactly what the function is supposed to do, or do I have to figure it out from existing examples?</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Mar 14, 2015 at 12:13 AM, Anton Korobeynikov <span dir="ltr"><<a href="mailto:anton@korobeynikov.info" target="_blank">anton@korobeynikov.info</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You have to provide this function and initialize the whole MC infrastructure.<br>
<br>
See e.g. lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp<br>
<div><div><br>
On Sat, Mar 14, 2015 at 10:11 AM, Daniel Dilts <<a href="mailto:diltsman@gmail.com" target="_blank">diltsman@gmail.com</a>> wrote:<br>
> Yes, llvm::InitializeAllTargetMCs(void) does seem to be autogenerated.  It<br>
> is _LLVMInitializeFooTargetMC that I can't find documented anywhere.<br>
><br>
> On Sat, Mar 14, 2015 at 12:05 AM, Anton Korobeynikov<br>
> <<a href="mailto:anton@korobeynikov.info" target="_blank">anton@korobeynikov.info</a>> wrote:<br>
>><br>
>> This function is autogenerated. You need also to change top-level<br>
>> configure / cmake files.<br>
>><br>
>> On Sat, Mar 14, 2015 at 8:38 AM, Daniel Dilts <<a href="mailto:diltsman@gmail.com" target="_blank">diltsman@gmail.com</a>> wrote:<br>
>> > In attempting to add a backend I came across the documentation here:<br>
>> > <a href="http://llvm.org/docs/WritingAnLLVMBackend.html" target="_blank">http://llvm.org/docs/WritingAnLLVMBackend.html</a><br>
>> ><br>
>> > The section on the build system seems to be out of date, or maybe I<br>
>> > don't<br>
>> > understand it.  I copied the Sparc target to a directory (Foo for the<br>
>> > example), added Foo to the subdirectories list in<br>
>> > llvm\lib\Target\LLVMBuild.txt and to LLVM_ALL_TARGETS in<br>
>> > llvm\CMakeLists.txt.  I removed the files except for<br>
>> > FooTargetMachine.cpp<br>
>> > and FooTargetMachine.h.<br>
>> ><br>
>> > FooTargetMachine is not completed yet, but I was trying to compile and<br>
>> > get<br>
>> > linker errors about _LLVMInitializeFooTargetMC referenced in function<br>
>> > void<br>
>> > llvm::InitializeAllTargetMCs(void).  I do not see anything about how to<br>
>> > implement this function.<br>
>> ><br>
>> > Is there additional documentation about how to implement a backend that<br>
>> > I am<br>
>> > missing?<br>
>> ><br>
>> > _______________________________________________<br>
>> > LLVM Developers mailing list<br>
>> > <a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">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>
>><br>
>><br>
>><br>
>> --<br>
>> With best regards, Anton Korobeynikov<br>
>> Faculty of Mathematics and Mechanics, Saint Petersburg State University<br>
><br>
><br>
<br>
<br>
<br>
--<br>
With best regards, Anton Korobeynikov<br>
Faculty of Mathematics and Mechanics, Saint Petersburg State University<br>
</div></div></blockquote></div><br></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></div>