Skip to content
This repository was archived by the owner on Sep 2, 2018. It is now read-only.
This repository was archived by the owner on Sep 2, 2018. It is now read-only.

Process #define's for all MCUs #6

Open
@dylanmckay

Description

@dylanmckay

in lib/Basic/Targets.cpp inside class AVRTargetInfo, we currently handle a few different MCUs and set the processor defines appropriately.

if (CPU == "atmega328") {
    Builder.defineMacro("__AVR_ATmega328__");
} else if (CPU == "atmega328p") {
    Builder.defineMacro("__AVR_ATmega328P__");
} else if (CPU == "atmega168") {
    Builder.defineMacro("__AVR_ATmega168__");
} else if (CPU == "atmega168p") {
...

This should be rewritten as a StringSwitch, and the entire set of supported CPUs should be added, Ideally, a warning would also be emitted along the lines of "unknown MCU" if we don't recognise this.

A goal might be to allow MCUs to be specified inside a TableGen file - perhaps AVRMCUs.def, and have all information in one centralized place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions