12 Commits

Author SHA1 Message Date
Nathan Ridge
1b0a0c7382
[clangd] Store documentation when indexing standard library (#133681)
Fixes https://github.com/clangd/clangd/issues/2344
2025-05-05 03:13:25 -04:00
Jan Svoboda
7a370748c0
[clang][lex] Store non-owning options ref in HeaderSearch (#132780)
This makes it so that `CompilerInvocation` can be the only entity that
manages ownership of `HeaderSearchOptions`, making it possible to
implement copy-on-write semantics.
2025-03-25 12:14:06 -07:00
Kazu Hirata
d5953e3e30 [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.
2023-12-13 23:26:09 -08:00
Haojian Wu
c812ab7312 [include-mapping] Add C-compatibility symbol entries.
Extending the python generator:
- to generate C-compatibility symbols
- to generate macros

Differential Revision: https://reviews.llvm.org/D143214
2023-02-09 15:34:41 +01:00
Kazu Hirata
649ef3386b [clang-tools-extra] Use std::nullopt instead of llvm::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
2022-12-05 21:49:31 -08:00
Sam McCall
03ea140b3a Reland(3) "[clangd] Indexing of standard library"
Tracked down the crash, which was argument-evaluation-order UB
in the wrapping indexStandardLibrary().
Sorry for the churn!

This reverts commit 77533ea443aca6e9978d7c8a6822420f8345f6af.
2022-05-19 08:13:23 +02:00
Sam McCall
77533ea443 Revert "Reland(2) "[clangd] Indexing of standard library""
This reverts commit ca875539f788c8063e243ce9ceb877a0d2ad9115.
2022-05-18 17:38:45 +02:00
Sam McCall
ca875539f7 Reland(2) "[clangd] Indexing of standard library"
This reverts commit 6aabf60f2fb7589430c0ecc8fe95913c973fa248.
2022-05-18 15:30:37 +02:00
Sam McCall
6aabf60f2f Revert "Reland "[clangd] Indexing of standard library""
This reverts commit ccdb56ac10eef3048135169a67d239328c2b1de6.

Still seeing windows failures on GN bots: http://45.33.8.238/win/58316/step_9.txt

Unfortunately I can't debug these at all - it's a bare unsymbolized
stacktrace, and I can't reproduce the failure.
2022-05-17 21:33:48 +02:00
Sam McCall
ccdb56ac10 Reland "[clangd] Indexing of standard library"
This reverts commit 76ddbb1ca747366417be64fdf79218df099a5973.
2022-05-17 21:02:23 +02:00
Sam McCall
76ddbb1ca7 Revert "[clangd] Indexing of standard library"
This reverts commit ecaa4d9662c9a6ac013ac40a8ad72a2c75e3fd3b.
2022-05-17 17:17:27 +02:00
Sam McCall
ecaa4d9662 [clangd] Indexing of standard library
This provides a nice "warm start" with all headers indexed, not just
those included so far.

The standard library is indexed after a preamble is parsed, using that
file's configuration. The result is pushed into the dynamic index.
If we later see a higher language version, we reindex it.

It's configurable as Index.StandardLibrary, off by default for now.

Based on D105177 by @kuhnel

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

Differential Revision: https://reviews.llvm.org/D115232
2022-05-17 16:50:41 +02:00