Skip to content

Commit

Permalink
Add Microsoft mangling for _Float16
Browse files Browse the repository at this point in the history
Enables _Float16 on Windows by creating a mangling
mechanism in MicrosoftMangle.  It accomplishes this by 
mangling as a structure type of __clang::_Float16, similar
to how Complex works.

Patch By: mibintc
Differential Revision: https://reviews.llvm.org/D45738

llvm-svn: 330225
  • Loading branch information
Erich Keane committed Apr 17, 2018
1 parent 480b7bc commit 5da1e69
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions clang/lib/AST/MicrosoftMangle.cpp
Expand Up @@ -1919,6 +1919,9 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T, Qualifiers,
break;

case BuiltinType::Float16:
mangleArtificalTagType(TTK_Struct, "_Float16", {"__clang"});
break;

case BuiltinType::Float128:
case BuiltinType::Half: {
DiagnosticsEngine &Diags = Context.getDiags();
Expand Down
4 changes: 4 additions & 0 deletions clang/test/CodeGenCXX/mangle-ms.cpp
Expand Up @@ -466,6 +466,10 @@ namespace Complex {
// CHECK-DAG: define dso_local void @"?f@Complex@@YAXU?$_Complex@H@__clang@@@Z"(
void f(_Complex int) {}
}
namespace Float16 {
// CHECK-DAG: define dso_local void @"?f@Float16@@YAXU_Float16@__clang@@@Z"(
void f(_Float16) {}
}

namespace PR26029 {
template <class>
Expand Down

0 comments on commit 5da1e69

Please sign in to comment.