[PATCH] D14384: [ARM] Clang gives unintended warning message for 'mthumb' + M-profiles

Alexandros Lamprineas via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 5 08:57:30 PST 2015


labrinea created this revision.
labrinea added reviewers: cfe-commits, rengolin.
Herald added subscribers: rengolin, aemerson.

```
$ clang --target=armv7m-none-eabi -mthumb -march=armv7-m -c test.c
clang-3.8: warning: argument unused during compilation: '-mthumb'
```

http://reviews.llvm.org/D14384

Files:
  lib/Driver/ToolChain.cpp

Index: lib/Driver/ToolChain.cpp
===================================================================
--- lib/Driver/ToolChain.cpp
+++ lib/Driver/ToolChain.cpp
@@ -481,9 +481,8 @@
       ArchName = "arm";
 
     // Assembly files should start in ARM mode, unless arch is M-profile.
-    if (IsMProfile || (InputType != types::TY_PP_Asm &&
-         Args.hasFlag(options::OPT_mthumb, options::OPT_mno_thumb, ThumbDefault)))
-    {
+    if ((InputType != types::TY_PP_Asm && Args.hasFlag(options::OPT_mthumb,
+         options::OPT_mno_thumb, ThumbDefault)) || IsMProfile) {
       if (IsBigEndian)
         ArchName = "thumbeb";
       else


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14384.39370.patch
Type: text/x-patch
Size: 638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151105/1c640662/attachment.bin>


More information about the cfe-commits mailing list