[LLVMdev] Require Grammar for converting C to IR
Renato Golin
renato.golin at linaro.org
Mon Jul 29 13:21:14 PDT 2013
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>
More information about the llvm-dev
mailing list