[PATCH] D108301: [MSP430][Clang] Update hard-coded MCU data

Jozef Lawrynowicz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 18 07:24:45 PDT 2021


jozefl created this revision.
jozefl added a reviewer: asl.
jozefl requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This patch updates MSP430 MCU data to the latest version distributed by
TI, adding support for 451 additional MCUs.

The hardware multiply version supported by each MCU is now stored as an
enum in the MCU data file, rather than a string. The string value passed
to the -mhwmult= option is now also converted to an enum. Using an enum
simplifies the processing of values, as invalid user input can be
canonicalized as a descriptive enum. It also ensures that the hard-coded
MCU data is valid; that there are no values that the parser does not
recognize.

Clang will no longer explicitly disable hwmult features for MCUs that
don't have hardware multiply support, as hwmult feature are already
disabled by default.

The CPU version of each MCU is now stored with the hard-coded MCU data,
so Clang can enable the appropriate LLVM CPU features when a particular
MCU is selected.

The hard-coded MCU data is stored in lexicographic order, which enables
efficient searching of the data with binary search, using
std::lower_bound.

If the patch is acceptable, I would appreciate it if someone would apply
it for me, as I do not have commit access.

Thanks,
Jozef


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108301

Files:
  clang/include/clang/Basic/MSP430Target.def
  clang/lib/Driver/ToolChains/MSP430.cpp
  clang/test/Driver/msp430-hwmult.c
  clang/test/Driver/msp430-mmcu.c
  clang/test/Driver/msp430-toolchain.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108301.367203.patch
Type: text/x-patch
Size: 54706 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210818/ed296598/attachment-0001.bin>


More information about the cfe-commits mailing list