# clangd settings for the driver only.
#
# clangd takes the driver's flags from compile_commands.json, which the
# driver's Makefile has kbuild write. A kernel built with GCC (most
# distributions, and WSL) uses some flags that clang does not know, and clangd
# would stop at them. Drop those; they do not change what the code means.
CompileFlags:
  Remove:
    # arm64
    - -mabi=lp64
    # x86
    - -mno-fp-ret-in-387
    - -mpreferred-stack-boundary=*
    - -mindirect-branch=*
    - -mindirect-branch-register
    - -mindirect-branch-cs-prefix
    - -mfunction-return=*
    # any architecture
    - -fconserve-stack
    - -fno-allow-store-data-races
    - -fmin-function-alignment=*
    - -fzero-init-padding-bits=*
    - -fsanitize=bounds-strict
    - -fno-var-tracking-assignments
    - -fno-inline-functions-called-once
    - -fno-ipa-*
    - -fplugin=*
    - -fplugin-arg-*
  # GCC-only warning names.
  Add: [-Wno-unknown-warning-option]
