History log of /llvm-project/clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp (Results 1 – 25 of 39)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0
# b8d6885f 06-Sep-2024 Daniil Fukalov <dfukalov@gmail.com>

[NFC] Add explicit #include llvm-config.h where its macros are used, clang part. (#107301)

(this is clang related part)

Without these explicit includes, removing other headers, who implicitly
in

[NFC] Add explicit #include llvm-config.h where its macros are used, clang part. (#107301)

(this is clang related part)

Without these explicit includes, removing other headers, who implicitly
include llvm-config.h, may have non-trivial side effects. For example,
`clagd` may report even `llvm-config.h` as "no used" in case it defines
a macro, that is explicitly used with #ifdef. It is actually amplified
with different build configs which use different set of macros.

show more ...


Revision tags: llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init
# f489fb3d 12-Jan-2024 Kon <kinsei0916@gmail.com>

[clangd] Fix sysroot flag handling in CommandMangler to prevent duplicates (#75694)

CommandMangler should guess the sysroot path of the host system and add
that through `-isysroot` flag only when t

[clangd] Fix sysroot flag handling in CommandMangler to prevent duplicates (#75694)

CommandMangler should guess the sysroot path of the host system and add
that through `-isysroot` flag only when there is no `--sysroot` or
`-isysroot` flag in the original compile command to avoid duplicate
sysroot.

Previously, CommandMangler appropriately avoided adding a guessed
sysroot flag if the original command had an argument in the form of
`--sysroot=<sysroot>`, `--sysroot <sysroot>`, or `-isysroot <sysroot>`.
However, when presented as `-isysroot<sysroot>` (without spaces after
`-isysroot`), CommandMangler mistakenly appended the guessed sysroot
flag, resulting in duplicated sysroot in the final command.

This commit fixes it, ensuring the final command has no duplicate
sysroot flags. Also adds unit tests for this fix.

show more ...


# 73cf4851 19-Dec-2023 Dmitry Polukhin <34227995+dmpolukhin@users.noreply.github.com>

[clangd] Expand response files before CDB interpolation (#75753)

Summary:

After https://reviews.llvm.org/D143436 response files stopped working
with CDB interpolation. It has happened because in

[clangd] Expand response files before CDB interpolation (#75753)

Summary:

After https://reviews.llvm.org/D143436 response files stopped working
with CDB interpolation. It has happened because interpolation removes
all unknown flags and extra input files. Response file is treated as an
extra input because it is not a flag. Moreover inference needs full
command line for driver mode and file type detection so all response
files have to be expanded for correct inference.

This patch partially reverts D143436 and add additional response file
expansion in OverlayCDB for CDBs pushed via LSP.

Test Plan: check-clangd

Tasks: https://github.com/llvm/llvm-project/issues/69690

show more ...


Revision tags: llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3
# d60d3455 16-Feb-2023 Dmitry Polukhin <dmitry.polukhin@gmail.com>

[clangd] Move standard options adaptor to CommandMangler

There is a discrepancy between how clangd processes CDB loaded from
JSON file on disk and pushed via LSP. Thus the same CDB pushed via
LSP pr

[clangd] Move standard options adaptor to CommandMangler

There is a discrepancy between how clangd processes CDB loaded from
JSON file on disk and pushed via LSP. Thus the same CDB pushed via
LSP protocol may not work as expected. Some difference between these two
paths is expected but we still need to insert driver mode and target from
binary name and expand response files.

Test Plan: check-clang-tools

Differential Revision: https://reviews.llvm.org/D143436

show more ...


# 2a84c53c 13-Mar-2023 Dmitry Polukhin <dmitry.polukhin@gmail.com>

Revert "[clangd] Move standard options adaptor to CommandMangler"

This reverts commit 34de7da6246cdfa6ff6f3d3c514583cddc0a10ec.


# 34de7da6 16-Feb-2023 Dmitry Polukhin <dmitry.polukhin@gmail.com>

[clangd] Move standard options adaptor to CommandMangler

There is a discrepancy between how clangd processes CDB loaded from
JSON file on disk and pushed via LSP. Thus the same CDB pushed via
LSP pr

[clangd] Move standard options adaptor to CommandMangler

There is a discrepancy between how clangd processes CDB loaded from
JSON file on disk and pushed via LSP. Thus the same CDB pushed via
LSP protocol may not work as expected. Some difference between these two
paths is expected but we still need to insert driver mode and target from
binary name and expand response files.

Test Plan: check-clang-tools

Differential Revision: https://reviews.llvm.org/D143436

show more ...


Revision tags: llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7
# 984b800a 09-Jan-2023 serge-sans-paille <sguelton@mozilla.com>

Move from llvm::makeArrayRef to ArrayRef deduction guides - last part

This is a follow-up to https://reviews.llvm.org/D140896, split into
several parts as it touches a lot of files.

Differential Re

Move from llvm::makeArrayRef to ArrayRef deduction guides - last part

This is a follow-up to https://reviews.llvm.org/D140896, split into
several parts as it touches a lot of files.

Differential Revision: https://reviews.llvm.org/D141298

show more ...


Revision tags: llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2
# afa22c56 25-Sep-2022 Nathan Ridge <zeratul976@hotmail.com>

[clangd] Pass the entire tooling::CompileCommand to CommandMangler

This gives CommandMangler access to other fields of
tooling::CompileCommand as well, e.g. Directory.

Differential Revision: https:

[clangd] Pass the entire tooling::CompileCommand to CommandMangler

This gives CommandMangler access to other fields of
tooling::CompileCommand as well, e.g. Directory.

Differential Revision: https://reviews.llvm.org/D133756

show more ...


Revision tags: llvmorg-15.0.1
# 23ace26e 15-Sep-2022 Kadir Cetinkaya <kadircet@google.com>

[clang(d)] Include/Exclude CLDXC options properly

This handles the new CLDXC options that was introduced in
https://reviews.llvm.org/D128462 inside clang-tooling to make sure cl driver
mode is not b

[clang(d)] Include/Exclude CLDXC options properly

This handles the new CLDXC options that was introduced in
https://reviews.llvm.org/D128462 inside clang-tooling to make sure cl driver
mode is not broken.

Fixes https://github.com/clangd/clangd/issues/1292.

Differential Revision: https://reviews.llvm.org/D133962

show more ...


Revision tags: llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init
# 8edfc2f8 01-Feb-2022 Christian Kühnel <kuhnel@google.com>

[clangd] Cleanup of readability-identifier-naming

Auto-generated patch based on clang-tidy readability-identifier-naming.
Only some manual cleanup for `extern "C"` declarations and a GTest change wa

[clangd] Cleanup of readability-identifier-naming

Auto-generated patch based on clang-tidy readability-identifier-naming.
Only some manual cleanup for `extern "C"` declarations and a GTest change was required.

I'm not sure if this cleanup is actually very useful. It cleans up clang-tidy findings to the number of warnings from clang-tidy should be lower. Since it was easy to do and required only little cleanup I thought I'd upload it for discussion.

One pattern that keeps recurring: Test **matchers** are also supposed to start with a lowercase letter as per LLVM convention. However GTest naming convention for matchers start with upper case. I would propose to keep stay consistent with the GTest convention there. However that would imply a lot of `//NOLINT` throughout these files.

To re-product this patch run:
```
run-clang-tidy -checks="-*,readability-identifier-naming" -fix -format ./clang-tools-extra/clangd
```

To convert the macro names, I was using this script with some manual cleanup afterwards:
https://gist.github.com/ChristianKuehnel/a01cc4362b07c58281554ab46235a077

Differential Revision: https://reviews.llvm.org/D115634

show more ...


Revision tags: llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2
# 0683a1e5 22-Dec-2021 Sam McCall <sam.mccall@gmail.com>

[clangd] Adjust compile flags so they work when applied to other file(type)s.

It's reasonable to want to use the command from one file to compile another.
In particular, the command from a translati

[clangd] Adjust compile flags so they work when applied to other file(type)s.

It's reasonable to want to use the command from one file to compile another.
In particular, the command from a translation unit to parse a related header:
{"file": "foo.h", "command": "clang foo.cpp"}

This is largely what InterpolatingCompilationDatabase tries to do.
To do this correctly can require nontrivial changes to the argv, because the
file extension affects semantics. e.g. here we must add "-x c++header".

When external tools compile commands for different files, we should apply the
same adjustments. This is better than telling people to "fix their tools":
- simple e.g. python scripts shouldn't have to interpret clang argv
- this is a good way to represent the intent "parse header X in the context of
file Y", which can work even if X is not self-contained. clangd does not
support this today, but some other tools do, and we may one day.

This issue is discussed in https://github.com/clangd/clangd/issues/519

Differential Revision: https://reviews.llvm.org/D116167

show more ...


Revision tags: llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4
# 444a5f30 16-Sep-2021 Kadir Cetinkaya <kadircet@google.com>

[clangd] Bail-out when an empty compile flag is encountered

Fixes https://github.com/clangd/clangd/issues/865

Differential Revision: https://reviews.llvm.org/D109894


Revision tags: llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2
# 79c2616d 06-Aug-2021 Kadir Cetinkaya <kadircet@google.com>

[clangd] Canonicalize inputs provided with `--`

We already strip all the inputs provided without `--`, this patch also
handles the cases with `--`.

Differential Revision: https://reviews.llvm.org/D

[clangd] Canonicalize inputs provided with `--`

We already strip all the inputs provided without `--`, this patch also
handles the cases with `--`.

Differential Revision: https://reviews.llvm.org/D107637

show more ...


# 3bf77980 06-Aug-2021 Kadir Cetinkaya <kadircet@google.com>

[clangd] Strip mutliple arch options

This patch strips all the arch options in case of multiple ones. As it
results in multiple compiler jobs, which clangd cannot handle.

It doesn't pick any over t

[clangd] Strip mutliple arch options

This patch strips all the arch options in case of multiple ones. As it
results in multiple compiler jobs, which clangd cannot handle.

It doesn't pick any over the others as it is unclear which one the user wants
and defaulting to host architecture seems less surprising. Users also have the
ability to explicitly specify the architecture they want via clangd config
files.

Fixes https://github.com/clangd/clangd/issues/827.

Differential Revision: https://reviews.llvm.org/D107634

show more ...


Revision tags: llvmorg-13.0.0-rc1, llvmorg-14-init
# 259e365d 25-Jul-2021 Kadir Cetinkaya <kadircet@google.com>

Revert "Revert "[clangd] Adjust compile flags to contain only the requested file as input""

This reverts commit 04e21fbc44c145d5599ef8db9aaf66b159107f33.


# ab714ba0 26-Jul-2021 Kadir Cetinkaya <kadircet@google.com>

Revert "Revert "[clangd] Canonicalize compile flags before applying edits""

Set driver mode before parsing arglist.

Depends on D106789.

Differential Revision: https://reviews.llvm.org/D106794


# 0a3c7960 24-Jul-2021 Kadir Cetinkaya <kadircet@google.com>

Revert "Revert D106562 "[clangd] Get rid of arg adjusters in CommandMangler""

This reverts commit 2aa0cf19e7fe17c9eb5eb2555e10184061b933f1.
Get rid of reference to the temporary.


# 2aa0cf19 23-Jul-2021 Fangrui Song <i@maskray.me>

Revert D106562 "[clangd] Get rid of arg adjusters in CommandMangler"

This reverts commit 1c0d0085bcaaf27cc8d9492eb3c5c05058e54b8e.

This commit made unittest BuildCompilerInvocation.DropsPlugins cra

Revert D106562 "[clangd] Get rid of arg adjusters in CommandMangler"

This reverts commit 1c0d0085bcaaf27cc8d9492eb3c5c05058e54b8e.

This commit made unittest BuildCompilerInvocation.DropsPlugins crash.

show more ...


# e7590d74 23-Jul-2021 Kadir Cetinkaya <kadircet@google.com>

Revert "[clangd] Canonicalize compile flags before applying edits"

This reverts commit 7cc8a8e3849dc4044cc799e2c1f6cc241b851b70.


# 04e21fbc 23-Jul-2021 Kadir Cetinkaya <kadircet@google.com>

Revert "[clangd] Adjust compile flags to contain only the requested file as input"

This reverts commit ba5dd945ad9124f24452987be64040a6ea6cd25e.


# ba5dd945 23-Jul-2021 Kadir Cetinkaya <kadircet@google.com>

[clangd] Adjust compile flags to contain only the requested file as input

Depends on D106527.

Differential Revision: https://reviews.llvm.org/D106639


# 7cc8a8e3 22-Jul-2021 Kadir Cetinkaya <kadircet@google.com>

[clangd] Canonicalize compile flags before applying edits

Pushes input for the compile action to the end while separating with a
`--` before applying other manglings. This ensures edits that effect

[clangd] Canonicalize compile flags before applying edits

Pushes input for the compile action to the end while separating with a
`--` before applying other manglings. This ensures edits that effect only the
arguments that come after them works, like changing parse language via -x.

Fixes https://github.com/clangd/clangd/issues/555.

Differential Revision: https://reviews.llvm.org/D106527

show more ...


# 1c0d0085 22-Jul-2021 Kadir Cetinkaya <kadircet@google.com>

[clangd] Get rid of arg adjusters in CommandMangler

Differential Revision: https://reviews.llvm.org/D106562


Revision tags: llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4
# b6626515 19-Mar-2021 Kadir Cetinkaya <kadircet@google.com>

[clangd] Use command line adjusters for inserting compile flags

This fixes issues with `--` in the compile flags.

Fixes https://github.com/clangd/clangd/issues/632.

Differential Revision: https://

[clangd] Use command line adjusters for inserting compile flags

This fixes issues with `--` in the compile flags.

Fixes https://github.com/clangd/clangd/issues/632.

Differential Revision: https://reviews.llvm.org/D99523

show more ...


Revision tags: llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3
# 7de711ec 31-Jan-2021 Sam McCall <sam.mccall@gmail.com>

Reland [clangd] Quote/escape argv included in log messages.

... but don't apply it where we're using hasSubstr

This reverts commit 7a8008d0e8885d22ff9a1fa7f9965c7b2ad2569a.


12