This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Enable the IDE support for the device runtime
ClosedPublic

Authored by tianshilei1992 on Apr 20 2023, 8:16 PM.

Details

Summary

Currently the device runtime is built as a custom target, which will not be included
in the compile commands. Those language servers using compile commands cannot
handle device runtime correctly.

In this patch, when CMAKE_EXPORT_COMPILE_COMMANDS is turned on, dummy
targets that will be excluded from all will be added. Those targets will not be
built or installed if we just simply do make or make install, but their
compilation will be included in the compile commands.

Diff Detail

Event Timeline

tianshilei1992 created this revision.Apr 20 2023, 8:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 20 2023, 8:16 PM
tianshilei1992 requested review of this revision.Apr 20 2023, 8:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 20 2023, 8:16 PM

Does this work properly given the OpenMP integration? I've found that my language server doesn't know how to work around the variants.

Does this work properly given the OpenMP integration? I've found that my language server doesn't know how to work around the variants.

I'm using clangd with runtime build for indexing, and it works on my side.

We should check if CMAKE_EXPORT_COMPILE_COMMANDS is on as well.

We should check if CMAKE_EXPORT_COMPILE_COMMANDS is on as well.

I'm not sure that is necessary, though this is mostly only for compile commands. I'd like it similar to LLVM_ENABLE_IDE.

jhuber6 accepted this revision.Apr 21 2023, 7:34 AM

We should check if CMAKE_EXPORT_COMPILE_COMMANDS is on as well.

I'm not sure that is necessary, though this is mostly only for compile commands. I'd like it similar to LLVM_ENABLE_IDE.

I'm not sure familiar with that option, but I guess that makes sense. I still think this is something that should probably be on by default if we have compile commands on though.

This revision is now accepted and ready to land.Apr 21 2023, 7:34 AM

We should check if CMAKE_EXPORT_COMPILE_COMMANDS is on as well.

I'm not sure that is necessary, though this is mostly only for compile commands. I'd like it similar to LLVM_ENABLE_IDE.

I'm not sure familiar with that option, but I guess that makes sense. I still think this is something that should probably be on by default if we have compile commands on though.

I can add that, say if we have that CMake option turned on, we enable this, or LIBOMPTARGET_DEVICE_RTL_IDE_SUPPORT is on.

enable it when CMAKE_EXPORT_COMPILE_COMMANDS is on as well

remove custom variable

tianshilei1992 edited the summary of this revision. (Show Details)Apr 21 2023, 10:38 AM
jhuber6 accepted this revision.Apr 21 2023, 10:51 AM