Author: erichkeane Date: Tue May 1 07:16:15 2018 New Revision: 331263 URL: http://llvm.org/viewvc/llvm-project?rev=331263&view=rev Log: 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 Modified: cfe/trunk/lib/AST/MicrosoftMangle.cpp cfe/trunk/test/CodeGenOpenCL/half.cl Modified: cfe/trunk/lib/AST/MicrosoftMangle.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftMangle.cpp?rev=331263&r1=331262&r2=331263&view=diff ============================================================================== --- cfe/trunk/lib/AST/MicrosoftMangle.cpp (original) +++ cfe/trunk/lib/AST/MicrosoftMangle.cpp Tue May 1 07:16:15 2018 @@ -1923,8 +1923,11 @@ void MicrosoftCXXNameMangler::mangleType 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"); Modified: cfe/trunk/test/CodeGenOpenCL/half.cl URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenOpenCL/half.cl?rev=331263&r1=331262&r2=331263&view=diff ============================================================================== --- cfe/trunk/test/CodeGenOpenCL/half.cl (original) +++ cfe/trunk/test/CodeGenOpenCL/half.cl Tue May 1 07:16:15 2018 @@ -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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits