Conversation
|
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
6108868 to
6249e32
Compare
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
🐧 Linux x64 Test Results
✅ The build succeeded and all tests passed. |
5633044 to
96218ec
Compare
96218ec to
79c265d
Compare
🪟 Windows x64 Test Results
✅ The build succeeded and all tests passed. |
in call-hierarchy and type-hierarchy.
Fix code format.
cd4aecb to
007764f
Compare
Changed the usage of SymbolTag: - Abstract = pure virtual - Virtual = a virtual method implemented in that class, not implementing or overriding a method from base class - Implements = implements pure virtual method from base class - Override = overriding a virtual method implemented in base class - Final = final method
31a4fd5 to
2c0475f
Compare
…ierarchies_and_symbol_info
ffb31c3 to
fad6461
Compare
64-bit The problematic areas are: SymInfo (6 bytes) → followed by a 2-byte gap Origin (2 bytes) → followed by a 2-byte gap before StringRef Tags (4 bytes) → followed by a 4-byte gap before SmallVector Flags at the end → 7 bytes end padding 32-bit SymInfo → 2-byte gap Origin → 2-byte gap Flags at the end → 3 bytes end padding This patch reduces paddings: 64-bit: 240 -> 232 (-8 Bytes, ~3.3%) 32-bit: 144 -> 140 (-4 Bytes, ~2.8%)
Minor change on 64-bit The problematic areas are: SymInfo (6 bytes) → followed by a 2-byte gap 32-bit SymInfo → 2-byte gap current results for the patch f99012b:
This patch f99012b reduces paddings: |
Apply consistent SymbolTag filtering for indexed C++ methods Introduce `getSymbolTags(const Symbol&)` and use it for index-backed symbol paths so tag filtering is applied consistently outside AST-based code paths. - add `getSymbolTags(const Symbol&)` in `FindSymbols` and document behavior - apply method-specific tag filtering in: - workspace symbols (`FindSymbols.cpp`) - hierarchy items (`XRefs.cpp`) - simplify `filterSymbolTags` to operate on `SymbolTags` only - keep `Declaration`/`Definition` tags for virtual/override/implements cases (only remove tags that are semantically implied, e.g. `Virtual` by `Overrides`/`Implements`/`Abstract`) - update unit tests in `FindSymbolsTests.cpp` and `SymbolCollectorTests.cpp` to assert the new expected tag sets - use `getSymbolTags(...)` in tests instead of directly expanding raw bitmasks - minor cleanup in `SymbolCollector::addDeclaration` tag assignment ordering
dd4d9fc to
317abd3
Compare
Refine filterSymbolTags semantics for method-related tags Improve SymbolTag normalization in `filterSymbolTags` by making tag precedence explicit and handling redundant combinations consistently. Changes: - Introduce local bitmask constants (`Virtual`, `Overrides`, `Implements`, `Abstract`, `Final`) for readability and maintainability. - Keep precedence logic explicit: - `Implements` removes `Overrides` and `Virtual` - `Overrides` removes `Virtual` - `Abstract` removes `Virtual` - `Final` removes redundant `Virtual`/`Overrides` - Align inline comments with actual filtering behavior. This makes tag filtering easier to reason about and avoids inconsistent symbol-tag output for C++ methods.
Replace raw integer-based SymbolTags with a dedicated strong type that is tied to SymbolTag and sanitizes invalid bits. This removes a fragile coupling between SymbolTag and SymbolTags and prevents representing non-existing tags. Update clangd tag logic and serialization paths accordingly: - switch tag construction/checks to SymbolTags::fromTag()/typed operations - keep existing on-disk bit positions compatible - adapt RIFF/YAML serialization to read/write raw SymbolTags storage safely - update serialization tests to use the typed SymbolTags API This improves robustness and maintainability while preserving behavior and backward compatibility of serialized tag values.
|
@ratzdi you requested a review but you did not undo the changes we talked about? |
This reverts commit 765ef3e
timon-ul
left a comment
There was a problem hiding this comment.
Looks good to me now, @HighCommander4 please have a look next :)
This PR is continuation of #167536.
What is new?
It adds code to compute symbol tags for the following types:
SymbolInformation
WorkspaceSymbol
CallHierarchyItem
TypeHierarchyItem
Calculation of the symbol tags
OverridesandImplementsCalculation of symbol tags during the AST creation and embedding them in
Symbol.Minor change on
struct Symbolto minimize paddings and thus reducing momory consumption.Related issues: