Philipp Klaus Krause
2006-Nov-23 18:10 UTC
[LLVMdev] Byte code portability (was Re: libstdc++ as bytecode, and compiling C++ to C)
Pertti Kellomäki schrieb:> Chris Lattner wrote: >> Many aspects of the target compiler can leak through. > > So if one wants to use the LLVM system as a cross compiler, one > has to configure llvm-gcc as a cross compiler? Fair enough, I guess.I hope the C backend is still meant to generate portable code though. Philipp
Reid Spencer
2006-Nov-23 19:16 UTC
[LLVMdev] Byte code portability (was Re: libstdc++ as bytecode, and compiling C++ to C)
On Thu, 2006-11-23 at 19:10 +0100, Philipp Klaus Krause wrote:> Pertti Kellomäki schrieb: > > Chris Lattner wrote: > >> Many aspects of the target compiler can leak through. > > > > So if one wants to use the LLVM system as a cross compiler, one > > has to configure llvm-gcc as a cross compiler? Fair enough, I guess. > > I hope the C backend is still meant to generate portable code though.It generates C99. Its portability is no better or worse than any other backend. Again, it is the front end that decides how portable the outcome can be. If the front end uses non-portable constructs (sizeof, ifdef code, etc.) then the code produced won't be portable either. To get LLVM to generate portable code, you must start with a portable language. This is the goal of HLVM (http://hlvm.org/) which is no where near done yet.> > Philipp > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Philipp Klaus Krause
2006-Nov-23 20:09 UTC
[LLVMdev] Byte code portability (was Re: libstdc++ as bytecode, and compiling C++ to C)
Reid Spencer schrieb:> On Thu, 2006-11-23 at 19:10 +0100, Philipp Klaus Krause wrote: >> Pertti Kellomäki schrieb: >>> Chris Lattner wrote: >>>> Many aspects of the target compiler can leak through. >>> So if one wants to use the LLVM system as a cross compiler, one >>> has to configure llvm-gcc as a cross compiler? Fair enough, I guess. >> I hope the C backend is still meant to generate portable code though. > > It generates C99. Its portability is no better or worse than any other > backend.Does that mean that I will have to configure llvm as a cross-compiler even when using the C backend? I want to use LLVM to translate C++ into C and compile the resulting C code using sdcc. I already noticed some problems (resulting C code uses different data types than input). Philipp
Apparently Analagous Threads
- [LLVMdev] Byte code portability (was Re: libstdc++ as bytecode, and compiling C++ to C)
- [LLVMdev] Byte code portability (was Re: libstdc++ as bytecode, and compiling C++ to C)
- [LLVMdev] Byte code portability (was Re: libstdc++ as bytecode, and compiling C++ to C)
- [LLVMdev] Byte code portability (was Re: libstdc++ as bytecode, and compiling C++ to C)
- [LLVMdev] Byte code portability (was Re: libstdc++ as bytecode, and compiling C++ to C)