Page MenuHomePhabricator

[MSP430][Clang] Infer CPU type from -mcpu= or -mmcu=
Needs ReviewPublic

Authored by jozefl on Sep 2 2021, 10:33 AM.

Details

Reviewers
asl
atrosinenko
Summary

clang::driver::tools::getCPUName can now infer the CPU being used by
examining either the MCU specified with the -mmcu= option, or the CPU
directly specified with -mcpu=.

This means Clang will now pass the correct "-target-cpu" to downstream
tools, enabling CPU-specific features in LLVM.

The MSP430X CPU can now be selected, in addition to the "generic" MSP430
CPU.

Diff Detail

Event Timeline

jozefl created this revision.Sep 2 2021, 10:33 AM
jozefl requested review of this revision.Sep 2 2021, 10:33 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptSep 2 2021, 10:33 AM
jozefl updated this revision to Diff 370350.Sep 2 2021, 11:56 AM

Rebased onto current upstream.

jozefl updated this revision to Diff 370370.Sep 2 2021, 12:48 PM

Updated patch to use hasFeature() to check for msp430x support, instead of a
new function.

Fixed use of tools::getCPUName() after rebase.

jozefl updated this revision to Diff 370495.Sep 3 2021, 12:49 AM

Fix the msp430-toolchain.c test by adding some more Windows path separators to
the match patterns.

jozefl updated this revision to Diff 370507.Sep 3 2021, 2:03 AM

Rebase.

Pinging for review.

Thanks,
Jozef

jozefl updated this revision to Diff 374257.Sep 22 2021, 9:23 AM

Rebase to fix patch application failure for
clang/test/Misc/target-invalid-cpu-note.c.

jozefl updated this revision to Diff 375811.Wed, Sep 29, 1:57 AM

Rebase after updates to parent revision D108301.

jozefl updated this revision to Diff 379034.Tue, Oct 12, 7:38 AM

Rebase onto new base revision to fix pre-merge tests.

Ping.

Thanks,
Jozef