MS ABI: Mangle char16_t and char32_t types

These mangling make clang more compatible with MSVC 2015.
Correctly mangling char16_t and char32_t will take a little more work.

llvm-svn: 222515
This commit is contained in:
David Majnemer 2014-11-21 09:06:49 +00:00
parent a77ccfec24
commit eca5a201f4
2 changed files with 8 additions and 2 deletions

View File

@ -1485,6 +1485,8 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T,
case BuiltinType::Int128: Out << "_L"; break;
case BuiltinType::UInt128: Out << "_M"; break;
case BuiltinType::Bool: Out << "_N"; break;
case BuiltinType::Char16: Out << "_S"; break;
case BuiltinType::Char32: Out << "_U"; break;
case BuiltinType::WChar_S:
case BuiltinType::WChar_U: Out << "_W"; break;
@ -1510,8 +1512,6 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T,
case BuiltinType::NullPtr: Out << "$$T"; break;
case BuiltinType::Char16:
case BuiltinType::Char32:
case BuiltinType::Half: {
DiagnosticsEngine &Diags = Context.getDiags();
unsigned DiagID = Diags.getCustomDiagID(DiagnosticsEngine::Error,

View File

@ -56,6 +56,12 @@ S<L> l;
// CHECK: "\01?DeducedType@@3HA"
auto DeducedType = 30;
// CHECK-DAG: @"\01?Char16Var@@3_SA"
char16_t Char16Var;
// CHECK-DAG: @"\01?Char32Var@@3_UA"
char32_t Char32Var;
// CHECK: "\01?LRef@@YAXAAH@Z"
void LRef(int& a) { }