[llvm-branch-commits] [cfe-branch] r364487 - Merging r354633:

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jun 26 16:02:24 PDT 2019


Author: tstellar
Date: Wed Jun 26 16:02:24 2019
New Revision: 364487

URL: http://llvm.org/viewvc/llvm-project?rev=364487&view=rev
Log:
Merging r354633:

------------------------------------------------------------------------
r354633 | rsmith | 2019-02-21 15:04:35 -0800 (Thu, 21 Feb 2019) | 3 lines

Use _Q as MS ABI mangling for char8_t.

Thanks to Yuriy Solodkyy for letting us know the mangling here.
------------------------------------------------------------------------

Modified:
    cfe/branches/release_80/lib/AST/MicrosoftMangle.cpp
    cfe/branches/release_80/test/CodeGenCXX/char8_t.cpp

Modified: cfe/branches/release_80/lib/AST/MicrosoftMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_80/lib/AST/MicrosoftMangle.cpp?rev=364487&r1=364486&r2=364487&view=diff
==============================================================================
--- cfe/branches/release_80/lib/AST/MicrosoftMangle.cpp (original)
+++ cfe/branches/release_80/lib/AST/MicrosoftMangle.cpp Wed Jun 26 16:02:24 2019
@@ -1937,8 +1937,9 @@ void MicrosoftCXXNameMangler::mangleType
   //                 ::= _M # unsigned __int128
   //                 ::= _N # bool
   //                     _O # <array in parameter>
-  //                 ::= _T # __float80 (Intel)
+  //                 ::= _Q # char8_t
   //                 ::= _S # char16_t
+  //                 ::= _T # __float80 (Intel)
   //                 ::= _U # char32_t
   //                 ::= _W # wchar_t
   //                 ::= _Z # __float80 (Digital Mars)
@@ -1999,6 +2000,9 @@ void MicrosoftCXXNameMangler::mangleType
   case BuiltinType::Bool:
     Out << "_N";
     break;
+  case BuiltinType::Char8:
+    Out << "_Q";
+    break;
   case BuiltinType::Char16:
     Out << "_S";
     break;
@@ -2094,7 +2098,6 @@ void MicrosoftCXXNameMangler::mangleType
   case BuiltinType::SatUShortFract:
   case BuiltinType::SatUFract:
   case BuiltinType::SatULongFract:
-  case BuiltinType::Char8:
   case BuiltinType::Float128: {
     DiagnosticsEngine &Diags = Context.getDiags();
     unsigned DiagID = Diags.getCustomDiagID(

Modified: cfe/branches/release_80/test/CodeGenCXX/char8_t.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_80/test/CodeGenCXX/char8_t.cpp?rev=364487&r1=364486&r2=364487&view=diff
==============================================================================
--- cfe/branches/release_80/test/CodeGenCXX/char8_t.cpp (original)
+++ cfe/branches/release_80/test/CodeGenCXX/char8_t.cpp Wed Jun 26 16:02:24 2019
@@ -1,9 +1,11 @@
-// RUN: %clang_cc1 -std=c++17 -emit-llvm -fchar8_t -triple x86_64-linux %s -o - | FileCheck %s
-// RUN: %clang_cc1 -std=c++17 -emit-llvm -fchar8_t -triple x86_64-windows %s -o - -verify
+// RUN: %clang_cc1 -std=c++17 -emit-llvm -fchar8_t -triple x86_64-linux %s -o - | FileCheck %s --check-prefix=ITANIUM
+// RUN: %clang_cc1 -std=c++17 -emit-llvm -fchar8_t -triple x86_64-windows %s -o - | FileCheck %s --check-prefix=MSABI
 
-// CHECK: define void @_Z1fDu(
-void f(char8_t c) {} // expected-error {{cannot mangle this built-in char8_t type yet}}
+// ITANIUM: define void @_Z1fDu(
+// MSABI: define {{.*}}void @"?f@@YAX_Q at Z"(
+void f(char8_t c) {}
 
-// CHECK: define weak_odr void @_Z1gIiEvDTplplcvT__ELA4_KDuELDu114EE
+// ITANIUM: define weak_odr void @_Z1gIiEvDTplplcvT__ELA4_KDuELDu114EE(
+// MSABI: define weak_odr {{.*}}void @"??$g at H@@YAXPEB_Q at Z"(
 template<typename T> void g(decltype(T() + u8"foo" + u8'r')) {}
 template void g<int>(const char8_t*);




More information about the llvm-branch-commits mailing list