Skip to content

Support XC8 2.x #3

@Elemecca

Description

@Elemecca

Currently only XC8 v1.x is supported, although v2.x works with the legacy command-line driver (see last paragraph).

In v2.x Microchip switched from their proprietary HI-TECH C frontend to Clang in order to support C99. Rather than implement PIC codegen in LLVM, though, they wrote a translator from LLVM's IR to p-code (the HI-TECH IR), which is then passed through the same code generator as the old HI-TECH frontend. XC8 still includes the HI-TECH C frontend to support older projects.

Some code (M-Stack, notably) that worked under HI-TECH C does not compile in Clang. Also, the LLVM IR translation currently produces larger and less efficient code than the IR generated by HI-TECH C. Many projects have declined to upgrade until some of the kinks are worked out. We will therefore have to support both the HI-TECH C and Clang frontends for the foreseeable future.

v2.x also introduces a new compiler command-line driver, xc8-cc, which uses an option format more in line with Clang and GCC. It supports both C frontends via the -std option: -std=c99 for Clang and -std=c90 or -std=c89 for HI-TECH C. The old command-line driver xc8 is still included. We will need to support both command-line drivers, both so v1.x still works and to support projects already using the v1.x driver who want to upgrade to v2.x without changing their compiler options.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions