This is an archive of the discontinued LLVM Phabricator instance.

[docs] Clarify & update JSONCompilationDatabase docs
ClosedPublic

Authored by sammccall on Jan 16 2022, 7:00 AM.

Details

Summary
  • prefer arguments over command, and add example
  • clarify that there's no shell-unescaping of arguments

Fixes https://github.com/llvm/llvm-project/issues/53143

Diff Detail

Event Timeline

sammccall requested review of this revision.Jan 16 2022, 7:00 AM
sammccall created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 16 2022, 7:00 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
sammccall added inline comments.Jan 16 2022, 7:03 AM
clang/docs/JSONCompilationDatabase.rst
95

Hopefully I'm not too far out on a limb here.

Today, command is generated by CMake & others. The shell unescaping performed is underspecified and platform-specific (#if _WIN32 ... #else). There are non-llvm consumers of this format (e.g. vscode-cpptools).

I think we're in danger of interop problems and gently encouraging migration to arguments reduces the danger.

hokein accepted this revision.Jan 17 2022, 12:34 AM
hokein added inline comments.
clang/docs/JSONCompilationDatabase.rst
95

yeah, the arguments was added 7 years ago, and most of tools are still generating command...

This revision is now accepted and ready to land.Jan 17 2022, 12:34 AM
This revision was landed with ongoing or failed builds.Jan 17 2022, 12:52 AM
This revision was automatically updated to reflect the committed changes.