Devchandra L Meetei
2013-Jul-29 18:01 UTC
[LLVMdev] Require Grammar for converting C to IR
Seems that Vijay is asking about converting C program to LLVM IR On Mon, Jul 29, 2013 at 9:26 PM, Eli Bendersky <eliben at google.com> wrote:> > > > On Sat, Jul 27, 2013 at 9:02 AM, Vijay Daultani <vijay.daultani at gmail.com>wrote: > >> Respected Sir/Madam, >> >> As I was developing some part of compiler for a project. I require grammar >> (BNF or EBNF) for converting the C code in the IR as it is not been >> mentioned any where over your official website. >> >> Awaiting for your help. >> >> > Hi Vijay, > > If you are asking about compiling C into LLVM IR - take a look at Clang: > http://clang.llvm.org/. Clang is a C, C++ and ObjC front-end for LLVM. > > Eli > > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-- Warm Regards --Dev OpenPegasus Developer/Committer (\__/) (='.'=) This is Bunny. Copy and paste bunny (")_(") to help him gain world domination. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130729/b724ec96/attachment.html>
Caldarale, Charles R
2013-Jul-29 19:41 UTC
[LLVMdev] Require Grammar for converting C to IR
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] > On Behalf Of Devchandra L Meetei > Subject: Re: [LLVMdev] Require Grammar for converting C to IR> > If you are asking about compiling C into LLVM IR - take a look at Clang: > > http://clang.llvm.org/. Clang is a C, C++ and ObjC front-end for LLVM.> Seems that Vijay is asking about converting C program to LLVM IRWhich is exactly what clang does, hence the previous answer from Eli. - Chuck
On 29 July 2013 20:41, Caldarale, Charles R <Chuck.Caldarale at unisys.com>wrote:> > Seems that Vijay is asking about converting C program to LLVM IR > > Which is exactly what clang does, hence the previous answer from Eli. >We seem to have a communication breakdown. My quick answer was also "look at Clang", though it seems they're asking for something different... As far as I know, there isn't any C/C++ EBNF -> LLVM IR parsers available, as there aren't crazy enough folks out there... ;) A few hints: * If you're looking for the EBNF description of C/C++, google for "C++ ebnf" and you'll find plenty. * If you need a compiler for C/C++, look at Clang, and you'll find a great implementation. * If you're looking for a tool that gets a C/C++ grammar and transforms into a parser (like bison), you may find examples at the Gnu Bison docs. You can than use that to convert your AST to LLVM IR, but you'll have to hand-code the bridge yourself. cheers, --renato -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130729/75fda27c/attachment.html>