]> granicus.if.org Git - clang/commitdiff
Add Microsoft Mangling for OpenCL Half Type
authorErich Keane <erich.keane@intel.com>
Tue, 1 May 2018 14:16:15 +0000 (14:16 +0000)
committerErich Keane <erich.keane@intel.com>
Tue, 1 May 2018 14:16:15 +0000 (14:16 +0000)
Half-type mangling is accomplished following the method introduced by Erich
Keane for mangling _Float16. Updated the half.cl LIT test to cover this
particular case.

Patch By: vbridgers

Differential Revision: https://reviews.llvm.org/D46131

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331263 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/MicrosoftMangle.cpp
test/CodeGenOpenCL/half.cl

index e72804b2c3bed5429866e262fa000c0ae0ca9854..f39c1a8e38f2d866c77b035335c13e268b7dbefe 100644 (file)
@@ -1923,8 +1923,11 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T, Qualifiers,
     mangleArtificalTagType(TTK_Struct, "_Float16", {"__clang"});
     break;
 
-  case BuiltinType::Float128:
-  case BuiltinType::Half: {
+  case BuiltinType::Half:
+    mangleArtificalTagType(TTK_Struct, "_Half", {"__clang"});
+    break;
+
+  case BuiltinType::Float128: {
     DiagnosticsEngine &Diags = Context.getDiags();
     unsigned DiagID = Diags.getCustomDiagID(
         DiagnosticsEngine::Error, "cannot mangle this built-in %0 type yet");
index a10ba4d7f9e90dceff08d0ab99c44343fc5c6cf1..eae8cdcb03ec3b9cd896060732ba2a9ef20da068 100644 (file)
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 %s -emit-llvm -o - -triple spir-unknown-unknown | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -o - -triple x86_64-pc-win32 | FileCheck %s
 
 #pragma OPENCL EXTENSION cl_khr_fp16 : enable