Trip Volpe
2010-Aug-03 06:36 UTC
[LLVMdev] Creating a backend target -- must I modify include/llvm/ADT/Triple.h ?
I'm having a go at writing an LLVM backend for the WDC 65816. The documentation page on writing an LLVM backend<http://llvm.org/docs/WritingAnLLVMBackend.html>gives this example of target registration: extern "C" void LLVMInitializeSparcTargetInfo() { RegisterTarget<Triple::sparc, /*HasJIT=*/false> X(TheSparcTarget, "sparc", "Sparc"); } The part I'm wondering about is Triple::sparc. If I'm writing a target for a different architecture, is it necessary for that architecture to have an entry in Triple's ArchType enumeration? The documentation doesn't seem to mention anything about adding members to the enumeration; is it an optional step? Making lots of small changes outside the specific source tree for the 65816 backend is something I'd prefer to avoid just at the moment, especially since it looks like I'd have to add a fair bit to Triple.cpp as well. :-) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100802/c42fff22/attachment.html>
Liu
2010-Aug-03 07:18 UTC
[LLVMdev] Creating a backend target -- must I modify include/llvm/ADT/Triple.h ?
Hi Trip Volpe, Maybe you can read PIC16 or MSP430 backend, and ask the authors. 2010/8/3 Trip Volpe <mraccident at gmail.com>> I'm having a go at writing an LLVM backend for the WDC 65816. The > documentation page on writing an LLVM backend<http://llvm.org/docs/WritingAnLLVMBackend.html>gives this example of target registration: > > extern "C" void LLVMInitializeSparcTargetInfo() { > RegisterTarget<Triple::sparc, /*HasJIT=*/false> > X(TheSparcTarget, "sparc", "Sparc"); > } > > The part I'm wondering about is Triple::sparc. If I'm writing a target for > a different architecture, is it necessary for that architecture to have an > entry in Triple's ArchType enumeration? The documentation doesn't seem to > mention anything about adding members to the enumeration; is it an optional > step? Making lots of small changes outside the specific source tree for the > 65816 backend is something I'd prefer to avoid just at the moment, > especially since it looks like I'd have to add a fair bit to Triple.cpp as > well. :-) > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100803/0042a26a/attachment.html>
Anton Korobeynikov
2010-Aug-03 07:52 UTC
[LLVMdev] Creating a backend target -- must I modify include/llvm/ADT/Triple.h ?
Hello> The part I'm wondering about is Triple::sparc. If I'm writing a target for a > different architecture, is it necessary for that architecture to have an > entry in Triple's ArchType enumeration?Generally speaking, yes.> The documentation doesn't seem to > mention anything about adding members to the enumeration; is it an optional > step?No. Also note that the document in question can be outdated. PS: You might want to check existing msp430 & pic16 backends as an example. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University