diff options
author | Erich Keane <erich.keane@intel.com> | 2018-05-01 14:16:15 +0000 |
---|---|---|
committer | Erich Keane <erich.keane@intel.com> | 2018-05-01 14:16:15 +0000 |
commit | 14c1085317cf5f44c773908535fe2220839b6e4f (patch) | |
tree | c20cfb23e5d68c366ebacfb1c9155a9263eebdfb | |
parent | f6b81dae9e9cf5db81eb018069569892e179cdbd (diff) | |
download | bcm5719-llvm-14c1085317cf5f44c773908535fe2220839b6e4f.tar.gz bcm5719-llvm-14c1085317cf5f44c773908535fe2220839b6e4f.zip |
Add Microsoft Mangling for OpenCL Half Type
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
llvm-svn: 331263
-rw-r--r-- | clang/lib/AST/MicrosoftMangle.cpp | 7 | ||||
-rw-r--r-- | clang/test/CodeGenOpenCL/half.cl | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp index e72804b2c3b..f39c1a8e38f 100644 --- a/clang/lib/AST/MicrosoftMangle.cpp +++ b/clang/lib/AST/MicrosoftMangle.cpp @@ -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"); diff --git a/clang/test/CodeGenOpenCL/half.cl b/clang/test/CodeGenOpenCL/half.cl index a10ba4d7f9e..eae8cdcb03e 100644 --- a/clang/test/CodeGenOpenCL/half.cl +++ b/clang/test/CodeGenOpenCL/half.cl @@ -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 |