<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 18, 2015 at 8:34 AM, Ahmed Taj elsir <span dir="ltr"><<a href="mailto:meedo456123@gmail.com" target="_blank">meedo456123@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I'm new in LLVM project , I have to write a compiler frond-end (based<br>
on LLVM) in C++ to support my programming language .Am I have to<br>
implement support for each architecture or LLVM has libraries  that<br>
can do this for me ? (btw I don't want to support architecture that<br>
LLVM don't) .<br></blockquote><div><br>Most of the architecture-specific code is in LLVM, away from anything you'll have to worry about. Some stuff ends up leaking up into your front-end, but not much if you're starting with a simple language and don't need to interoperate with existing C libraries, for example. (if your language needs to be able to call into existing C (or, worse, C++) libraries then you'll need to worry about the ABI, and that's a fair amount of work/code/knowledge that needs to reside in your frontend)<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">does LLVM has helper functions to create objects in heap ?</blockquote><div><br>In your target program? No, there's not much/any help there - you just call malloc/free (or op new/delete) in your LLVM IR like you would in a simple C program.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> if not is it good idea to use C++11 smart pointer to do memory management<br>
operations (at least in the first versions of my language ) ?<br></blockquote><div><br>Inside your target program? You won't, presumably, have access to the C++ standard library in your language so you won't be able to use its convenient smart pointers. You can make your own in your new programming language, depending on what language features you have to work with.<br><br>The LLVM Kaleidoscope tutorials might give you some idea of how to get started writing a compiler using LLVM.<br><br>- David<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Sorry,if some questions are silly , but I'm still beginner in compiler's world .<br>
<br>
Thanks.<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>
</blockquote></div><br></div></div>