Hello, I'm trying to do a source to source translation from C++ code to C++ code. I want the output to contains some automatically inserted annotations, and the rest of the code exactly the same as it was before the processing. Is this possible with llvm? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101020/dc34dfbf/attachment.html>
Hi Carlos,> I'm trying to do a source to source translation from C++ code to C++ code. I > want the output to contains some automatically inserted annotations, and the > rest of the code exactly the same as it was before the processing. Is this > possible with llvm?this may be possible with clang. I suggest you ask on the clang mailing list. Best wishes, Duncan.
On 20.10.2010 22:57, Carlos Crespo wrote:> Hello, > > I'm trying to do a source to source translation from C++ code to C++ > code. I want the output to contains some automatically inserted > annotations, and the rest of the code exactly the same as it was > before the processing. Is this possible with llvm?That's possible with Clang. Please post on the cfe-dev list. Sebastian
Hello Carlos, I don't think so. LLVM is not a source-to-source translator, but an optimizing compiler based on a portable, typed, assembly-like intermediate representation. One of the primary goals of LLVM is to generate optimized object code on a variety of platforms. Even if you do not use any optimizations, your C++ code would still need to be lowered to LLVM, which makes it very hard to get the same code back (if at all possible). Maybe something along the lines of TXL would be more appropriate for what you want to do? Matthieu> >De : Carlos Crespo <macayaven at gmail.com> >À : llvmdev at cs.uiuc.edu >Envoyé le : Mer 20 octobre 2010, 22h 57min 07s >Objet : [LLVMdev] Source to source translation. > >Hello, > >I'm trying to do a source to source translation from C++ code to C++ code. I >want the output to contains some automatically inserted annotations, and the >rest of the code exactly the same as it was before the processing. Is this >possible with llvm? > >Thanks. >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101021/ecdde878/attachment.html>
Thanks for your answer Matthieu! I will check out TXL as you say. I have been reading it's documentation and it seems to provide the functionality I need. Greetings and thanks again. On Thu, Oct 21, 2010 at 4:27 AM, Matthieu Wipliez <mwipliez at yahoo.fr> wrote:> Hello Carlos, > > I don't think so. > LLVM is not a source-to-source translator, but an optimizing compiler based > on a portable, typed, assembly-like intermediate representation. One of the > primary goals of LLVM is to generate optimized object code on a variety of > platforms. > Even if you do not use any optimizations, your C++ code would still need to > be lowered to LLVM, which makes it very hard to get the same code back (if > at all possible). > Maybe something along the lines of TXL would be more appropriate for what > you want to do? > > Matthieu > > > *De :* Carlos Crespo <macayaven at gmail.com> > *À :* llvmdev at cs.uiuc.edu > *Envoyé le :* Mer 20 octobre 2010, 22h 57min 07s > *Objet :* [LLVMdev] Source to source translation. > > Hello, > > I'm trying to do a source to source translation from C++ code to C++ code. > I want the output to contains some automatically inserted annotations, and > the rest of the code exactly the same as it was before the processing. Is > this possible with llvm? > > Thanks. > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101021/086affd2/attachment.html>