This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Refine recoveryAST flags in clangd
ClosedPublic

Authored by hokein on Oct 12 2020, 4:26 AM.

Details

Summary

so that we could start experiment for C.

Previously, these flags in clangd were only meaningful for C++. We need
to flip them for C, this patch repurpose these flags.

  • if true, just set it.
  • if false, just respect the value in clang.

this would allow us to keep flags on for C++, and optionally flip them on for C.

Diff Detail

Event Timeline

hokein created this revision.Oct 12 2020, 4:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 12 2020, 4:26 AM
hokein requested review of this revision.Oct 12 2020, 4:26 AM
sammccall accepted this revision.Oct 12 2020, 4:57 AM

This is fine as is, but could consider retiring the flags instead.

clang-tools-extra/clangd/ClangdServer.h
132

nit: respect to -> respect

This could just be "If true, force -frecovery-ast-type"

clang-tools-extra/clangd/Compiler.cpp
84–88

I don't have any problem with the changes to the flags, but we can also do experiments just with config now:

CompileFlags:
  Add: [-Xclang, -frecovery-ast]

in ~/.config/clangd/config.yaml

This revision is now accepted and ready to land.Oct 12 2020, 4:57 AM
hokein marked an inline comment as done.Oct 14 2020, 4:40 AM
hokein added inline comments.
clang-tools-extra/clangd/Compiler.cpp
84–88

this sounds a new idea, but it looks like our internal client doesn't fully support config (yet?).

hokein updated this revision to Diff 298116.Oct 14 2020, 4:40 AM

address comments.

This revision was landed with ongoing or failed builds.Oct 14 2020, 4:42 AM
This revision was automatically updated to reflect the committed changes.