[clang] [clang-format] Break after string literals with trailing line breaks (PR #76795)

2024-01-05 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet updated https://github.com/llvm/llvm-project/pull/76795 From 18ef1d8901835f5129f775d292425b808f42fe85 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Wed, 3 Jan 2024 09:28:35 +0100 Subject: [PATCH 1/4] [clang-format] Break after string literals with trailing li

[clang] [clang-format] Break after string literals with trailing line breaks (PR #76795)

2024-01-05 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet updated https://github.com/llvm/llvm-project/pull/76795 From 18ef1d8901835f5129f775d292425b808f42fe85 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Wed, 3 Jan 2024 09:28:35 +0100 Subject: [PATCH 1/4] [clang-format] Break after string literals with trailing li

[clang] [clang-format] Break after string literals with trailing line breaks (PR #76795)

2024-01-05 Thread kadir çetinkaya via cfe-commits
@@ -2499,6 +2499,15 @@ TEST_F(TokenAnnotatorTest, BraceKind) { EXPECT_BRACE_KIND(Tokens[6], BK_Block); } +TEST_F(TokenAnnotatorTest, StreamOperator) { + auto Tokens = annotate("\"foo\\n\" << aux << \"foo\\n\" << \"foo\";"); + ASSERT_EQ(Tokens.size(), 9u) << Tokens; + EXPE

[clang] [clang-format] Break after string literals with trailing line breaks (PR #76795)

2024-01-08 Thread kadir çetinkaya via cfe-commits
@@ -5151,6 +5151,14 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line, return true; if (Left.IsUnterminatedLiteral) return true; + // FIXME: Breaking after newlines seems useful in general. Turn this into an + // option and recognize more cases like

[clang] [clang-format] Break after string literals with trailing line breaks (PR #76795)

2024-01-08 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet closed https://github.com/llvm/llvm-project/pull/76795 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Format] Fix isStartOfName to recognize attributes (PR #76804)

2024-01-08 Thread kadir çetinkaya via cfe-commits
@@ -1698,8 +1698,6 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) { /*BasedOnStyle=*/"google", }, }; - GoogleStyle.AttributeMacros.push_back("GUARDED_BY"); kadircet wrote: FWIW, not recognizing `foo` in `int foo BAR` as s

Re: [PATCH] D106535: [clangd] Use CommandMangler in TestTU

2021-07-22 Thread Kadir Çetinkaya via cfe-commits
yes that's right. On Thu, Jul 22, 2021 at 12:20 PM Sam McCall via Phabricator < revi...@reviews.llvm.org> wrote: > sammccall added a comment. > > I guess this is technically untested, but will be covered after D106527 < > https://reviews.llvm.org/D106527>? > > > Repository: > rG LLVM Github Mon

Re: [PATCH] D106535: [clangd] Use CommandMangler in TestTU

2021-07-23 Thread Kadir Çetinkaya via cfe-commits
Can you provide a reproducer or build bot failure for the crash Fangrui ? On Fri, Jul 23, 2021 at 6:50 PM Fangrui Song via Phabricator < revi...@reviews.llvm.org> wrote: > MaskRay added a comment. > > `[clangd] Get rid of arg adjusters in CommandMangler` can crash > `BuildCompilerInvocation.Drops

[clang] [clang][Tooling] Add special symbol mappings for C, starting with size_t (PR #85784)

2024-03-19 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet created https://github.com/llvm/llvm-project/pull/85784 None From 8b12e22a01058bcfdcf211b1f64d192d7c5f8463 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Tue, 19 Mar 2024 13:33:35 +0100 Subject: [PATCH] [clang][Tooling] Add special symbol mappings for C, start

[clang] [clang][Tooling] Add special symbol mappings for C, starting with size_t (PR #85784)

2024-03-19 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet updated https://github.com/llvm/llvm-project/pull/85784 From 8b12e22a01058bcfdcf211b1f64d192d7c5f8463 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Tue, 19 Mar 2024 13:33:35 +0100 Subject: [PATCH 1/3] [clang][Tooling] Add special symbol mappings for C, starti

[clang] [clang][Tooling] Add special symbol mappings for C, starting with size_t (PR #85784)

2024-03-20 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet closed https://github.com/llvm/llvm-project/pull/85784 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd][trace] Fix comment to mention that trace spans are measured … (PR #86938)

2024-03-28 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. https://github.com/llvm/llvm-project/pull/86938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-08 Thread kadir çetinkaya via cfe-commits
@@ -538,11 +564,205 @@ std::optional checkName(const NamedDecl &RenameDecl, Conflict->getLocation().printToString(ASTCtx.getSourceManager())}; } } - if (Result) + if (Result) { InvalidNameMetric.record(1, toString(Result->K)); +return makeError(*Re

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-08 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet commented: thanks a lot for bearing with me @DavidGoldman ! https://github.com/llvm/llvm-project/pull/76466 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-08 Thread kadir çetinkaya via cfe-commits
@@ -538,11 +564,205 @@ std::optional checkName(const NamedDecl &RenameDecl, Conflict->getLocation().printToString(ASTCtx.getSourceManager())}; } } - if (Result) + if (Result) { InvalidNameMetric.record(1, toString(Result->K)); +return makeError(*Re

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-08 Thread kadir çetinkaya via cfe-commits
@@ -538,11 +564,205 @@ std::optional checkName(const NamedDecl &RenameDecl, Conflict->getLocation().printToString(ASTCtx.getSourceManager())}; } } - if (Result) + if (Result) { InvalidNameMetric.record(1, toString(Result->K)); +return makeError(*Re

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

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

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-08 Thread kadir çetinkaya via cfe-commits
@@ -538,11 +564,205 @@ std::optional checkName(const NamedDecl &RenameDecl, Conflict->getLocation().printToString(ASTCtx.getSourceManager())}; } } - if (Result) + if (Result) { InvalidNameMetric.record(1, toString(Result->K)); +return makeError(*Re

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-08 Thread kadir çetinkaya via cfe-commits
@@ -696,7 +982,7 @@ renameOutsideFile(const NamedDecl &RenameDecl, llvm::StringRef MainFilePath, FilePath); } auto RenameEdit = -buildRenameEdit(FilePath, AffectedFileCode, *RenameRanges, NewName); +buildRenameEdit(FilePath, AffectedF

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-08 Thread kadir çetinkaya via cfe-commits
@@ -508,24 +513,46 @@ static bool mayBeValidIdentifier(llvm::StringRef Ident) { !isAsciiIdentifierStart(Ident.front(), AllowDollar)) return false; for (char C : Ident) { +if (AllowColon && C == ':') + continue; if (llvm::isASCII(C) && !isAsciiIdentifie

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-08 Thread kadir çetinkaya via cfe-commits
@@ -538,11 +564,205 @@ std::optional checkName(const NamedDecl &RenameDecl, Conflict->getLocation().printToString(ASTCtx.getSourceManager())}; } } - if (Result) + if (Result) { InvalidNameMetric.record(1, toString(Result->K)); +return makeError(*Re

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-08 Thread kadir çetinkaya via cfe-commits
@@ -681,12 +957,22 @@ renameOutsideFile(const NamedDecl &RenameDecl, llvm::StringRef MainFilePath, ExpBuffer.getError().message()); continue; } +std::string RenameIdentifier = RenameDecl.getNameAsString(); +std::optional Selector = std::nullopt; +

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-08 Thread kadir çetinkaya via cfe-commits
@@ -538,11 +564,205 @@ std::optional checkName(const NamedDecl &RenameDecl, Conflict->getLocation().printToString(ASTCtx.getSourceManager())}; } } - if (Result) + if (Result) { InvalidNameMetric.record(1, toString(Result->K)); +return makeError(*Re

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-08 Thread kadir çetinkaya via cfe-commits
@@ -538,11 +564,205 @@ std::optional checkName(const NamedDecl &RenameDecl, Conflict->getLocation().printToString(ASTCtx.getSourceManager())}; } } - if (Result) + if (Result) { InvalidNameMetric.record(1, toString(Result->K)); +return makeError(*Re

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-08 Thread kadir çetinkaya via cfe-commits
@@ -538,11 +564,205 @@ std::optional checkName(const NamedDecl &RenameDecl, Conflict->getLocation().printToString(ASTCtx.getSourceManager())}; } } - if (Result) + if (Result) { InvalidNameMetric.record(1, toString(Result->K)); +return makeError(*Re

[clang-tools-extra] [include-cleaner] Generate references from explicit functiontemplate specializations (PR #83392)

2024-02-29 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet created https://github.com/llvm/llvm-project/pull/83392 None From f62a553d8d4af339bdcb69024d5bf42527e3a01d Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Thu, 29 Feb 2024 09:25:18 +0100 Subject: [PATCH] [include-cleaner] Generate references from explicit func

[clang-tools-extra] [include-cleaner] Generate references from explicit functiontemplate specializations (PR #83392)

2024-02-29 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet closed https://github.com/llvm/llvm-project/pull/83392 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add metric for rename decl kind (PR #83867)

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

[clang-tools-extra] [clangd] Add metric for rename decl kind (PR #83867)

2024-03-05 Thread kadir çetinkaya via cfe-commits
@@ -1072,6 +1072,10 @@ llvm::Expected rename(const RenameInputs &RInputs) { if (Reject) return makeError(*Reject); + static constexpr trace::Metric RenameTriggerCounter( kadircet wrote: can you do this at line 1065 instead? that way we can better trac

[clang] [Sema] Fix crash in __datasizeof with unknown types (PR #80300)

2024-02-01 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. thanks for the fix! https://github.com/llvm/llvm-project/pull/80300 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-02 Thread kadir çetinkaya via cfe-commits
@@ -508,24 +513,46 @@ static bool mayBeValidIdentifier(llvm::StringRef Ident) { !isAsciiIdentifierStart(Ident.front(), AllowDollar)) return false; for (char C : Ident) { +if (AllowColon && C == ':') + continue; if (llvm::isASCII(C) && !isAsciiIdentifie

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-02 Thread kadir çetinkaya via cfe-commits
@@ -538,11 +565,254 @@ std::optional checkName(const NamedDecl &RenameDecl, Conflict->getLocation().printToString(ASTCtx.getSourceManager())}; } } - if (Result) + if (Result) { InvalidNameMetric.record(1, toString(Result->K)); +return makeError(*Re

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-02 Thread kadir çetinkaya via cfe-commits
@@ -681,12 +957,22 @@ renameOutsideFile(const NamedDecl &RenameDecl, llvm::StringRef MainFilePath, ExpBuffer.getError().message()); continue; } +std::string RenameIdentifier = RenameDecl.getNameAsString(); +std::optional Selector = std::nullopt; +

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-02 Thread kadir çetinkaya via cfe-commits
@@ -538,11 +565,254 @@ std::optional checkName(const NamedDecl &RenameDecl, Conflict->getLocation().printToString(ASTCtx.getSourceManager())}; } } - if (Result) + if (Result) { InvalidNameMetric.record(1, toString(Result->K)); +return makeError(*Re

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-02 Thread kadir çetinkaya via cfe-commits
@@ -543,6 +550,45 @@ std::optional checkName(const NamedDecl &RenameDecl, return Result; } +clangd::Range tokenRangeForLoc(ParsedAST &AST, SourceLocation TokLoc, + const SourceManager &SM, + const LangOptions &Lang

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-02 Thread kadir çetinkaya via cfe-commits
@@ -696,7 +982,7 @@ renameOutsideFile(const NamedDecl &RenameDecl, llvm::StringRef MainFilePath, FilePath); } auto RenameEdit = -buildRenameEdit(FilePath, AffectedFileCode, *RenameRanges, NewName); +buildRenameEdit(FilePath, AffectedF

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-02-02 Thread kadir çetinkaya via cfe-commits
@@ -538,11 +565,254 @@ std::optional checkName(const NamedDecl &RenameDecl, Conflict->getLocation().printToString(ASTCtx.getSourceManager())}; } } - if (Result) + if (Result) { InvalidNameMetric.record(1, toString(Result->K)); +return makeError(*Re

[clang] [clang-tools-extra] [clangd] Add support to rename Objective-C selectors (PR #78872)

2024-02-02 Thread kadir çetinkaya via cfe-commits
kadircet wrote: Hi @ahoppen ! Thanks a lot for the patch, but @DavidGoldman has also been working on this in https://github.com/llvm/llvm-project/pull/76466 and I'd rather follow up on that as we've already put in quite a lot of effort to get it into some decent shape and the functionality pro

[clang-tools-extra] [clang] [clangd] Prevent printing huge initializer lists in hover definitions (PR #79746)

2024-02-02 Thread kadir çetinkaya via cfe-commits
@@ -138,15 +138,9 @@ std::string getNamespaceScope(const Decl *D) { std::string printDefinition(const Decl *D, PrintingPolicy PP, const syntax::TokenBuffer &TB) { - if (auto *VD = llvm::dyn_cast(D)) { -if (auto *IE = VD->getInit()) { - //

[clang-tools-extra] [include-cleaner] Check emptiness instead of occurences (PR #79154)

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

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-01-24 Thread kadir çetinkaya via cfe-commits
@@ -681,12 +718,26 @@ renameOutsideFile(const NamedDecl &RenameDecl, llvm::StringRef MainFilePath, ExpBuffer.getError().message()); continue; } +std::string RenameIdentifier = RenameDecl.getNameAsString(); +std::optional Selector = std::nullopt; +

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-01-24 Thread kadir çetinkaya via cfe-commits
@@ -543,6 +550,45 @@ std::optional checkName(const NamedDecl &RenameDecl, return Result; } +clangd::Range tokenRangeForLoc(ParsedAST &AST, SourceLocation TokLoc, + const SourceManager &SM, + const LangOptions &Lang

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-01-24 Thread kadir çetinkaya via cfe-commits
@@ -817,7 +939,8 @@ llvm::Expected rename(const RenameInputs &RInputs) { return StartOffset.takeError(); if (!EndOffset) return EndOffset.takeError(); - if (llvm::none_of( + if (RenamingCurToken && kadircet wrote: as mentioned above, let's just ch

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-01-24 Thread kadir çetinkaya via cfe-commits
@@ -778,12 +868,44 @@ llvm::Expected rename(const RenameInputs &RInputs) { return makeError(ReasonToReject::NoSymbolFound); if (DeclsUnderCursor.size() > 1) return makeError(ReasonToReject::AmbiguousSymbol); + std::string Placeholder; + // We expect the token under

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-01-24 Thread kadir çetinkaya via cfe-commits
@@ -1017,9 +1159,10 @@ size_t renameRangeAdjustmentCost(ArrayRef Indexed, ArrayRef Lexed, int LastDLine = 0, LastDColumn = 0; int Cost = 0; for (size_t I = 0; I < Indexed.size(); ++I) { -int DLine = Indexed[I].start.line - Lexed[MappedIndex[I]].start.line; -int D

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-01-24 Thread kadir çetinkaya via cfe-commits
@@ -746,6 +812,30 @@ void findNearMiss( } // namespace +SymbolRange::SymbolRange(Range R) : Ranges({R}) {} + +SymbolRange::SymbolRange(std::vector Ranges) +: Ranges(std::move(Ranges)) {} + +Range SymbolRange::range() const { return Ranges.front(); } + +bool operator==(con

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-01-24 Thread kadir çetinkaya via cfe-commits
@@ -1029,5 +1172,151 @@ size_t renameRangeAdjustmentCost(ArrayRef Indexed, ArrayRef Lexed, return Cost; } +static bool isMatchingSelectorName(const syntax::Token &Cur, + const syntax::Token &Next, + const S

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-01-24 Thread kadir çetinkaya via cfe-commits
@@ -1029,5 +1172,151 @@ size_t renameRangeAdjustmentCost(ArrayRef Indexed, ArrayRef Lexed, return Cost; } +static bool isMatchingSelectorName(const syntax::Token &Cur, + const syntax::Token &Next, + const S

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-01-24 Thread kadir çetinkaya via cfe-commits
@@ -1029,5 +1172,151 @@ size_t renameRangeAdjustmentCost(ArrayRef Indexed, ArrayRef Lexed, return Cost; } +static bool isMatchingSelectorName(const syntax::Token &Cur, + const syntax::Token &Next, + const S

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-01-24 Thread kadir çetinkaya via cfe-commits
@@ -778,12 +868,44 @@ llvm::Expected rename(const RenameInputs &RInputs) { return makeError(ReasonToReject::NoSymbolFound); if (DeclsUnderCursor.size() > 1) return makeError(ReasonToReject::AmbiguousSymbol); + std::string Placeholder; + // We expect the token under

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-01-24 Thread kadir çetinkaya via cfe-commits
@@ -778,12 +868,44 @@ llvm::Expected rename(const RenameInputs &RInputs) { return makeError(ReasonToReject::NoSymbolFound); if (DeclsUnderCursor.size() > 1) return makeError(ReasonToReject::AmbiguousSymbol); + std::string Placeholder; + // We expect the token under

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-01-24 Thread kadir çetinkaya via cfe-commits
@@ -1029,5 +1172,151 @@ size_t renameRangeAdjustmentCost(ArrayRef Indexed, ArrayRef Lexed, return Cost; } +static bool isMatchingSelectorName(const syntax::Token &Cur, + const syntax::Token &Next, + const S

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-01-24 Thread kadir çetinkaya via cfe-commits
@@ -38,6 +38,11 @@ namespace clang { namespace clangd { + +std::vector collectRenameIdentifierRanges( kadircet wrote: let's move this into anonymous namespace, and add some comments explaining what it does? https://github.com/llvm/llvm-project/pull/76466 __

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-01-24 Thread kadir çetinkaya via cfe-commits
@@ -1029,5 +1172,151 @@ size_t renameRangeAdjustmentCost(ArrayRef Indexed, ArrayRef Lexed, return Cost; } +static bool isMatchingSelectorName(const syntax::Token &Cur, kadircet wrote: can you move all of these into anon namespace instead? https://github.c

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-01-24 Thread kadir çetinkaya via cfe-commits
@@ -543,6 +550,45 @@ std::optional checkName(const NamedDecl &RenameDecl, return Result; } +clangd::Range tokenRangeForLoc(ParsedAST &AST, SourceLocation TokLoc, + const SourceManager &SM, + const LangOptions &Lang

[clang-tools-extra] Add support for renaming objc methods, even those with multiple selector pieces (PR #76466)

2024-01-24 Thread kadir çetinkaya via cfe-commits
@@ -1029,5 +1172,151 @@ size_t renameRangeAdjustmentCost(ArrayRef Indexed, ArrayRef Lexed, return Cost; } +static bool isMatchingSelectorName(const syntax::Token &Cur, + const syntax::Token &Next, + const S

[clang] [clang-tools-extra] [clangd] Prevent printing huge initializer lists in hover definitions (PR #79746)

2024-01-29 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet edited https://github.com/llvm/llvm-project/pull/79746 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang] [clangd] Prevent printing huge initializer lists in hover definitions (PR #79746)

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

[clang] [clang-tools-extra] [clangd] Prevent printing huge initializer lists in hover definitions (PR #79746)

2024-01-29 Thread kadir çetinkaya via cfe-commits
@@ -138,15 +138,9 @@ std::string getNamespaceScope(const Decl *D) { std::string printDefinition(const Decl *D, PrintingPolicy PP, const syntax::TokenBuffer &TB) { - if (auto *VD = llvm::dyn_cast(D)) { -if (auto *IE = VD->getInit()) { - //

[clang-tools-extra] [clang] [clangd] Prevent printing huge initializer lists in hover definitions (PR #79746)

2024-01-29 Thread kadir çetinkaya via cfe-commits
@@ -1720,6 +1720,12 @@ void StmtPrinter::VisitInitListExpr(InitListExpr* Node) { OS << "{"; for (unsigned i = 0, e = Node->getNumInits(); i != e; ++i) { if (i) OS << ", "; +// TODO: There is duplicated functionality in APValue::printPretty. +// Would be good to

[clang-tools-extra] Fix 'newline in constant' encoding issue in clangd sources (PR #78085)

2024-01-15 Thread kadir çetinkaya via cfe-commits
kadircet wrote: I am not sure if this is a viable solution in the long term as LLVM don't really use BOMs in the sources (a quick scan shows only 4 files with BOMs), hence these changes can easily be overridden without someone noticing. Any reason you can't configure MSVC to treat all of the L

[clang-tools-extra] [include-cleaner] Check emptiness instead of occurences (PR #79154)

2024-01-23 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet created https://github.com/llvm/llvm-project/pull/79154 Our internal integration relies on injecting some default values to ignore/keep lists. That means we can have filters, despite of not having occurences for the flag. From 8b90af32711a435eeb19fd93f5dfa0a6cf94ffc

[clang-tools-extra] [include-cleaner] Handle symbols from system headers. (PR #66089)

2023-10-18 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet edited https://github.com/llvm/llvm-project/pull/66089 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [include-cleaner] Handle symbols from system headers. (PR #66089)

2023-10-18 Thread kadir çetinkaya via cfe-commits
@@ -176,6 +180,104 @@ headersForSpecialSymbol(const Symbol &S, const SourceManager &SM, return std::nullopt; } +// A hand-mainained list of include mappings for system headers. +// The first element is the suffix of the physical file path for the system +// header, the seco

[clang-tools-extra] [include-cleaner] Handle symbols from system headers. (PR #66089)

2023-10-18 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet commented: thanks a lot, and so sorry for taking so long on getting to this https://github.com/llvm/llvm-project/pull/66089 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang-tools-extra] [include-cleaner] Handle symbols from system headers. (PR #66089)

2023-10-18 Thread kadir çetinkaya via cfe-commits
@@ -176,6 +180,104 @@ headersForSpecialSymbol(const Symbol &S, const SourceManager &SM, return std::nullopt; } +// A hand-mainained list of include mappings for system headers. +// The first element is the suffix of the physical file path for the system +// header, the seco

[clang-tools-extra] [include-cleaner] Handle symbols from system headers. (PR #66089)

2023-10-18 Thread kadir çetinkaya via cfe-commits
@@ -176,6 +180,104 @@ headersForSpecialSymbol(const Symbol &S, const SourceManager &SM, return std::nullopt; } +// A hand-mainained list of include mappings for system headers. +// The first element is the suffix of the physical file path for the system +// header, the seco

[clang-tools-extra] [include-cleaner] Handle symbols from system headers. (PR #66089)

2023-10-18 Thread kadir çetinkaya via cfe-commits
@@ -176,6 +180,104 @@ headersForSpecialSymbol(const Symbol &S, const SourceManager &SM, return std::nullopt; } +// A hand-mainained list of include mappings for system headers. +// The first element is the suffix of the physical file path for the system +// header, the seco

[clang-tools-extra] [include-cleaner] Handle symbols from system headers. (PR #66089)

2023-10-18 Thread kadir çetinkaya via cfe-commits
@@ -176,6 +180,104 @@ headersForSpecialSymbol(const Symbol &S, const SourceManager &SM, return std::nullopt; } +// A hand-mainained list of include mappings for system headers. +// The first element is the suffix of the physical file path for the system +// header, the seco

[clang-tools-extra] [include-cleaner] Handle symbols from system headers. (PR #66089)

2023-10-18 Thread kadir çetinkaya via cfe-commits
@@ -176,6 +180,104 @@ headersForSpecialSymbol(const Symbol &S, const SourceManager &SM, return std::nullopt; } +// A hand-mainained list of include mappings for system headers. +// The first element is the suffix of the physical file path for the system +// header, the seco

[clang-tools-extra] [include-cleaner] Handle symbols from system headers. (PR #66089)

2023-10-18 Thread kadir çetinkaya via cfe-commits
@@ -188,6 +290,20 @@ llvm::SmallVector> findHeaders(const SymbolLocation &Loc, OptionalFileEntryRef FE = SM.getFileEntryRefForID(FID); if (!FE) return {}; + +if (SrcMgr::isSystem( +SM.getSLocEntry(FID).getFile().getFileCharacteristic())) { +

[clang-tools-extra] [include-cleaner] Handle symbols from system headers. (PR #66089)

2023-10-18 Thread kadir çetinkaya via cfe-commits
@@ -188,6 +290,20 @@ llvm::SmallVector> findHeaders(const SymbolLocation &Loc, OptionalFileEntryRef FE = SM.getFileEntryRefForID(FID); if (!FE) return {}; + +if (SrcMgr::isSystem( kadircet wrote: i am afraid this check might be overly strict

[clang-tools-extra] [include-cleaner] Handle symbols from system headers. (PR #66089)

2023-10-18 Thread kadir çetinkaya via cfe-commits
@@ -176,6 +180,104 @@ headersForSpecialSymbol(const Symbol &S, const SourceManager &SM, return std::nullopt; } +// A hand-mainained list of include mappings for system headers. +// The first element is the suffix of the physical file path for the system +// header, the seco

[clang-tools-extra] [include-cleaner] Handle symbols from system headers. (PR #66089)

2023-10-18 Thread kadir çetinkaya via cfe-commits
@@ -176,6 +180,104 @@ headersForSpecialSymbol(const Symbol &S, const SourceManager &SM, return std::nullopt; } +// A hand-mainained list of include mappings for system headers. +// The first element is the suffix of the physical file path for the system +// header, the seco

[clang-tools-extra] [clangd] Disable crashy unchecked-optional-access tidy check (PR #69427)

2023-10-19 Thread kadir çetinkaya via cfe-commits
kadircet wrote: thanks for the pointers @HighCommander4 ! https://github.com/llvm/llvm-project/pull/69427 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Disable crashy unchecked-optional-access tidy check (PR #69427)

2023-10-19 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet closed https://github.com/llvm/llvm-project/pull/69427 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Disable crashy unchecked-optional-access tidy check (PR #69427)

2023-10-19 Thread kadir çetinkaya via cfe-commits
kadircet wrote: yeah, initiated that (i think) already in https://github.com/llvm/llvm-project/issues/69568 https://github.com/llvm/llvm-project/pull/69427 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang-tools-extra] [clangd] update list of fast tidy checks (PR #69723)

2023-10-20 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. > (this diff isn't great news for the idea of treating new checks as slow by > default :-() Well, FWIW, i think that was the trade-off we made. Most of the checks are fast, but when a slow one sneaks in, it's really hard to notice. So by

[clang] [Sema] Add check for bitfield assignments to integral types (PR #69049)

2023-10-23 Thread kadir çetinkaya via cfe-commits
kadircet wrote: hi folks! this seems to be triggering crashes on some valid code, e.g: a.cc: ``` template bool c = __is_constructible(a, b...); struct d { int q : 1; }; struct i { virtual void g() { (void)c; } }; i n; ``` ``` clang -xc++ -std=c++20 -fsyntax-only a.cc clang: /usr/local

[clang] [tooling/include-mapping] Add missing localtime_r symbols (PR #66091)

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

Re: [PATCH] D88721: [clangd][lit] Update document-link.test to respect custom resource-dir locations

2020-10-02 Thread Kadir Çetinkaya via cfe-commits
not that i know of. On Fri, Oct 2, 2020 at 12:34 PM Aleksandr Platonov via Phabricator < revi...@reviews.llvm.org> wrote: > ArcsinX added a comment. > > Just a question. > On Windows `%resource_dir/..` looks a bit inconsistent after substitution > (`d:\llvm-project\build\lib\clang\12.0.0\include/

Re: [PATCH] D96244: [clangd] Introduce Modules

2021-02-13 Thread Kadir Çetinkaya via cfe-commits
oops, d25fbaa4a4a1284e998f545d45280e976c29cc85 should fix the issue. On Sat, Feb 13, 2021 at 2:54 PM Simon Pilgrim via Phabricator < revi...@reviews.llvm.org> wrote: > RKSimon added a comment. > > In D96244#2558345 , @sammccall > wrote: > > > I'm a little

Re: [PATCH] D135245: [clang][Tooling] Move STL recognizer to its own library

2022-10-07 Thread Kadir Çetinkaya via cfe-commits
sorry for that, bb4f0af97dba600c50a0f727b25a760e8185c578 should fix it On Fri, Oct 7, 2022 at 7:46 PM Kamau Bridgeman via Phabricator < revi...@reviews.llvm.org> wrote: > kamaub added a comment. > > This change causes a linking failure during the `check-all` testing of > 'clang-tools-extra' on th

Re: [PATCH] D137962: [clang][Tooling] Make the filename behaviour consistent

2022-11-15 Thread Kadir Çetinkaya via cfe-commits
oops, should be fixed with eed1f337a1fbf8c1e7e53a6e1d0dfd4eb800aa08 On Tue, Nov 15, 2022 at 1:03 PM Nico Weber via Phabricator < revi...@reviews.llvm.org> wrote: > thakis added a comment. > > This breaks tests on windows: http://45.33.8.238/win/69993/step_7.txt > > Please take a look and revert f

Re: [PATCH] D127629: [clang] Use correct visibility parameters when following a Using declaration

2022-06-15 Thread Kadir Çetinkaya via cfe-commits
thanks! you're right, it was already included in the arcanist metadata, i was too lazy to check beforehand, sorry. On Wed, Jun 15, 2022 at 1:30 PM Furkan via Phabricator < revi...@reviews.llvm.org> wrote: > furkanusta added a comment. > > I don't think I have a commit access this is my first cont

Re: [PATCH] D127863: [clang] Dont print implicit forrange initializer

2022-06-17 Thread Kadir Çetinkaya via cfe-commits
thanks for the revert, you beat me to it. On Fri, Jun 17, 2022 at 3:07 PM Nico Weber via Phabricator < revi...@reviews.llvm.org> wrote: > thakis added a comment. > > Before landing changes, please: > > - Run tests > - Look at the result from the presubmit checks > > After landing changes, please

[clang-tools-extra] [clangd] Allow --query-driver to match a dot-normalized form of the path (PR #66757)

2023-09-19 Thread kadir çetinkaya via cfe-commits
kadircet wrote: thanks, no need for tests, the logic is rather trivial (might be worth mentioning in change notes though, so that we can build them up more naturally for the future and encourage others to do so as well) https://github.com/llvm/llvm-project/pull/66757 __

[clang-tools-extra] [clangd] Allow --query-driver to match a dot-normalized form of the path (PR #66757)

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

[clang-tools-extra] [include-cleaner] Respect the UsingShadowDecl when find headers for ambiguous std symbols. (PR #66485)

2023-09-22 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet edited https://github.com/llvm/llvm-project/pull/66485 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [include-cleaner] Respect the UsingShadowDecl when find headers for ambiguous std symbols. (PR #66485)

2023-09-22 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. thanks, lgtm! https://github.com/llvm/llvm-project/pull/66485 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [include-cleaner] Respect the UsingShadowDecl when find headers for ambiguous std symbols. (PR #66485)

2023-09-22 Thread kadir çetinkaya via cfe-commits
@@ -587,6 +588,36 @@ TEST_F(HeadersForSymbolTest, AmbiguousStdSymbols) { } } +TEST_F(HeadersForSymbolTest, AmbiguousStdSymbolsUsingShadow) { kadircet wrote: might be easier to test this in AnalysisTest, rather than writing a new ASTVisitor, but up to you.

[clang-tools-extra] [clang-tidy][IncludeCleaner] Fix analysis supression in presence of verbatim spellings (PR #68185)

2023-10-04 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet created https://github.com/llvm/llvm-project/pull/68185 None From 91ce80c89689518c20f18efd172628a51aebb769 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Wed, 4 Oct 2023 09:38:28 +0200 Subject: [PATCH] [clang-tidy][IncludeCleaner] Fix analysis supression in p

[clang-tools-extra] [clang-tidy][IncludeCleaner] Fix analysis supression in presence of verbatim spellings (PR #68185)

2023-10-04 Thread kadir çetinkaya via cfe-commits
@@ -179,12 +183,14 @@ void IncludeCleanerCheck::check(const MatchFinder::MatchResult &Result) { if (getCurrentMainFile().endswith(PHeader)) continue; } - -if (llvm::none_of( -IgnoreHeadersRegex, -[Resolved = (*I.Resolved).getFileEn

[clang-tools-extra] [clang-tidy][IncludeCleaner] Fix analysis supression in presence of verbatim spellings (PR #68185)

2023-10-04 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet updated https://github.com/llvm/llvm-project/pull/68185 From 91ce80c89689518c20f18efd172628a51aebb769 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Wed, 4 Oct 2023 09:38:28 +0200 Subject: [PATCH 1/2] [clang-tidy][IncludeCleaner] Fix analysis supression in pre

[clang-tools-extra] [clang-tidy][IncludeCleaner] Fix analysis supression in presence of verbatim spellings (PR #68185)

2023-10-04 Thread kadir çetinkaya via cfe-commits
kadircet wrote: > Thank you. What was the bug that triggered this? It seems like the verbatim > headers were only matched if they were specified as quoted in the ignore > config? I just noticed it while trying to fix an internal issue. https://github.com/llvm/llvm-project/pull/68185 _

[clang-tools-extra] [include-cleaner] don't consider the associated header unused (PR #67228)

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

[clang-tools-extra] [include-cleaner] don't consider the associated header unused (PR #67228)

2023-10-04 Thread kadir çetinkaya via cfe-commits
@@ -379,6 +379,54 @@ TEST_F(PragmaIncludeTest, IWYUKeep) { EXPECT_TRUE(PI.shouldKeep(FM.getFile("std/set").get())); } +TEST_F(PragmaIncludeTest, AssociatedHeader) { + createEmptyFiles({"foo/main.h", "bar/main.h", "bar/other.h", "std/vector"}); + auto IsKeep = [&](llvm::Str

[clang-tools-extra] [include-cleaner] don't consider the associated header unused (PR #67228)

2023-10-04 Thread kadir çetinkaya via cfe-commits
@@ -379,6 +379,54 @@ TEST_F(PragmaIncludeTest, IWYUKeep) { EXPECT_TRUE(PI.shouldKeep(FM.getFile("std/set").get())); } +TEST_F(PragmaIncludeTest, AssociatedHeader) { + createEmptyFiles({"foo/main.h", "bar/main.h", "bar/other.h", "std/vector"}); + auto IsKeep = [&](llvm::Str

[clang-tools-extra] [include-cleaner] don't consider the associated header unused (PR #67228)

2023-10-04 Thread kadir çetinkaya via cfe-commits
@@ -276,6 +280,27 @@ class PragmaIncludes::RecordPragma : public PPCallbacks, public CommentHandler { KeepStack.pop_back(); // Pop immediately for single-line keep pragma. } + // Consider marking H as the "associated header" of the main file. + // + // Our heuristi

[clang-tools-extra] [include-cleaner] don't consider the associated header unused (PR #67228)

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

<    1   2   3   4   5   6   7   8   9   >