Displaying 20 results from an estimated 50000 matches similar to: "[LLVMdev] C++ to C?"
2008 Oct 11
1
[LLVMdev] C++ to C?
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
2006 Nov 20
4
[LLVMdev] libstdc++ as bytecode, and compiling C++ to C
I've compiled all the object files that make up libstdc++ and libsupc++
into LLVM bytecode:
http://goanna.cs.rmit.edu.au/~emil/libstdcxx.tar.bz2 (438KB)
A simple test program, x.cpp:
#include <iostream>
int main() { std::cout << "hello world\n"; return 0; }
$ llvm-g++ -emit-llvm -c x.cpp
$ llvmc -o=out x.o std/*.o sup/*.o
$ lli out.bc
Segmentation fault (core
2008 Oct 11
0
[LLVMdev] C++ to C?
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.
Ciao,
Duncan.
2006 Nov 20
0
[LLVMdev] libstdc++ as bytecode, and compiling C++ to C
On Mon, 2006-11-20 at 17:49 +1100, Emil Mikulic wrote:
> I've compiled all the object files that make up libstdc++ and libsupc++
> into LLVM bytecode:
> http://goanna.cs.rmit.edu.au/~emil/libstdcxx.tar.bz2 (438KB)
>
> A simple test program, x.cpp:
>
> #include <iostream>
> int main() { std::cout << "hello world\n"; return 0; }
>
> $
2009 Sep 29
4
[LLVMdev] LLVM: C++ -> C
I've read that LLVM can convert from C++ to C code.
So I've used it in such a way:
I'm Windows-user so I used MinGW.
I employed this file as the test:
llvm-hello.cpp:
#include <iostream>
int main(int argc, char* argv[])
{
system("pause");
return 0;
}
result of "llvm-g++ C:\llvm_hello.cpp -o C:\llvm_hellopp.exe" worked just fine.
as a result of
2006 Nov 20
1
[LLVMdev] libstdc++ as bytecode, and compiling C++ to C
On Mon, Nov 20, 2006 at 08:01:23AM -0800, Reid Spencer wrote:
> On Mon, 2006-11-20 at 17:49 +1100, Emil Mikulic wrote:
> > I've compiled all the object files that make up libstdc++ and libsupc++
> > into LLVM bytecode:
> > http://goanna.cs.rmit.edu.au/~emil/libstdcxx.tar.bz2 (438KB)
> >
> > A simple test program, x.cpp:
> >
> > #include
2006 Nov 05
4
[LLVMdev] Convert C++ to C. What is 0x0p+0 ?
On Sat, 2006-11-04 at 21:06 -0800, Reid Spencer wrote:
> Hi Napi,
>
> On Sun, 2006-11-05 at 12:40 +0800, Mohd-Hanafiah Abdullah wrote:
> > Hi:
> >
> > I'm interested in using llvm to convert C++ code to C code.
> > I used the following command to do this:
> >
> > % llvm-g++ -c foo.cpp -o - | llc -march=c -o foo.cbe.c
>
> Yup, that'll
2008 Apr 04
2
[LLVMdev] PATCH: Use size reduction -- wave1
heisenbug wrote:
> On Apr 3, 10:53 pm, Gabor Greif <ga... at mac.com> wrote:
> ...
>
>
>>> 3) Make sure that make check and some reasonable subset of llvm-test
>>> passes with this patch :)
>>>
>> I have never run llvm-test in the past. Is it just checking it out and
>> following a readme?
>>
>
>
> After
2006 Nov 05
4
[LLVMdev] Convert C++ to C. What is 0x0p+0 ?
Hi:
I'm interested in using llvm to convert C++ code to C code.
I used the following command to do this:
% llvm-g++ -c foo.cpp -o - | llc -march=c -o foo.cbe.c
In the resulting file foo.cbe.c there are many occurences of '0x0p+0'.
What is it used for? Here's a code snippet from the file foo.cbe.c
if ((ltmp_126_2 > 0x0p+0)) {
goto ltmp_363_19;
} else {
goto
2006 Nov 05
0
[LLVMdev] Convert C++ to C. What is 0x0p+0 ?
Hi Napi,
On Sun, 2006-11-05 at 12:40 +0800, Mohd-Hanafiah Abdullah wrote:
> Hi:
>
> I'm interested in using llvm to convert C++ code to C code.
> I used the following command to do this:
>
> % llvm-g++ -c foo.cpp -o - | llc -march=c -o foo.cbe.c
Yup, that'll do it. Although you might want to do a little optimization
otherwise you're going to get a lot of C code on
2008 Aug 11
5
[LLVMdev] "long long" type in C backend
Hi,
Im trying to generate C source from C++ source file,
using C backend.
llvm-g++ -O3 -emit-llvm valen.cpp -c -o valen.bc
llc -march=c valen.bc -f -o valen.c
But C backend generate a lot of operation with "long long" type.
My C compiler does not support "long long" type.
Is there any option to disable generate "long long" ?
--
Thanks,
2008 Apr 04
3
[LLVMdev] PATCH: Use size reduction -- wave1
On Apr 4, 8:06 pm, heisenbug <ggr... at gmail.com> wrote:
> On Apr 4, 7:51 pm, Török Edwin <edwinto... at gmail.com> wrote:
>
>
>
> > heisenbug wrote:
> > > On Apr 3, 10:53 pm, Gabor Greif <ga... at mac.com> wrote:
> > > ...
>
> > >>> 3) Make sure that make check and some reasonable subset of llvm-test
> > >>>
2008 Apr 04
0
[LLVMdev] PATCH: Use size reduction -- wave1
On Apr 4, 7:51 pm, Török Edwin <edwinto... at gmail.com> wrote:
> heisenbug wrote:
> > On Apr 3, 10:53 pm, Gabor Greif <ga... at mac.com> wrote:
> > ...
>
> >>> 3) Make sure that make check and some reasonable subset of llvm-test
> >>> passes with this patch :)
>
> >> I have never run llvm-test in the past. Is it just checking it
2007 Apr 08
3
[LLVMdev] C++ -> C translation problems
Hi All,
I am trying to use llvm compiler to translate a non-trivial piece of code from C++ to C.
I need this because I need to use part of the code as lib for another project that is strictly C.
I am working under MSWin and I have choice to use either BCC or MSVC.
After a good deal of tries I found out I had to somewhat massage llc -march=c output to make it *almost* compilable.
I have one
2006 Nov 20
0
[LLVMdev] libstdc++ as bytecode, and compiling C++ to C
On Mon, 2006-11-20 at 17:49 +1100, Emil Mikulic wrote:
> I've compiled all the object files that make up libstdc++ and libsupc++
> into LLVM bytecode:
> http://goanna.cs.rmit.edu.au/~emil/libstdcxx.tar.bz2 (438KB)
>
> A simple test program, x.cpp:
>
> #include <iostream>
> int main() { std::cout << "hello world\n"; return 0; }
>
> $
2011 Apr 20
2
Include C++ DLL, error in ...: C symbol name not in load table
Hello R experts
I am googling and reading around, however, I can't get it working
(perhaps because I do not understand much C, however, I'll give it
a try). I am trying to include C++ code into an R routine, where
the C++ code looks:
#include <iostream>
using namespace std;
void foo (double* x, double* y, double* out)
{
out[0] = x[0] + y[0];
}
Back in R, the command
R CMD
2011 Dec 13
1
[LLVMdev] Issues in converting C++ code to C using llvm and llc
Hello All,
I came to know from a friend that using LLVM insfrastucture one can convert
C++ programs to C. I needed this for my cross-compiler because we don't
have support for C++ compilation in our cross-compiler.
I tried following:
http://llvm.org/docs/FAQ.html#translatecxx
While I can generate .bc its llc which gives error. Then I also tried
"clang" as oppose to llvm-g++.
Here
2008 Apr 04
0
[LLVMdev] PATCH: Use size reduction -- wave1
On Apr 3, 10:53 pm, Gabor Greif <ga... at mac.com> wrote:
...
>
> > 3) Make sure that make check and some reasonable subset of llvm-test
> > passes with this patch :)
>
> I have never run llvm-test in the past. Is it just checking it out and
> following a readme?
After building an llvm-gcc (4.2.1), see below, I tried running this. I
configured:
./configure
2004 May 01
4
[LLVMdev] opt, llcc, ll++, -O1, -O2, -O3
Hi devels,
there are two issues concerning invoking
optimizations:
1.
this document:
http://llvm.cs.uiuc.edu/docs/GettingStarted.html
is very nice, it would be good though to add in a section
An Example Using the LLVM Tool Chain
examples on optimization step.
2.
If i am not wrong there is no tool, which integrates all
steps:
llvmgcc->opt->llc into something like llcc
(and
2006 Nov 05
0
[LLVMdev] Convert C++ to C. What is 0x0p+0 ?
On Nov 5, 2006, at 2:30 AM, Mohd-Hanafiah Abdullah wrote:
> On Sat, 2006-11-04 at 21:06 -0800, Reid Spencer wrote:
>>> In the resulting file foo.cbe.c there are many occurences of '0x0p
>>> +0'.
>>> What is it used for? Here's a code snippet from the file foo.cbe.c
>>>
>>> if ((ltmp_126_2 > 0x0p+0)) {
>>> goto