[clang-tools-extra] Follow style configuration in clangd when inserting missing includes (PR #140594)

2025-05-27 Thread kadir çetinkaya via cfe-commits
@@ -151,6 +164,11 @@ std::vector generateMissingIncludeDiagnostics( if (!Replacement.has_value()) continue; +if (Angled && Spelling.front() == '\"') { kadircet wrote: yikes, we also need to do this transformation in the other way as well :/ Mig

[clang-tools-extra] Follow style configuration in clangd when inserting missing includes (PR #140594)

2025-05-27 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet edited https://github.com/llvm/llvm-project/pull/140594 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Follow style configuration in clangd when inserting missing includes (PR #140594)

2025-05-27 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet edited https://github.com/llvm/llvm-project/pull/140594 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Follow style configuration in clangd when inserting missing includes (PR #140594)

2025-05-27 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. thanks, mostly LGTM, please wait on a final look from @HighCommander4 though, he has more context about this feature overall, maybe the discrepancy on path vs spelling based match has a story. https://github.com/llvm/llvm-project/pull/140

[clang-tools-extra] [clang-tidy] Fix formatting and add release notes entry (PR #141584)

2025-05-27 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet closed https://github.com/llvm/llvm-project/pull/141584 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Fix formatting and add release notes entry (PR #141584)

2025-05-27 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. https://github.com/llvm/llvm-project/pull/141584 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix tests of lookup table generator (PR #139463)

2025-05-27 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet closed https://github.com/llvm/llvm-project/pull/139463 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] readability-redundant-smartptr-get: disable for smart pointers to arrays (PR #141092)

2025-05-27 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet closed https://github.com/llvm/llvm-project/pull/141092 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] readability-redundant-smartptr-get: disable for smart pointers to arrays (PR #141092)

2025-05-27 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. thanks a lot! https://github.com/llvm/llvm-project/pull/141092 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Follow style configuration in clangd when inserting missing includes (PR #140594)

2025-05-26 Thread kadir çetinkaya via cfe-commits
@@ -141,16 +143,41 @@ std::vector generateMissingIncludeDiagnostics( AST.getPreprocessor().getHeaderSearchInfo(), MainFile}); llvm::StringRef HeaderRef{Spelling}; -bool Angled = HeaderRef.starts_with("<"); + +bool IsAngled = false; kadirce

[clang-tools-extra] Follow style configuration in clangd when inserting missing includes (PR #140594)

2025-05-26 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet requested changes to this pull request. https://github.com/llvm/llvm-project/pull/140594 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add resource_dir_EQ flag to CC1Option group (PR #140870)

2025-05-26 Thread kadir çetinkaya via cfe-commits
kadircet wrote: LGTM, but cc @llvm/clang-area-team, in case they have any concerns here https://github.com/llvm/llvm-project/pull/140870 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix tests of lookup table generator (PR #139463)

2025-05-26 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. https://github.com/llvm/llvm-project/pull/139463 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] readability-redundant-smartptr-get: disable for smart pointers to arrays (PR #141092)

2025-05-26 Thread kadir çetinkaya via cfe-commits
@@ -43,10 +43,18 @@ internal::Matcher callToGet(const internal::Matcher &OnClass) { .bind("redundant_get"); } -internal::Matcher knownSmartptr() { +internal::Matcher knownSmartptrAny() { return recordDecl(hasAnyName("::std::unique_ptr", "::std::shared_ptr")); } +i

[clang-tools-extra] [clang-tidy] readability-redundant-smartptr-get: disable for smart pointers to arrays (PR #141092)

2025-05-26 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. https://github.com/llvm/llvm-project/pull/141092 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [NFC][clangd][test] add clang-tidy config to ensure test cases sandbox (PR #141410)

2025-05-26 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. https://github.com/llvm/llvm-project/pull/141410 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ClangTool] Use CC1Option flag resource-dir in injectResourceDir (PR #140870)

2025-05-26 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet requested changes to this pull request. do we know why https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Driver/Options.td#L5894-L5901 doesn't declare _EQ version for cc1? i think instead of working around this in various places, we should unify the

[clang-tools-extra] [NFC][clangd][test] add clang-tidy config to ensure test cases sandbox (PR #141410)

2025-05-26 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet requested changes to this pull request. https://github.com/llvm/llvm-project/pull/141410 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [NFC][clangd][test] add clang-tidy config to ensure test cases sandbox (PR #141410)

2025-05-26 Thread kadir çetinkaya via cfe-commits
@@ -32,6 +32,9 @@ # RUN: echo 'printf "End of search list.\r\n" >&2' >> %t.dir/bin/my_driver.sh # RUN: chmod +x %t.dir/bin/my_driver.sh +# Create fake clang-tidy config to ensure sandbox +# RUN: echo 'InheritParentConfig: false' >> %t.dir/.clang-tidy kadircet

[clang-tools-extra] [NFC][clangd][test] add clang-tidy config to ensure test cases sandbox (PR #141410)

2025-05-26 Thread kadir çetinkaya via cfe-commits
@@ -0,0 +1 @@ +InheritParentConfig: false kadircet wrote: are we running any tests in this directory? these inputs are usually copied to temp test directories, since you're not copying this over in any of the tests, is this really needed? (or do we have some te

[clang-tools-extra] [clang-tidy] readability-redundant-smartptr-get: disable for smart pointers to arrays (PR #141092)

2025-05-23 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet edited https://github.com/llvm/llvm-project/pull/141092 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] readability-redundant-smartptr-get: disable for smart pointers to arrays (PR #141092)

2025-05-23 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet requested changes to this pull request. thanks a lot for taking a lookg here! https://github.com/llvm/llvm-project/pull/141092 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang-tools-extra] [clang-tidy] readability-redundant-smartptr-get: disable for smart pointers to arrays (PR #141092)

2025-05-23 Thread kadir çetinkaya via cfe-commits
@@ -44,7 +44,10 @@ internal::Matcher callToGet(const internal::Matcher &OnClass) { } internal::Matcher knownSmartptr() { - return recordDecl(hasAnyName("::std::unique_ptr", "::std::shared_ptr")); + return recordDecl( + hasAnyName("::std::unique_ptr", "::std::shared_ptr

[clang-tools-extra] [clang-tools-extra] Add include mappings for (PR #141216)

2025-05-23 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet closed https://github.com/llvm/llvm-project/pull/141216 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tools-extra] Add include mappings for (PR #141216)

2025-05-23 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. https://github.com/llvm/llvm-project/pull/141216 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Don't run use-nullptr check on objective-c code. (PR #141229)

2025-05-23 Thread kadir çetinkaya via cfe-commits
@@ -19,7 +19,7 @@ class UseNullptrCheck : public ClangTidyCheck { bool isLanguageVersionSupported(const LangOptions &LangOpts) const override { // FIXME this should be CPlusPlus11 but that causes test cases to // erroneously fail. -return LangOpts.CPlusPlus || Lan

[clang-tools-extra] [clang-tidy] Don't run use-nullptr check on objective-c code. (PR #141229)

2025-05-23 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. https://github.com/llvm/llvm-project/pull/141229 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Follow style configuration in clangd when inserting missing includes (PR #140594)

2025-05-23 Thread kadir çetinkaya via cfe-commits
kadircet wrote: just a high level question, I wasn't following the recent developments closely, but we seem to have both an `AngledHeaders` and `QuotedHeaders` option. Why are we only following one here? I guess the signals for angled includes are much stricter (search paths need to be marked

[clang-tools-extra] [clang-tools-extra] Add include mappings for getopt.h (PR #140726)

2025-05-21 Thread kadir çetinkaya via cfe-commits
kadircet wrote: unfortunately neither is used by include-cleaner. we only support mappings for c++ STL, through https://github.com/llvm/llvm-project/blob/main/clang/lib/Tooling/Inclusions/Stdlib/StdSymbolMap.inc and friends. we didn't want to add any system specific libraries, especially base

[clang] [clang-tools-extra] [clang-include-cleaner] Make cleanup attr report expr location (PR #140233)

2025-05-21 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. https://github.com/llvm/llvm-project/pull/140233 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang-include-cleaner] Make cleanup attr report expr location (PR #140233)

2025-05-21 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet commented: LG for include-cleaner changes. https://github.com/llvm/llvm-project/pull/140233 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add UnusedIncludes/MissingIncludes options to misc-include-cleaner (PR #140600)

2025-05-20 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. https://github.com/llvm/llvm-project/pull/140600 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Drop the optimization where only shards for modified files are updated in the background index (PR #140651)

2025-05-20 Thread kadir çetinkaya via cfe-commits
kadircet wrote: I am afraid this doesn't address clangd/clangd#1104 to a useful extent :/. Whenever a header `foo.h` changes, clangd will schedule indexing of only a **single** translation unit that depends on it, not all of them. So if there are other TUs that reference `foo`, they'll still s

[clang] [clang-tools-extra] [clang-include-cleaner] Make cleanup attr report expr location (PR #140233)

2025-05-19 Thread kadir çetinkaya via cfe-commits
kadircet wrote: changes in include-cleaner LG, but I am not sure about the canonical way of tracking this location in clang (i.e. if we're going to track an expression within the attribute, do we still need to tract the underlying decl as well? can't we just extract it from expr when needed?)

[clang] [Clang] Allow parsing arbitrary order of attributes for declarations (PR #133107)

2025-05-19 Thread kadir çetinkaya via cfe-commits
kadircet wrote: > I think we need to understand what we want before we can make decisions on > what needs changing, though. Are there invariants we want to introduce, like > the source range for the AST node should encompass the source locations > tracked within the AST node? Or are we fine wi

[clang] [Clang] Allow parsing arbitrary order of attributes for declarations (PR #133107)

2025-05-16 Thread kadir çetinkaya via cfe-commits
kadircet wrote: > We're currently inconsistent regarding attributes; sometimes we include the > attributes in the range, sometimes we don't. But declaration source ranges > are tough to reason about in general because there's many different moving > parts. I totally agree. I was asking to cha

[clang] [Clang] Allow parsing arbitrary order of attributes for declarations (PR #133107)

2025-05-15 Thread kadir çetinkaya via cfe-commits
kadircet wrote: I'd like to highlight that many tools still only care about declarations themselves and not the attributes. The ones that fiddle with attributes need to do it in a special and complicated way already. Making this less complicated definitely creates some value. But I think the

[clang] [Clang] Allow parsing arbitrary order of attributes for declarations (PR #133107)

2025-05-15 Thread kadir çetinkaya via cfe-commits
kadircet wrote: I'd like to chime in for the issue with source locations and its implications. Seems like it has been brought up already along the thread. These might not be as crucial for diagnostic locations (or other clang purposes) when they're slightly off, but they actually result in big

[clang-tools-extra] include-cleaner: Report function decls from __cleanup__ as used (PR #138669)

2025-05-13 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet closed https://github.com/llvm/llvm-project/pull/138669 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] include-cleaner: Report function decls from __cleanup__ as used (PR #138669)

2025-05-13 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. thanks, sorry for missing this! https://github.com/llvm/llvm-project/pull/138669 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Correctly annotate ObjC `* __autoreleasing *` (PR #138799)

2025-05-07 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. thanks! https://github.com/llvm/llvm-project/pull/138799 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-05-06 Thread kadir çetinkaya via cfe-commits
kadircet wrote: ping @AaronBallman @efriedma-quic if you don't have more concerns here, I'd like to move forward with this patch https://github.com/llvm/llvm-project/pull/137163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-05-05 Thread kadir çetinkaya via cfe-commits
@@ -9125,9 +9126,25 @@ bool LValueExprEvaluator::VisitCompoundLiteralExpr(const CompoundLiteralExpr *E) { assert((!Info.getLangOpts().CPlusPlus || E->isFileScope()) && "lvalue compound literal in c++?"); - // Defer visiting the literal until the lvalue-to-rvalue con

[clang-tools-extra] [clangd] Store documentation when indexing standard library (PR #133681)

2025-05-04 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. thanks, LGTM! https://github.com/llvm/llvm-project/pull/133681 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Store documentation when indexing standard library (PR #133681)

2025-05-04 Thread kadir çetinkaya via cfe-commits
@@ -158,6 +159,42 @@ TEST(StdLibTests, EndToEnd) { UnorderedElementsAre(StdlibSymbol("list"), StdlibSymbol("vector"))); } +TEST(StdLibTests, StdLibDocComments) { + Config Cfg; + Cfg.Index.StandardLibrary = true; + WithContextValue Enabled(Config::Key, std::move(Cfg));

[clang-tools-extra] [clangd] Store documentation when indexing standard library (PR #133681)

2025-05-04 Thread kadir çetinkaya via cfe-commits
@@ -158,6 +158,43 @@ TEST(StdLibTests, EndToEnd) { UnorderedElementsAre(StdlibSymbol("list"), StdlibSymbol("vector"))); } +TEST(StdLibTests, StdLibDocComments) { + Config Cfg; + Cfg.Index.StandardLibrary = true; + WithContextValue Enabled(Config::Key, std::move(Cfg));

[clang-tools-extra] [clangd] Store documentation when indexing standard library (PR #133681)

2025-05-04 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet edited https://github.com/llvm/llvm-project/pull/133681 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-29 Thread kadir çetinkaya via cfe-commits
@@ -9125,9 +9126,25 @@ bool LValueExprEvaluator::VisitCompoundLiteralExpr(const CompoundLiteralExpr *E) { assert((!Info.getLangOpts().CPlusPlus || E->isFileScope()) && "lvalue compound literal in c++?"); - // Defer visiting the literal until the lvalue-to-rvalue con

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-28 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet updated https://github.com/llvm/llvm-project/pull/137163 From 99fa9a1f5fb74401c790871e6eb1ce473d048d74 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Thu, 24 Apr 2025 11:12:00 +0200 Subject: [PATCH 1/3] [clang][CompundLiteralExpr] Don't defer evaluation for CL

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-28 Thread kadir çetinkaya via cfe-commits
@@ -9125,9 +9126,25 @@ bool LValueExprEvaluator::VisitCompoundLiteralExpr(const CompoundLiteralExpr *E) { assert((!Info.getLangOpts().CPlusPlus || E->isFileScope()) && "lvalue compound literal in c++?"); - // Defer visiting the literal until the lvalue-to-rvalue con

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-28 Thread kadir çetinkaya via cfe-commits
@@ -4522,6 +4523,38 @@ static CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, BaseVal = MTE->getOrCreateValue(false); assert(BaseVal && "got reference to unevaluated temporary"); + } else if (const CompoundLiteralExpr *CLE = +

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-28 Thread kadir çetinkaya via cfe-commits
@@ -4522,6 +4523,38 @@ static CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, BaseVal = MTE->getOrCreateValue(false); assert(BaseVal && "got reference to unevaluated temporary"); + } else if (const CompoundLiteralExpr *CLE = +

[clang] [clang-format] Fix a bug in annotating TT_PointerOrReference (PR #136073)

2025-04-28 Thread kadir çetinkaya via cfe-commits
kadircet wrote: this didn't seem to restore the desired formatting, re-openning #135972 with additional context https://github.com/llvm/llvm-project/pull/136073 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang-tools-extra] [clangd] Store documentation when indexing standard library (PR #133681)

2025-04-28 Thread kadir çetinkaya via cfe-commits
@@ -158,6 +158,43 @@ TEST(StdLibTests, EndToEnd) { UnorderedElementsAre(StdlibSymbol("list"), StdlibSymbol("vector"))); } +TEST(StdLibTests, StdLibDocComments) { + Config Cfg; + Cfg.Index.StandardLibrary = true; + WithContextValue Enabled(Config::Key, std::move(Cfg));

[clang-tools-extra] [clangd] Store documentation when indexing standard library (PR #133681)

2025-04-28 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet requested changes to this pull request. thanks a lot, implementation LG, just a small hurdle with the test (sorry for not checking that out earlier) https://github.com/llvm/llvm-project/pull/133681 ___ cfe-commits mailing l

[clang-tools-extra] [clangd] Store documentation when indexing standard library (PR #133681)

2025-04-28 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet edited https://github.com/llvm/llvm-project/pull/133681 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Store documentation when indexing standard library (PR #133681)

2025-04-28 Thread kadir çetinkaya via cfe-commits
@@ -223,33 +226,26 @@ SymbolSlab indexStandardLibrary(llvm::StringRef HeaderSources, return Symbols; } - SymbolCollector::Options IndexOpts; - IndexOpts.Origin = SymbolOrigin::StdLib; - IndexOpts.CollectMainFileSymbols = false; - IndexOpts.CollectMainFileRefs = fals

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-25 Thread kadir çetinkaya via cfe-commits
@@ -9125,9 +9126,25 @@ bool LValueExprEvaluator::VisitCompoundLiteralExpr(const CompoundLiteralExpr *E) { assert((!Info.getLangOpts().CPlusPlus || E->isFileScope()) && "lvalue compound literal in c++?"); - // Defer visiting the literal until the lvalue-to-rvalue con

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-25 Thread kadir çetinkaya via cfe-commits
@@ -4622,7 +4618,12 @@ handleLValueToRValueConversion(EvalInfo &Info, const Expr *Conv, QualType Type, } } - CompleteObject LitObj(LVal.Base, &Lit, Base->getType()); + APValue *Lit = + CLE->hasStaticStorage() + ? &CLE->getStaticVa

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-25 Thread kadir çetinkaya via cfe-commits
@@ -3489,6 +3489,11 @@ class CompoundLiteralExpr : public Expr { /// The int part of the pair stores whether this expr is file scope. llvm::PointerIntPair TInfoAndScope; Stmt *Init; + + /// Value of constant literals with static storage duration. Used only for + /// con

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-25 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet updated https://github.com/llvm/llvm-project/pull/137163 From 99fa9a1f5fb74401c790871e6eb1ce473d048d74 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Thu, 24 Apr 2025 11:12:00 +0200 Subject: [PATCH 1/2] [clang][CompundLiteralExpr] Don't defer evaluation for CL

[clang] [clang-tools-extra] [clang] Hide the `TargetOptions` pointer from `CompilerInvocation` (PR #106271)

2025-04-24 Thread kadir çetinkaya via cfe-commits
@@ -216,7 +216,7 @@ enum OpenCLTypeKind : uint8_t { /// class TargetInfo : public TransferrableTargetInfo, public RefCountedBase { - std::shared_ptr TargetOpts; + TargetOptions *TargetOpts; kadircet wrote: sorry for delay here. i'd still

[clang] [clang] Fix a use-after-free in expression evaluation (PR #118480)

2025-04-24 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet updated https://github.com/llvm/llvm-project/pull/118480 From 9a3ddb6ca0805f238042f0b795de93066f386e08 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Tue, 3 Dec 2024 11:21:44 +0100 Subject: [PATCH] [clang] Fix a use-after-free in expression evaluation followin

[clang] [clang] Fix a use-after-free in expression evaluation (PR #118480)

2025-04-24 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet closed https://github.com/llvm/llvm-project/pull/118480 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-24 Thread kadir çetinkaya via cfe-commits
kadircet wrote: Followup for https://github.com/llvm/llvm-project/pull/118480 https://github.com/llvm/llvm-project/pull/137163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-24 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet created https://github.com/llvm/llvm-project/pull/137163 Previously we would defer evaluation of CLEs until LValue to RValue conversions, which would result in creating values within wrong scope and triggering use-after-frees. This patch instead eagerly evaluates CLE

[clang] [clang] Fix a use-after-free in expression evaluation (PR #118480)

2025-04-24 Thread kadir çetinkaya via cfe-commits
kadircet wrote: Put together a new fix based on the discussions here in https://github.com/llvm/llvm-project/pull/137163, PTAL. @AaronBallman I am afraid this might no longer fix the crashes you're seeing internally though, as the new fix is focused on handling of `CompoundLiteralExpr`s, wher

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-24 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet updated https://github.com/llvm/llvm-project/pull/137163 From 99fa9a1f5fb74401c790871e6eb1ce473d048d74 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Thu, 24 Apr 2025 11:12:00 +0200 Subject: [PATCH] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs P

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-24 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet edited https://github.com/llvm/llvm-project/pull/137163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Store documentation when indexing standard library (PR #133681)

2025-04-22 Thread kadir çetinkaya via cfe-commits
kadircet wrote: > 1. we no longer use SymbolOrigin::StdLib for collected symbols thanks for catching that, I think that's OK to pass in an extra `SymbolOrigin` flag here. > 2. we run the symbol collector with CollectMainFileSymbols = true I think this is WAI. Firstly we shouldn't have (m)any

[clang] [clang-format] Fix a bug in FormatToken::isObjCAccessSpecifier() (PR #136109)

2025-04-18 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. https://github.com/llvm/llvm-project/pull/136109 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix a use-after-free in expression evaluation (PR #118480)

2025-04-17 Thread kadir çetinkaya via cfe-commits
kadircet wrote: hi @AaronBallman, no unfortunately we didn't make any progress here, and I just verified that reproducer from https://github.com/llvm/llvm-project/pull/118480#issuecomment-2538988006 is still triggering the issue (with -std=c++20). https://github.com/llvm/llvm-project/pull/11

[clang-tools-extra] [clangd] Store documentation when indexing standard library (PR #133681)

2025-04-17 Thread kadir çetinkaya via cfe-commits
kadircet wrote: > The described options seem a bit more involved than necessary to fix this > bug, given that it's just the value of the `StoreAllDocumentation` flag > that's a problem. Maybe I miscommunicated something, but I was talking about a change like https://github.com/kadircet/llvm-p

[clang-tools-extra] [clangd][docs] Fix incorrect docstring for header-insertion "Never" (PR #135921)

2025-04-16 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet closed https://github.com/llvm/llvm-project/pull/135921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd][docs] Fix incorrect docstring for header-insertion "Never" (PR #135921)

2025-04-15 Thread kadir çetinkaya via cfe-commits
kadircet wrote: btw do you have commit access or should I merge ? https://github.com/llvm/llvm-project/pull/135921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add `HeaderInsertion` yaml config option (PR #128503)

2025-04-15 Thread kadir çetinkaya via cfe-commits
@@ -341,6 +341,14 @@ struct Fragment { /// Delimiters: empty pair of delimiters "()" or "<>" /// FullPlaceholders: full name of both type and parameter std::optional> ArgumentLists; +/// Add #include directives when accepting code completions. Config +//

[clang-tools-extra] [clangd] Add `HeaderInsertion` yaml config option (PR #128503)

2025-04-15 Thread kadir çetinkaya via cfe-commits
@@ -341,6 +341,14 @@ struct Fragment { /// Delimiters: empty pair of delimiters "()" or "<>" /// FullPlaceholders: full name of both type and parameter std::optional> ArgumentLists; +/// Add #include directives when accepting code completions. Config +//

[clang-tools-extra] [clangd] Store documentation when indexing standard library (PR #133681)

2025-04-15 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet requested changes to this pull request. (sorry for the late reply, we were both OOO :() thanks a lot for great analysis in https://github.com/clangd/clangd/issues/2344! IIUC, the root cause is we're putting stdlib-index slabs into dynamic-index, but we're building t

[clang] [clang-tools-extra] [clang][AST][clang-tidy] Do not set a reduced traversal scope in ASTM… (PR #132725)

2025-04-05 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet commented: > Are you able to test this PR and confirm it fixes the regressions you > encountered? hi @carlosgalvezp , yes this fixes the particular issues we had, thanks! https://github.com/llvm/llvm-project/pull/132725 __

[clang-tools-extra] [clangd] [C++20] [Modules] Add modules suffix for 'Header' Source Switch (PR #131591)

2025-04-05 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. https://github.com/llvm/llvm-project/pull/131591 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang][AST][clang-tidy] Do not set a reduced traversal scope in ASTM… (PR #132725)

2025-03-25 Thread kadir çetinkaya via cfe-commits
@@ -94,8 +94,6 @@ Improvements to clang-tidy - :program:`clang-tidy` no longer processes declarations from system headers by default, greatly improving performance. This behavior is disabled if the `SystemHeaders` option is enabled. - Note: this may lead to false negatives

[clang] [clang-tools-extra] [clang][AST][clang-tidy] Do not set a reduced traversal scope in ASTM… (PR #132725)

2025-03-24 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet edited https://github.com/llvm/llvm-project/pull/132725 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang][AST][clang-tidy] Do not set a reduced traversal scope in ASTM… (PR #132725)

2025-03-24 Thread kadir çetinkaya via cfe-commits
@@ -94,8 +94,6 @@ Improvements to clang-tidy - :program:`clang-tidy` no longer processes declarations from system headers by default, greatly improving performance. This behavior is disabled if the `SystemHeaders` option is enabled. - Note: this may lead to false negatives

[clang] [clang-tools-extra] [clang-tidy] Avoid processing declarations in system headers (PR #128150)

2025-03-20 Thread kadir çetinkaya via cfe-commits
kadircet wrote: Hi folks, we're seeing some regressions on our internal tidy checks after this patch. The regression is similar to what @haoNoQ raised in https://github.com/llvm/llvm-project/pull/128150#issuecomment-2705425193, the blast radius a little bit wider than checks that build and in

[clang-tools-extra] [clangd] Add `BuiltinHeaders` flag to Config file (PR #129459)

2025-03-07 Thread kadir çetinkaya via cfe-commits
kadircet wrote: > we've had users for whom the BuiltinHeaders: QueryDriver behaviour worked > better and want to switch back to it (examples here, here, here, here). I'd argue that the fix isn't as simple as using builtin headers from a different toolchain for those users. Because clang itself

[clang-tools-extra] [clangd] Explicitly block until async task completes (PR #130077)

2025-03-06 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet created https://github.com/llvm/llvm-project/pull/130077 We started seeing some use-after-frees starting with https://github.com/llvm/llvm-project/pull/125433. This patch ensures we explicitly block for the async task, if there's one, before destructing `std::future

[clang-tools-extra] [clangd] [C++20] [Modules] Add scanning cache (PR #125988)

2025-02-25 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. sorry for the delayed turn around, lgtm! https://github.com/llvm/llvm-project/pull/125988 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang-tools-extra] [clangd] [C++20] [Modules] Add scanning cache (PR #125988)

2025-02-25 Thread kadir çetinkaya via cfe-commits
@@ -380,30 +381,114 @@ llvm::SmallVector getAllRequiredModules(ProjectModules &MDB, return ModuleNames; } +class CachingProjectModules : public ProjectModules { +public: + CachingProjectModules(const GlobalCompilationDatabase &CDB) : CDB(CDB) {} + + std::vector getRequire

[clang-tools-extra] [clangd] [C++20] [Modules] Add scanning cache (PR #125988)

2025-02-25 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet edited https://github.com/llvm/llvm-project/pull/125988 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [SafeBuffers] Check if unsafe-buffers* warnings are enabled earlier (PR #128603)

2025-02-25 Thread kadir çetinkaya via cfe-commits
@@ -2625,14 +2636,10 @@ void clang::sema::AnalysisBasedWarnings::IssueWarnings( // More analysis ... }; + // Emit per-function analysis-based warnings that require the whole-TU - // reasoning. Check if any of them is enabled at all before scanning the AST: - if (!Di

[clang] [SafeBuffers] Check if unsafe-buffers* warnings are enabled earlier (PR #128603)

2025-02-25 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. https://github.com/llvm/llvm-project/pull/128603 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Tooling] Support relative directory in compilation database (PR #127734)

2025-02-19 Thread kadir çetinkaya via cfe-commits
kadircet wrote: > In my case I am using my build system (bazel) to generate the > compile_commands.json file as part of the build. At this point given bazel's > sandboxing / hermiticity model, the user's checkout PWD is unknown. This file > is then copied somewhere and used by clangd. Today to

[clang-tools-extra] [clangd] Update XRefs to support overriden ObjC methods (PR #127109)

2025-02-19 Thread kadir çetinkaya via cfe-commits
@@ -411,6 +411,58 @@ TEST(LocateSymbol, FindOverrides) { sym("foo", Code.range("2"), std::nullopt))); } +TEST(LocateSymbol, FindOverridesObjC) { + auto Code = Annotations(R"objc( +@protocol Fooey +- (void)foo; +@end +@interfa

[clang-tools-extra] [clangd] Store full decl/def range with symbol locations (PR #118102)

2025-02-19 Thread kadir çetinkaya via cfe-commits
kadircet wrote: > Could you say more about this? What happened to ClangdModules? Sorry, apparently I even forgot its proper name, i meant `clangd::FeatureModule`. Nothing bad happened, we built this infra but didn't get a chance to polish and use it afterwards. We wanted to migrate any non-cor

[clang-tools-extra] [clangd] Avoid round-trip from SourceLocation to clangd::Range and back in SymbolCollector::handleMacros() (PR #127757)

2025-02-19 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. https://github.com/llvm/llvm-project/pull/127757 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Store full decl/def range with symbol locations (PR #118102)

2025-02-18 Thread kadir çetinkaya via cfe-commits
kadircet wrote: > We could cut the memory usage overhead of the patch in half by only having it > in one of them. (@kadircet would that change your analysis of the tradeoffs > at all?) I think that'd still be too much considering the functionality we'll get in the end. Others might not share

[clang-tools-extra] [clangd] Update XRefs to support overriden ObjC methods (PR #127109)

2025-02-17 Thread kadir çetinkaya via cfe-commits
@@ -1438,6 +1461,15 @@ ReferencesResult findReferences(ParsedAST &AST, Position Pos, uint32_t Limit, getOverriddenMethods(CMD, OverriddenMethods); } } +// Special case: Objective-C methods can override a parent class or +// protoco

[clang-tools-extra] [clangd] Store full decl/def range with symbol locations (PR #118102)

2025-02-17 Thread kadir çetinkaya via cfe-commits
kadircet wrote: > My main motivation is to get DefineOutline I think if we're solely aiming for improvements to DefineOutline, I'd say the resource trade-off here isn't worth it. > I don't see how bracket matching can help us get from the name of the > function to the actual start of the decl

[clang-tools-extra] [clangd] Update XRefs to support overriden ObjC methods (PR #127109)

2025-02-17 Thread kadir çetinkaya via cfe-commits
@@ -430,6 +430,18 @@ locateASTReferent(SourceLocation CurLoc, const syntax::Token *TouchedIdentifier, continue; } } +// Special case: an Objective-C method can override a parent class or +// protocol. kadircet wrote: > I was thinking

[clang-tools-extra] [clangd] Update XRefs to support overriden ObjC methods (PR #127109)

2025-02-17 Thread kadir çetinkaya via cfe-commits
@@ -430,6 +439,22 @@ locateASTReferent(SourceLocation CurLoc, const syntax::Token *TouchedIdentifier, continue; } } +// Special case: - (void)^method; should jump to all overrides. Note that an +// Objective-C method can override a parent class or pr

  1   2   3   4   5   6   7   8   9   10   >