[LLVMdev] C++ to C?
Michael McDonnell
michaeldmcdonnell at yahoo.com
Sat Oct 11 13:01:03 PDT 2008
Hi Dale,
Thank you for your comments. (BTW, I'm here in San Jose - I see you're at Apple).
I'm simply looking for tool that will accept C/C++ source and generate machine code for a virtual machine, the ultimate goal being to use the system as a teaching tool.
Any suggestions would be appreciated.
Thanks,
M. McDonnell
--- On Sat, 10/11/08, Dale Johannesen <dalej at apple.com> wrote:
From: Dale Johannesen <dalej at apple.com>
Subject: Re: [LLVMdev] C++ to C?
To: "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu>
Cc: "Dale Johannesen" <dalej at apple.com>, "Michael" <MichaelDMcDonnell at yahoo.com>
Date: Saturday, October 11, 2008, 12:33 PM
On Oct 11, 2008, at 12:49 AM, Duncan Sands wrote:
> On Friday 10 October 2008 20:29:49 Michael wrote:
>> What command and options should be used to convert C++ to C?
>
> Try this:
>
> llvm-gcc -c -O3 -emit-llvm file.cpp -o - | llc -march=c -o -
>
> It should spray C code to standard out.
Bear in mind that if you use features from the C++ library, you are
still going to need a C++ library.
llvm does not try to translate iostream into stdio calls or anything
like that.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081011/37cf29b0/attachment.html>
More information about the llvm-dev
mailing list