[LLVMdev] Creating a backend target -- must I modify include/llvm/ADT/Triple.h ?

Trip Volpe mraccident at gmail.com
Mon Aug 2 23:36:23 PDT 2010


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>


More information about the llvm-dev mailing list