[clang] be61093 - [MSP430][Clang] Remove support for -mmcu=msp430

Anton Korobeynikov via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 28 10:47:54 PDT 2021


Author: Jozef Lawrynowicz
Date: 2021-09-28T20:47:26+03:00
New Revision: be610932fa068ed2228b0f694ae80c9294f0293f

URL: https://github.com/llvm/llvm-project/commit/be610932fa068ed2228b0f694ae80c9294f0293f
DIFF: https://github.com/llvm/llvm-project/commit/be610932fa068ed2228b0f694ae80c9294f0293f.diff

LOG: [MSP430][Clang] Remove support for -mmcu=msp430

The -mmcu= option accepts a generic MCU named "msp430", which sets the
CPU to msp430 and disables hardware multiply support.

The current purpose of accepting this value is to allow -mmcu= to be
used as an alias for -mcpu=, however there are some downsides to doing
this. -mmcu= provides additional features that will interfere
with the expected behavior if the user tries to to use it as an alias
for -mcpu=.

-mmcu=msp430 will conflict with -mhwmult=, since the "msp430" MCU is
defined to have no hardware multiply support, so the user will not be
able to set an explicit hardware multiply version.

-mmcu=msp430 will put "-Tmsp430.ld" on the linker command line, however
TI's support files do not provide a linker script with this name and so
the user would have to explicitly create it.

Differential Revision: https://reviews.llvm.org/D108299

Added: 
    

Modified: 
    clang/include/clang/Basic/MSP430Target.def
    clang/test/Driver/msp430-mmcu.c

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Basic/MSP430Target.def b/clang/include/clang/Basic/MSP430Target.def
index a1e192c192610..7a10be1d54c8d 100644
--- a/clang/include/clang/Basic/MSP430Target.def
+++ b/clang/include/clang/Basic/MSP430Target.def
@@ -238,8 +238,7 @@ MSP430_MCU_FEAT("msp430f4793", "32bit")
 MSP430_MCU_FEAT("msp430f4784", "32bit")
 MSP430_MCU_FEAT("msp430f4794", "32bit")
 
-// Generic MSUs
-MSP430_MCU("msp430")
+// Generic MCUs
 MSP430_MCU("msp430i2xxgeneric")
 
 #undef MSP430_MCU

diff  --git a/clang/test/Driver/msp430-mmcu.c b/clang/test/Driver/msp430-mmcu.c
index 42caacb97fadc..5f973a542dfc9 100644
--- a/clang/test/Driver/msp430-mmcu.c
+++ b/clang/test/Driver/msp430-mmcu.c
@@ -14,3 +14,9 @@
 // RUN:   | FileCheck -check-prefix=MSP430-UNSUP %s
 
 // MSP430-UNSUP: error: the clang compiler does not support 'not-a-mcu'
+
+// The generic MCU name "msp430" is not supported.
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430 2>&1 \
+// RUN:   | FileCheck -check-prefix=MSP430 %s
+
+// MSP430: error: the clang compiler does not support 'msp430'


        


More information about the cfe-commits mailing list