History log of /llvm-project/clang-tools-extra/clangd/SourceCode.cpp (Results 1 – 25 of 105)
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
# b1aea98c 25-Sep-2024 Jan Svoboda <jan_svoboda@apple.com>

[clang] Make deprecations of some `FileManager` APIs formal (#110014)

Some `FileManager` APIs still return `{File,Directory}Entry` instead of
the preferred `{File,Directory}EntryRef`. These are doc

[clang] Make deprecations of some `FileManager` APIs formal (#110014)

Some `FileManager` APIs still return `{File,Directory}Entry` instead of
the preferred `{File,Directory}EntryRef`. These are documented to be
deprecated, but don't have the attribute that warns on their usage. This
PR marks them as such with `LLVM_DEPRECATED()` and replaces their usage
with the recommended counterparts. NFCI.

show more ...


Revision tags: llvmorg-19.1.0, 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
# 3093d731 11-Mar-2024 Nathan Ridge <zeratul976@hotmail.com>

[clangd] Avoid libFormat's objective-c guessing heuristic where possible (#84133)

This avoids a known libFormat bug where the heuristic can OOM on certain
large files (particularly single-header li

[clangd] Avoid libFormat's objective-c guessing heuristic where possible (#84133)

This avoids a known libFormat bug where the heuristic can OOM on certain
large files (particularly single-header libraries such as miniaudio.h).

The OOM will still happen on affected files if you actually try to
format them (this is harder to avoid since the underlyting issue affects
the actual formatting logic, not just the language-guessing heuristic),
but at least it's avoided during non-modifying operations like hover,
and modifying operations that do local formatting like code completion.

Fixes https://github.com/clangd/clangd/issues/719
Fixes https://github.com/clangd/clangd/issues/1384
Fixes https://github.com/llvm/llvm-project/issues/70945

show more ...


Revision tags: 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
# 23b233c8 28-Jan-2024 Andrew Schenk <154034018+schenka0@users.noreply.github.com>

[clangd] Fix isSpelledInSource crash on invalid FileID (#76668)

This fixes the crash reported in #76667 and adds an initial unit test
for isSpelledInSource().

Note that in that issue there was s

[clangd] Fix isSpelledInSource crash on invalid FileID (#76668)

This fixes the crash reported in #76667 and adds an initial unit test
for isSpelledInSource().

Note that in that issue there was still some underlying corrupted AST,
but this at least makes isSpelledInSource() robust to it.

---------

Co-authored-by: Younan Zhang <zyn7109@gmail.com>

show more ...


Revision tags: llvmorg-19-init
# d5953e3e 14-Dec-2023 Kazu Hirata <kazu@google.com>

[clangd] Use StringRef::{starts,ends}_with (NFC)

This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::{starts,e

[clangd] Use StringRef::{starts,ends}_with (NFC)

This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::{starts,ends}_with in C++20.

I'm planning to deprecate and eventually remove
StringRef::{starts,ends}with.

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
# 16d79d26 25-Jul-2023 Fangrui Song <i@maskray.me>

[clangd] Use xxh3_64bits for background index file digests

Many sources show that xxh3 is much better than xxh64. This particular
instance may or may not have noticeable difference, but this change

[clangd] Use xxh3_64bits for background index file digests

Many sources show that xxh3 is much better than xxh64. This particular
instance may or may not have noticeable difference, but this change
moves us toward removing xxHash64.

Reviewed By: sammccall

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

show more ...


Revision tags: llvmorg-18-init
# 96e50797 13-Jul-2023 Viktoriia Bakalova <bakalova@google.com>

[clangd] Fix the range for include reference to itself.

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


# 1dee56ae 15-Jun-2023 Jan Svoboda <jan_svoboda@apple.com>

[clang] NFC: Use `DirectoryEntryRef` in `FileManager::getCanonicalName()`

This patch removes the last use of deprecated `DirectoryEntry::getName()`.

Depends on D151855.

Reviewed By: benlangmuir

D

[clang] NFC: Use `DirectoryEntryRef` in `FileManager::getCanonicalName()`

This patch removes the last use of deprecated `DirectoryEntry::getName()`.

Depends on D151855.

Reviewed By: benlangmuir

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

show more ...


Revision tags: llvmorg-16.0.6
# be8da1f6 02-Jun-2023 Haojian Wu <hokein.wu@gmail.com>

[clangd] Use FileManager for getCanonicalPath, NFC

get rid of the SourceManager dependency -- getCanonicalPath doesn't use
other SourceManager fields.


Revision tags: llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2
# ed365f46 13-Apr-2023 Utkarsh Saxena <usx@google.com>

[clangd] Use FileEntryRef for canonicalizing filepaths.

Using FileEntry for retrieving filenames give the name used for the last access. FileEntryRef gives the first access name.

Last access name i

[clangd] Use FileEntryRef for canonicalizing filepaths.

Using FileEntry for retrieving filenames give the name used for the last access. FileEntryRef gives the first access name.

Last access name is suspected to change with unrelated changes in clang or the underlying filesystem. First access name gives more stability to the name and makes it easier to track.

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

show more ...


Revision tags: llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2
# 909cd1f9 01-Feb-2023 Kadir Cetinkaya <kadircet@google.com>

[clangd] Respect preamble-patch when handling diags

Depends on D143093

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


# 55e2cd16 28-Jan-2023 Kazu Hirata <kazu@google.com>

Use llvm::count{lr}_{zero,one} (NFC)


Revision tags: llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7
# f71ffd3b 08-Jan-2023 Kazu Hirata <kazu@google.com>

[clang-tools-extra] Use std::optional instead of llvm::Optional (NFC)

This patch replaces (llvm::|)Optional< with std::optional<. I'll post
a separate patch to clean up the "using" declarations, #i

[clang-tools-extra] Use std::optional instead of llvm::Optional (NFC)

This patch replaces (llvm::|)Optional< with std::optional<. I'll post
a separate patch to clean up the "using" declarations, #include
"llvm/ADT/Optional.h", etc.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

show more ...


# 71f55735 08-Jan-2023 Kazu Hirata <kazu@google.com>

[clang-tools-extra] Add #include <optional> (NFC)

This patch adds #include <optional> to those files containing
llvm::Optional<...> or Optional<...>.

I'll post a separate patch to actually replace

[clang-tools-extra] Add #include <optional> (NFC)

This patch adds #include <optional> to those files containing
llvm::Optional<...> or Optional<...>.

I'll post a separate patch to actually replace llvm::Optional with
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

show more ...


# f7dffc28 10-Dec-2022 Kazu Hirata <kazu@google.com>

Don't include None.h (NFC)

I've converted all known uses of None to std::nullopt, so we no longer
need to include None.h.

This is part of an effort to migrate from llvm::Optional to
std::optional:

Don't include None.h (NFC)

I've converted all known uses of None to std::nullopt, so we no longer
need to include None.h.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

show more ...


# 059a23c0 03-Dec-2022 Kazu Hirata <kazu@google.com>

[clang-tools-extra] Use std::nullopt instead of None (NFC)

This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated. The intent is to reduce
the

[clang-tools-extra] Use std::nullopt instead of None (NFC)

This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated. The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

show more ...


Revision tags: llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3
# a53f8952 08-Oct-2022 Sam McCall <sam.mccall@gmail.com>

[clangd] Heuristic to avoid desync if editors are confused about newline-at-eof

As strange as it seems to our files-are-strings view of the world, some editors
that treat files as arrays of lines ca

[clangd] Heuristic to avoid desync if editors are confused about newline-at-eof

As strange as it seems to our files-are-strings view of the world, some editors
that treat files as arrays of lines can get confused about whether the last line
has a newline or not.

The consequences of failing to handle a bad incremental update are catastrophic.
If an update would be valid except for a missing newline at end of file, pretend
one exists.

This fixes problems still present in neovim where deleting all text often leads
to a desync shortly afterwards: https://github.com/neovim/neovim/issues/17085

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

show more ...


# dd46a080 07-Nov-2022 Haojian Wu <hokein.wu@gmail.com>

Move the isSelfContainedHeader function from clangd to libtooling.

We plan to reuse it in the include-cleaner library, this patch moves
this functionality from clangd to libtooling, so that this pie

Move the isSelfContainedHeader function from clangd to libtooling.

We plan to reuse it in the include-cleaner library, this patch moves
this functionality from clangd to libtooling, so that this piece of code can be
shared among all clang tools.

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

show more ...


Revision tags: working
# 0a50eafd 05-Oct-2022 Sam McCall <sam.mccall@gmail.com>

[clangd] Stop isSpelledInSource from printing source locations.

It shows up on profiles, albeit only at 0.1% or so.


Revision tags: llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3
# 0972a390 09-Aug-2022 Fangrui Song <i@maskray.me>

LLVM_FALLTHROUGH => [[fallthrough]]. NFC


Revision tags: 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
# 4d006520 26-Feb-2022 Sam McCall <sam.mccall@gmail.com>

[clangd] Clean up unused includes. NFCI

Add includes where needed to fix build.
Haven't systematically added used headers, so there is still accidental
dependency on transitive includes.


Revision tags: 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
# 622354a5 12-Jan-2022 Jan Svoboda <jan_svoboda@apple.com>

[llvm][ADT] Implement `BitVector::{pop_,}back`

LLVM Programmer’s Manual strongly discourages the use of `std::vector<bool>` and suggests `llvm::BitVector` as a possible replacement.

Currently, some

[llvm][ADT] Implement `BitVector::{pop_,}back`

LLVM Programmer’s Manual strongly discourages the use of `std::vector<bool>` and suggests `llvm::BitVector` as a possible replacement.

Currently, some users of `std::vector<bool>` cannot switch to `llvm::BitVector` because it doesn't implement the `pop_back()` and `back()` functions.

To enable easy transition of `std::vector<bool>` users, this patch implements `llvm::BitVector::pop_back()` and `llvm::BitVector::back()`.

Reviewed By: dexonsmith

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

show more ...


# b12fd138 09-Jan-2022 Kazu Hirata <kazu@google.com>

Fix bugprone argument comments.

Identified by bugprone-argument-comment.


# cd0ca5a0 26-Nov-2021 Kirill Bobyrev <kbobyrev@google.com>

[clangd] Record information about non self-contained headers in IncludeStructure

This will be useful for IncludeCleaner.

Reviewed By: sammccall

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

[clangd] Record information about non self-contained headers in IncludeStructure

This will be useful for IncludeCleaner.

Reviewed By: sammccall

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

show more ...


Revision tags: llvmorg-13.0.1-rc1
# e3c6090e 27-Oct-2021 Kirill Bobyrev <kbobyrev@google.com>

[clangd] IncludeCleaner: Support macros

Collect the macro definition locations for all the macros used in the main
file.

Reviewed By: sammccall

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

[clangd] IncludeCleaner: Support macros

Collect the macro definition locations for all the macros used in the main
file.

Reviewed By: sammccall

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

show more ...


12345