r220555 - [Thumb] Clang thinks "char" is signed when using a thumb triple

Oliver Stannard oliver.stannard at arm.com
Fri Oct 24 04:28:47 PDT 2014

Author: olista01
Date: Fri Oct 24 06:28:47 2014
New Revision: 220555

URL: http://llvm.org/viewvc/llvm-project?rev=220555&view=rev
[Thumb] Clang thinks "char" is signed when using a thumb triple

'char' is unsigned on all ARM and Thumb architectures. Clang gets this
right for ARM, and for thumb when using and arm triple and the -mthumb
option, but gets it wrong for thumb triples. This fixes that.


Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=220555&r1=220554&r2=220555&view=diff
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Oct 24 06:28:47 2014
@@ -459,6 +459,8 @@ static bool isSignedCharDefault(const ll
   case llvm::Triple::aarch64_be:
   case llvm::Triple::arm:
   case llvm::Triple::armeb:
+  case llvm::Triple::thumb:
+  case llvm::Triple::thumbeb:
     if (Triple.isOSDarwin() || Triple.isOSWindows())
       return true;
     return false;

Modified: cfe/trunk/test/Lexer/wchar-signedness.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/wchar-signedness.c?rev=220555&r1=220554&r2=220555&view=diff
--- cfe/trunk/test/Lexer/wchar-signedness.c (original)
+++ cfe/trunk/test/Lexer/wchar-signedness.c Fri Oct 24 06:28:47 2014
@@ -1,5 +1,6 @@
 // RUN: %clang_cc1 -fsyntax-only -dM -E %s -triple x86_64-none-linux-gnu | FileCheck %s --check-prefix=CHECK-X86
 // RUN: %clang_cc1 -fsyntax-only -dM -E %s -triple armv7-none-eabi | FileCheck %s --check-prefix=CHECK-ARM
+// RUN: %clang_cc1 -fsyntax-only -dM -E %s -triple thumbv7-none-eabi | FileCheck %s --check-prefix=CHECK-ARM
 // CHECK-X86-NOT: #define __WCHAR_UNSIGNED__
 // CHECK-X86: #define __WINT_UNSIGNED__ 1

More information about the cfe-commits mailing list