[PATCH] D104118: [OpenCL] Use DW_LANG_OpenCL language tag for OpenCL C

Stuart Brady via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 11 08:10:29 PDT 2021


stuart updated this revision to Diff 351454.
stuart added a comment.

Add missing trailing commas to CHECK lines of FileCheck test.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104118/new/

https://reviews.llvm.org/D104118

Files:
  clang/lib/CodeGen/CGDebugInfo.cpp
  clang/test/CodeGenOpenCL/debug-info-programming-language.cl


Index: clang/test/CodeGenOpenCL/debug-info-programming-language.cl
===================================================================
--- /dev/null
+++ clang/test/CodeGenOpenCL/debug-info-programming-language.cl
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -dwarf-version=5  -emit-llvm -triple %itanium_abi_triple %s -o - \
+// RUN:   -x cl -O0 -disable-llvm-passes -debug-info-kind=limited \
+// RUN: | FileCheck --check-prefix=CHECK-DWARF5 %s
+// RUN: %clang_cc1 -dwarf-version=3  -emit-llvm -triple %itanium_abi_triple %s -o - \
+// RUN:   -x cl -O0 -disable-llvm-passes -debug-info-kind=limited \
+// RUN: | FileCheck --check-prefix=CHECK-DWARF3 %s
+
+kernel void empty() {}
+
+// CHECK-DWARF5: distinct !DICompileUnit(language: DW_LANG_OpenCL,
+// CHECK-DWARF3: distinct !DICompileUnit(language: DW_LANG_C99,
Index: clang/lib/CodeGen/CGDebugInfo.cpp
===================================================================
--- clang/lib/CodeGen/CGDebugInfo.cpp
+++ clang/lib/CodeGen/CGDebugInfo.cpp
@@ -576,6 +576,8 @@
       LangTag = llvm::dwarf::DW_LANG_C_plus_plus;
   } else if (LO.ObjC) {
     LangTag = llvm::dwarf::DW_LANG_ObjC;
+  } else if (LO.OpenCL && CGM.getCodeGenOpts().DwarfVersion >= 5) {
+    LangTag = llvm::dwarf::DW_LANG_OpenCL;
   } else if (LO.RenderScript) {
     LangTag = llvm::dwarf::DW_LANG_GOOGLE_RenderScript;
   } else if (LO.C99) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104118.351454.patch
Type: text/x-patch
Size: 1357 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210611/e2a8a7b5/attachment.bin>


More information about the cfe-commits mailing list