I think the C backend also allow people performing source-to-source transform with LLVM (instead of Clang). ether On Tue, Aug 28, 2012 at 10:30 AM, Philipp Klaus Krause <pkk at spth.de> wrote:> Will this allow users to compile C++ (or some other language that LLVM > has a frontend for) to C, which then can be compiled using a C compiler > for a target architecture, for which only a C compiler exists? > Which use-cases do you have in mind for this backend? > > Philipp > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
On 8/27/2012 9:57 PM, Hongbin Zheng wrote:> I think the C backend also allow people performing source-to-source > transform with LLVM (instead of Clang).I do not believe that this would be the case nor that it should be a goal. Source-to-source transformation requires a lot of accurate information about the AST, and conversion to LLVM IR is way too lossy. Signedness, for example, is lost at IR generation, as is any pretense of machine independence. -- Joshua Cranmer News submodule owner DXR coauthor
On 28.08.2012 14:08, Joshua Cranmer wrote:> On 8/27/2012 9:57 PM, Hongbin Zheng wrote: >> I think the C backend also allow people performing source-to-source >> transform with LLVM (instead of Clang). > > I do not believe that this would be the case nor that it should be a > goal. Source-to-source transformation requires a lot of accurate > information about the AST, and conversion to LLVM IR is way too lossy. > Signedness, for example, is lost at IR generation, as is any pretense of > machine independence. >Why is it not possible to have the C backend emit machine-independent code (i.e. C code that does not rely on implementation-defined behaviour)? Philipp