[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
Tue Jun 15 07:26:20 PDT 2021


stuart marked an inline comment as done.
stuart added inline comments.


================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:579
     LangTag = llvm::dwarf::DW_LANG_ObjC;
+  } else if (LO.OpenCL && CGM.getCodeGenOpts().DwarfVersion >= 5) {
+    LangTag = llvm::dwarf::DW_LANG_OpenCL;
----------------
shchenz wrote:
> stuart wrote:
> > shchenz wrote:
> > > I think for non-strict DWARF mode, we still can generate `DW_LANG_OpenCL` for the DWARF version lower than 5? Seems we also need to fix above `DW_LANG_C_plus_plus_14` and `DW_LANG_C_plus_plus_11`
> > If we have a `-gstrict-dwarf` option for this, then it would seem better to add `DW_LANG_C_plus_plus_17` and `DW_LANG_C_plus_plus_20` definitions and generate those for the `!CGM.getCodeGenOpts().DebugStrictDwarf` case. //C++ for OpenCL// would then use one of the more recent language tag values for the time being (without any special logic).
> I added a patch https://reviews.llvm.org/D104291 for `DW_LANG_C_plus_plus_14` and `DW_LANG_C_plus_plus_11`.
> I think `DW_LANG_OpenCL` should be in the same situation?
Thanks. I will wait until D104291 is accepted, and then update this change correspondingly. Yes, I believe `DW_LANG_OpenCL` is in the same situation.

Looking more closely, I notice that `DW_LANG_RenderScript` was also introduced in DWARF 5, and we don't use it (at all) in Clang, but instead use the vendor-specific `DW_LANG_GOOGLE_RenderScript` value. It should probably fall back to the vendor-specific value if the DWARF 5 value is not available, instead.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104118



More information about the cfe-commits mailing list