[clang-tools-extra] [clang-include-cleaner] Fix incorrect directory issue for writing files (PR #111375)

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

[clang-tools-extra] [clang-include-cleaner] Fix incorrect directory issue for writing files (PR #111375)

2024-10-09 Thread kadir çetinkaya via cfe-commits
@@ -173,6 +173,7 @@ class Action : public clang::ASTFrontendAction { if (!HTMLReportPath.empty()) writeHTML(); +// Source File's path relative to compilation database. llvm::StringRef Path = kadircet wrote: can we keep reporting with abs-pa

[clang-tools-extra] [clang-include-cleaner] Fix incorrect directory issue for writing files (PR #111375)

2024-10-09 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet commented: thanks a lot for the revision! One concern is, we can't really use `getAllCompileCommands()` reliably either, not all compilation databases implement that, and even if they do this is gonna be an overkill. For example for chromium we'll iterate over tens

[clang] [llvm] [SystemZ][z/OS] Add new openFileForReadBinary function, and pass IsText parameter to getBufferForFile (PR #111723)

2024-10-11 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. thanks for bearing with me! https://github.com/llvm/llvm-project/pull/111723 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [lldb] [llvm] Propagate IsText parameter to openFileForRead function (PR #110661)

2024-10-07 Thread kadir çetinkaya via cfe-commits
kadircet wrote: Sorry for not responding here for a while. > These change mirror interface to getFileOrSTDIN() which has a IsText > parameter. This does touch a number of places but I feel the changes are in > line with the rest of the file I/O functions in llvm. I think there's a huge differ

[clang] [clang-format] Fix a bug in annotating angles containing FatArrow (PR #108671)

2024-09-29 Thread kadir çetinkaya via cfe-commits
@@ -243,14 +244,16 @@ class AnnotatingParser { // operator that was misinterpreted because we are parsing template // parameters. // FIXME: This is getting out of hand, write a decent parser. - if (InExpr && !Line.startsWith(tok::kw_template) && + if

[clang-tools-extra] [clangd] Improve filtering logic for undesired proto symbols (PR #110091)

2024-09-30 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet updated https://github.com/llvm/llvm-project/pull/110091 From 02e1677ed40ef23792943d9b2cb895ba80312ee9 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Thu, 26 Sep 2024 10:55:49 +0200 Subject: [PATCH] [clangd] Improve filtering logic for undesired proto symbols

[clang-tools-extra] [clangd] Improve filtering logic for undesired proto symbols (PR #110091)

2024-09-30 Thread kadir çetinkaya via cfe-commits
@@ -75,18 +76,61 @@ bool isPrivateProtoDecl(const NamedDecl &ND) { if (ND.getIdentifier() == nullptr) return false; auto Name = ND.getIdentifier()->getName(); - if (!Name.contains('_')) -return false; - // Nested proto entities (e.g. Message::Nested) have top-leve

[clang-tools-extra] [clangd] Improve filtering logic for undesired proto symbols (PR #110091)

2024-09-30 Thread kadir çetinkaya via cfe-commits
@@ -75,18 +76,61 @@ bool isPrivateProtoDecl(const NamedDecl &ND) { if (ND.getIdentifier() == nullptr) return false; auto Name = ND.getIdentifier()->getName(); - if (!Name.contains('_')) -return false; - // Nested proto entities (e.g. Message::Nested) have top-leve

[clang-tools-extra] [clangd] [C++20] [Modules] Support code complete for C++20 modules (PR #110083)

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

[clang-tools-extra] [clangd] [C++20] [Modules] Support code complete for C++20 modules (PR #110083)

2024-09-29 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet commented: thanks! https://github.com/llvm/llvm-project/pull/110083 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] [C++20] [Modules] Support code complete for C++20 modules (PR #110083)

2024-09-29 Thread kadir çetinkaya via cfe-commits
@@ -2122,7 +2125,10 @@ clang::CodeCompleteOptions CodeCompleteOptions::getClangCompleteOpts() const { // When an is used, Sema is responsible for completing the main file, // the index can provide results from the preamble. // Tell Sema not to deserialize the preamble to

[clang-tools-extra] [clangd] [C++20] [Modules] Support code complete for C++20 modules (PR #110083)

2024-09-29 Thread kadir çetinkaya via cfe-commits
@@ -52,6 +52,9 @@ struct CodeCompleteOptions { /// For example, private members are usually inaccessible. bool IncludeIneligibleResults = false; + /// Whether the experimental modules support are enabled. + bool ExperimentalModulesSupport = false; kadirc

[clang-tools-extra] [include-cleaner] Attach Header to AnalysisResults for misisng headers (PR #110272)

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

[clang-tools-extra] [clangd] [C++20] [Modules] Support code complete for C++20 modules (PR #110083)

2024-09-29 Thread kadir çetinkaya via cfe-commits
@@ -52,6 +52,11 @@ struct CodeCompleteOptions { /// For example, private members are usually inaccessible. bool IncludeIneligibleResults = false; + /// Force sema to load decls from preamble even if an index is provided. + /// This is helpful for cases the index can't pr

[clang-tools-extra] [clangd] [C++20] [Modules] Support code complete for C++20 modules (PR #110083)

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

[clang-tools-extra] [clangd] [C++20] [Modules] Support code complete for C++20 modules (PR #110083)

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

[clang] [clang-format] Fix a bug in annotating angles containing FatArrow (PR #108671)

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

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-10-21 Thread kadir çetinkaya via cfe-commits
@@ -85,19 +85,20 @@ class PrerequisiteModules { /// different versions and different source files. class ModulesBuilder { kadircet wrote: can we just introduce a new helper class ```cpp class ModulesBuilder { ... private: class ModuleFileCache; std::unique_

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-10-21 Thread kadir çetinkaya via cfe-commits
@@ -85,19 +85,20 @@ class PrerequisiteModules { /// different versions and different source files. class ModulesBuilder { public: - ModulesBuilder(const GlobalCompilationDatabase &CDB) : CDB(CDB) {} + ModulesBuilder() = default; + virtual ~ModulesBuilder() = default; Mo

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-10-21 Thread kadir çetinkaya via cfe-commits
@@ -338,17 +460,129 @@ ModulesBuilder::buildPrerequisiteModulesFor(PathRef File, return std::move(RequiredModules); } -bool StandalonePrerequisiteModules::canReuse( +ReusableModulesBuilder::ModuleBuildingSharedOwner +ReusableModulesBuilder::getOrCreateModuleBuildingOwner(Str

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

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

[clang-tools-extra] [clang-include-cleaner] Fix incorrect directory issue for writing files (PR #111375)

2024-10-17 Thread kadir çetinkaya via cfe-commits
kadircet wrote: btw, LMK if you don't have commit access and I should merge this for you https://github.com/llvm/llvm-project/pull/111375 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-10-17 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet updated https://github.com/llvm/llvm-project/pull/112517 From 01a538fbbd93a7f26e1309c9c95d5be0c8500402 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Mon, 14 Oct 2024 11:20:55 +0200 Subject: [PATCH 1/2] [clang] Introduce diagnostics suppression mappings This i

[clang-tools-extra] [clang-include-cleaner] Fix incorrect directory issue for writing files (PR #111375)

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

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-10-18 Thread kadir çetinkaya via cfe-commits
@@ -332,19 +334,22 @@ static void SetupSerializedDiagnostics(DiagnosticOptions *DiagOpts, void CompilerInstance::createDiagnostics(DiagnosticConsumer *Client, bool ShouldOwnClient) { - Diagnostics = createDiagnostics(&getDiagnosticOpt

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member function templates (PR #112345)

2024-10-18 Thread kadir çetinkaya via cfe-commits
kadircet wrote: i remember mainly two concerns; - we didn't want to surprise developers by breaking their builds as template definitions needs to be visible at instantiation sites. so if we keep the definition in the same file, just move it out-of-line, this should be fine. - i remember AST was

[clang] [llvm] [SystemZ][z/OS] Add new openFileForReadBinary function, and pass IsText parameter to getBufferForFile (PR #111723)

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

[clang] [llvm] [SystemZ][z/OS] Add new openFileForReadBinary function, and pass IsText parameter to getBufferForFile (PR #111723)

2024-10-10 Thread kadir çetinkaya via cfe-commits
@@ -271,15 +271,24 @@ class FileSystem : public llvm::ThreadSafeRefCountedBase, /// Get the status of the entry at \p Path, if one exists. virtual llvm::ErrorOr status(const Twine &Path) = 0; - /// Get a \p File object for the file at \p Path, if one exists. + /// Get a

[clang] [llvm] [SystemZ][z/OS] Add new openFileForReadBinary function, and pass IsText parameter to getBufferForFile (PR #111723)

2024-10-10 Thread kadir çetinkaya via cfe-commits
@@ -271,15 +271,24 @@ class FileSystem : public llvm::ThreadSafeRefCountedBase, /// Get the status of the entry at \p Path, if one exists. virtual llvm::ErrorOr status(const Twine &Path) = 0; - /// Get a \p File object for the file at \p Path, if one exists. + /// Get a

[clang] [llvm] [SystemZ][z/OS] Add new openFileForReadBinary function, and pass IsText parameter to getBufferForFile (PR #111723)

2024-10-10 Thread kadir çetinkaya via cfe-commits
@@ -302,6 +305,17 @@ class RealFileSystem : public FileSystem { return Storage; } + ErrorOr> openFileForRead(const Twine &Name, kadircet wrote: it was quite confusing to see this as an overload, can you call it `openFileForReadWithFlags` ? https://gi

[clang] [llvm] [SystemZ][z/OS] Add new openFileForReadBinary function, and pass IsText parameter to getBufferForFile (PR #111723)

2024-10-10 Thread kadir çetinkaya via cfe-commits
@@ -54,7 +54,9 @@ std::unique_ptr HeaderMap::Create(FileEntryRef FE, FileManager &FM) { unsigned FileSize = FE.getSize(); if (FileSize <= sizeof(HMapHeader)) return nullptr; - auto FileBuffer = FM.getBufferForFile(FE); + auto FileBuffer = + FM.getBufferForFile(FE,

[clang] [llvm] [SystemZ][z/OS] Add new openFileForReadBinary function, and pass IsText parameter to getBufferForFile (PR #111723)

2024-10-10 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet requested changes to this pull request. thanks! I think this LG at a high-level, added some comments about the details. I think it'd be worthwhile to add some tests (even if not now, probably going forward). as otherwise such rare use cases might regress quite freque

[clang] [llvm] [SystemZ][z/OS] Add new openFileForReadBinary function, and pass IsText parameter to getBufferForFile (PR #111723)

2024-10-10 Thread kadir çetinkaya via cfe-commits
@@ -292,21 +292,21 @@ class FileManager : public RefCountedBase { /// MemoryBuffer if successful, otherwise returning null. llvm::ErrorOr> getBufferForFile(FileEntryRef Entry, bool isVolatile = false, - bool RequiresNullTerminator = true, +

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-10-23 Thread kadir çetinkaya via cfe-commits
kadircet wrote: gentle ping @AaronBallman, I believe you were supportive of this approach in final version of [RFC](https://discourse.llvm.org/t/rfc-add-support-for-controlling-diagnostics-severities-at-file-level-granularity-through-command-line/81292/12?u=kadircet) but I'd like to make sure

[clang-tools-extra] [clang-include-cleaner] Fix incorrect directory issue for writing files (PR #111375)

2024-10-14 Thread kadir çetinkaya via cfe-commits
@@ -305,8 +307,46 @@ int main(int argc, const char **argv) { } } - clang::tooling::ClangTool Tool(OptionsParser->getCompilations(), - OptionsParser->getSourcePathList()); + auto VFS = llvm::vfs::getRealFileSystem(); + auto &CDB = Option

[clang-tools-extra] [clang-include-cleaner] Fix incorrect directory issue for writing files (PR #111375)

2024-10-14 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. thanks for bearing with me, LGTM! https://github.com/llvm/llvm-project/pull/111375 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang-tools-extra] [clang-include-cleaner] Fix incorrect directory issue for writing files (PR #111375)

2024-10-14 Thread kadir çetinkaya via cfe-commits
@@ -305,8 +307,46 @@ int main(int argc, const char **argv) { } } - clang::tooling::ClangTool Tool(OptionsParser->getCompilations(), - OptionsParser->getSourcePathList()); + auto VFS = llvm::vfs::getRealFileSystem(); + auto &CDB = Option

[clang-tools-extra] [clang-include-cleaner] Fix incorrect directory issue for writing files (PR #111375)

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

[clang-tools-extra] [clang-include-cleaner] Fix incorrect directory issue for writing files (PR #111375)

2024-10-14 Thread kadir çetinkaya via cfe-commits
@@ -305,8 +307,46 @@ int main(int argc, const char **argv) { } } - clang::tooling::ClangTool Tool(OptionsParser->getCompilations(), - OptionsParser->getSourcePathList()); + auto VFS = llvm::vfs::getRealFileSystem(); + auto &CDB = Option

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-10-29 Thread kadir çetinkaya via cfe-commits
@@ -477,6 +486,109 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor Flavor, setSeverity(Diag, Map, Loc); } +namespace { +class WarningsSpecialCaseList : public llvm::SpecialCaseList { +public: + static std::unique_ptr + create(const llvm::MemoryBuffer &MB, st

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-10-29 Thread kadir çetinkaya via cfe-commits
@@ -575,25 +575,42 @@ DiagnosticIDs::getDiagnosticSeverity(unsigned DiagID, SourceLocation Loc, DiagID != diag::fatal_too_many_errors && Diag.FatalsAsError) Result = diag::Severity::Error; + // Rest of the mappings are only applicable for diagnostics associated wit

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-10-29 Thread kadir çetinkaya via cfe-commits
@@ -575,25 +575,42 @@ DiagnosticIDs::getDiagnosticSeverity(unsigned DiagID, SourceLocation Loc, DiagID != diag::fatal_too_many_errors && Diag.FatalsAsError) Result = diag::Severity::Error; + // Rest of the mappings are only applicable for diagnostics associated wit

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-10-29 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet updated https://github.com/llvm/llvm-project/pull/112517 From c0d2e4590308ebaaee78d7fe130a72b8586f6a88 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Mon, 14 Oct 2024 11:20:55 +0200 Subject: [PATCH 1/5] [clang] Introduce diagnostics suppression mappings This i

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-10-29 Thread kadir çetinkaya via cfe-commits
@@ -477,6 +486,109 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor Flavor, setSeverity(Diag, Map, Loc); } +namespace { +class WarningsSpecialCaseList : public llvm::SpecialCaseList { +public: + static std::unique_ptr + create(const llvm::MemoryBuffer &MB, st

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-10-29 Thread kadir çetinkaya via cfe-commits
@@ -946,6 +953,24 @@ class DiagnosticsEngine : public RefCountedBase { return (Level)Diags->getDiagnosticLevel(DiagID, Loc, *this); } + /// Diagnostic suppression mappings can be used to ignore diagnostics based on + /// the file they occur in. Mapping file is expect

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-10-22 Thread kadir çetinkaya via cfe-commits
@@ -108,6 +108,9 @@ class DiagnosticOptions : public RefCountedBase{ /// The file to serialize diagnostics to (non-appending). std::string DiagnosticSerializationFile; + /// File that defines suppression mappings. kadircet wrote: I was dropping that mos

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-10-22 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet updated https://github.com/llvm/llvm-project/pull/112517 From 01a538fbbd93a7f26e1309c9c95d5be0c8500402 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Mon, 14 Oct 2024 11:20:55 +0200 Subject: [PATCH 1/3] [clang] Introduce diagnostics suppression mappings This i

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-10-22 Thread kadir çetinkaya via cfe-commits
@@ -946,6 +952,13 @@ class DiagnosticsEngine : public RefCountedBase { return (Level)Diags->getDiagnosticLevel(DiagID, Loc, *this); } + /// Diagnostic suppression mappings can be used to ignore diagnostics based on + /// the file they occur in. + /// These take pres

[clang] [Tooling/Inclusion] Add binary search related `std::ranges` symbols to the mapping. (PR #113796)

2024-10-29 Thread kadir çetinkaya via cfe-commits
kadircet wrote: can you move these changes into `clang/lib/Tooling/Inclusions/Stdlib/StdSpecialSymbolMap.inc`? that's the hand-curated version, we try to autogenerate the other one by parsing cppreference. https://github.com/llvm/llvm-project/pull/113796 __

[clang] [Tooling/Inclusion] Update std symbols mapping (PR #113612)

2024-10-29 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet requested changes to this pull request. thanks a ton for the comprehensive change, i think this looks amazing! can you just move the parser changes into a separate PR and revert changes in the assertion and rather delete the duplicates from stdspecialsymbolmap? http

[clang] [Tooling/Inclusion] Update std symbols mapping (PR #113612)

2024-10-29 Thread kadir çetinkaya via cfe-commits
@@ -232,6 +232,47 @@ SYMBOL(ssize, std::, ) SYMBOL(ssize, std::, ) SYMBOL(ssize, std::, ) SYMBOL(ssize, std::, ) +// C++ [range.access.general]: ... the customization point objects +// in [range.access] are available when the header is included. +SYMBOL(begin, std::ranges::, )

[clang] [Tooling/Inclusion] Update std symbols mapping (PR #113612)

2024-10-29 Thread kadir çetinkaya via cfe-commits
@@ -232,6 +232,37 @@ SYMBOL(ssize, std::, ) SYMBOL(ssize, std::, ) SYMBOL(ssize, std::, ) SYMBOL(ssize, std::, ) +// C++ [range.access.general]: ... the customization point objects +// in [range.access] are available when the header is included. +SYMBOL(begin, std::ranges::, )

[clang] [Tooling/Inclusion] Update std symbols mapping (PR #113612)

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

[clang] [Tooling/Inclusion] Update std symbols mapping (PR #113612)

2024-10-29 Thread kadir çetinkaya via cfe-commits
@@ -115,15 +115,17 @@ static int initialize(Lang Language) { NSLen = 0; } -if (SymIndex >= 0 && -Mapping->SymbolNames[SymIndex].qualifiedName() == QName) { - // Not a new symbol, use the same index. +if (SymIndex > 0) { assert(llvm::none_o

[clang] [Tooling/Inclusion] Update std symbols mapping (PR #113612)

2024-10-29 Thread kadir çetinkaya via cfe-commits
@@ -352,20 +383,23 @@ SYMBOL(get, std::, /*no headers*/) // providing the type. SYMBOL(make_error_code, std::, /*no headers*/) SYMBOL(make_error_condition, std::, /*no headers*/) +// Similar to std::get, has variants for multiple containers +// (vector, deque, list, etc.) +SYMB

[clang] [Tooling/Inclusion] Update std symbols mapping (PR #113612)

2024-10-29 Thread kadir çetinkaya via cfe-commits
kadircet wrote: can you send this in a separate PR ? https://github.com/llvm/llvm-project/pull/113612 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] [Modules] Use ASTReader directly in IsModuleFileUpToDate (PR #113879)

2024-10-29 Thread kadir çetinkaya via cfe-commits
@@ -127,50 +128,65 @@ struct ModuleFile { std::string ModuleFilePath; }; -bool IsModuleFileUpToDate( -PathRef ModuleFilePath, -const PrerequisiteModules &RequisiteModules) { -IntrusiveRefCntPtr Diags = - CompilerInstance::createDiagnostics(new DiagnosticOptions(

[clang-tools-extra] [clangd] [Modules] Use ASTReader directly in IsModuleFileUpToDate (PR #113879)

2024-10-29 Thread kadir çetinkaya via cfe-commits
@@ -127,50 +128,65 @@ struct ModuleFile { std::string ModuleFilePath; }; -bool IsModuleFileUpToDate( -PathRef ModuleFilePath, -const PrerequisiteModules &RequisiteModules) { -IntrusiveRefCntPtr Diags = - CompilerInstance::createDiagnostics(new DiagnosticOptions(

[clang-tools-extra] [clangd] [Modules] Use ASTReader directly in IsModuleFileUpToDate (PR #113879)

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

[clang] [Tooling/Inclusion] Update std symbols mapping (PR #113612)

2024-10-30 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. thanks a lot, lgtm! LMK if i should commit this for you https://github.com/llvm/llvm-project/pull/113612 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [Tooling/Inclusion] Add binary search related `std::ranges` symbols to the mapping. (PR #113796)

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

[clang] [Tooling/Inclusion] Update std symbols mapping (PR #113612)

2024-10-30 Thread kadir çetinkaya via cfe-commits
@@ -115,15 +115,17 @@ static int initialize(Lang Language) { NSLen = 0; } -if (SymIndex >= 0 && -Mapping->SymbolNames[SymIndex].qualifiedName() == QName) { - // Not a new symbol, use the same index. +if (SymIndex > 0) { assert(llvm::none_o

[clang] [Tooling/Inclusion] Add binary search related `std::ranges` symbols to the mapping. (PR #113796)

2024-10-30 Thread kadir çetinkaya via cfe-commits
@@ -411,6 +411,11 @@ SYMBOL(_27, std::placeholders::, ) SYMBOL(_28, std::placeholders::, ) SYMBOL(_29, std::placeholders::, ) +SYMBOL(binary_search, std::ranges::, ) kadircet wrote: can you move this next to https://github.com/llvm/llvm-project/blob/2de1fc82

[clang] [Tooling/Inclusion] Add binary search related `std::ranges` symbols to the mapping. (PR #113796)

2024-10-30 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet approved this pull request. thanks, lgtm! let me know if i should land this for you https://github.com/llvm/llvm-project/pull/113796 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-11-04 Thread kadir çetinkaya via cfe-commits
@@ -316,36 +294,205 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName, if (Clang->getDiagnostics().hasErrorOccurred()) return llvm::createStringError("Compilation failed"); - BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output); - return llv

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-11-04 Thread kadir çetinkaya via cfe-commits
@@ -316,36 +294,205 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName, if (Clang->getDiagnostics().hasErrorOccurred()) return llvm::createStringError("Compilation failed"); - BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output); - return llv

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-11-04 Thread kadir çetinkaya via cfe-commits
@@ -316,36 +294,205 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName, if (Clang->getDiagnostics().hasErrorOccurred()) return llvm::createStringError("Compilation failed"); - BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output); - return llv

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-11-04 Thread kadir çetinkaya via cfe-commits
@@ -316,36 +294,205 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName, if (Clang->getDiagnostics().hasErrorOccurred()) return llvm::createStringError("Compilation failed"); - BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output); - return llv

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

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

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-11-04 Thread kadir çetinkaya via cfe-commits
@@ -316,36 +294,205 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName, if (Clang->getDiagnostics().hasErrorOccurred()) return llvm::createStringError("Compilation failed"); - BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output); - return llv

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-11-04 Thread kadir çetinkaya via cfe-commits
@@ -316,36 +294,205 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName, if (Clang->getDiagnostics().hasErrorOccurred()) return llvm::createStringError("Compilation failed"); - BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output); - return llv

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-11-04 Thread kadir çetinkaya via cfe-commits
@@ -228,54 +223,30 @@ class StandalonePrerequisiteModules : public PrerequisiteModules { return BuiltModuleNames.contains(ModuleName); } - void addModuleFile(llvm::StringRef ModuleName, - llvm::StringRef ModuleFilePath) { -RequiredModules.emplac

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-11-04 Thread kadir çetinkaya via cfe-commits
@@ -316,36 +287,169 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName, if (Clang->getDiagnostics().hasErrorOccurred()) return llvm::createStringError("Compilation failed"); - BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output); - return llv

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-11-04 Thread kadir çetinkaya via cfe-commits
@@ -316,36 +287,169 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName, if (Clang->getDiagnostics().hasErrorOccurred()) return llvm::createStringError("Compilation failed"); - BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output); - return llv

[clang-tools-extra] [clangd] Fix use-after-free issues in TidyProvider.cpp (PR #114808)

2024-11-04 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet requested changes to this pull request. can we instead change the function return types to be `TidyProvider` ? unless there's something we get by making these static lambdas (which isn't obvious to me). https://github.com/llvm/llvm-project/pull/114808 __

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-11-04 Thread kadir çetinkaya via cfe-commits
@@ -599,6 +600,19 @@ DiagnosticIDs::getDiagnosticSeverity(unsigned DiagID, SourceLocation Loc, SM.isInSystemMacro(Loc)) return diag::Severity::Ignored; + // Apply suppression mappings if severity wasn't explicitly mapped with a + // clang-diagnostics pragma to ens

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-11-04 Thread kadir çetinkaya via cfe-commits
@@ -122,7 +122,6 @@ class SpecialCaseList { // Returns zero if no match is found. unsigned match(StringRef Query) const; - private: StringMap> Globs; kadircet wrote: thanks, and I'd like to address these in a follow-up refactoring, sent out htt

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-11-04 Thread kadir çetinkaya via cfe-commits
@@ -70,6 +76,16 @@ void clang::ProcessWarningOptions(DiagnosticsEngine &Diags, else Diags.setExtensionHandlingBehavior(diag::Severity::Ignored); + if (!Opts.DiagnosticSuppressionMappingsFile.empty()) { +if (auto Buf = kadircet wrote: sure, i think

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-11-04 Thread kadir çetinkaya via cfe-commits
@@ -167,4 +176,159 @@ TEST(DiagnosticTest, storedDiagEmptyWarning) { // Make sure an empty warning can round-trip with \c StoredDiagnostic. Diags.Report(CaptureConsumer.StoredDiags.front()); } + +class SuppressionMappingTest : public testing::Test { kadirce

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-11-04 Thread kadir çetinkaya via cfe-commits
@@ -477,6 +485,100 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor Flavor, setSeverity(Diag, Map, Loc); } +namespace { +class WarningsSpecialCaseList : public llvm::SpecialCaseList { kadircet wrote: also see https://discourse.llvm.org/t/refac

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-11-04 Thread kadir çetinkaya via cfe-commits
kadircet wrote: this is already tested in https://github.com/llvm/llvm-project/pull/112517/files#diff-a8d03c054381627f238bdb8f7914daa4abebdae705d313dda026ce36eca0fe2fR327-R332 https://github.com/llvm/llvm-project/pull/112517 ___

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-11-04 Thread kadir çetinkaya via cfe-commits
@@ -477,6 +486,109 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor Flavor, setSeverity(Diag, Map, Loc); } +namespace { +class WarningsSpecialCaseList : public llvm::SpecialCaseList { +public: + static std::unique_ptr + create(const llvm::MemoryBuffer &MB, st

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-11-04 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet updated https://github.com/llvm/llvm-project/pull/112517 From 20f1c1fea3466de38a04b5486cb05d95dbe3b96c Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Mon, 14 Oct 2024 11:20:55 +0200 Subject: [PATCH 1/7] [clang] Introduce diagnostics suppression mappings This i

[clang-tools-extra] [clangd] Fix use-after-free issues in TidyProvider.cpp (PR #114808)

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

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-11-04 Thread kadir çetinkaya via cfe-commits
@@ -316,36 +294,205 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName, if (Clang->getDiagnostics().hasErrorOccurred()) return llvm::createStringError("Compilation failed"); - BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output); - return llv

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-11-04 Thread kadir çetinkaya via cfe-commits
@@ -122,7 +122,6 @@ class SpecialCaseList { // Returns zero if no match is found. unsigned match(StringRef Query) const; - private: StringMap> Globs; kadircet wrote: these are members of `SpecialCaseList::Matcher`. `WarningsSpecialCaseList` is

[clang-tools-extra] [clangd] Add quick fix to automatically adds NOLINTNEXTLINE comment (PR #114661)

2024-11-04 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet requested changes to this pull request. thanks a lot for this patch! I am not sure if this is a "good" fix-it for C++ ecosystem. As it'll make suppression way easier. Today people needs to decide whether a suppression is warranted, and explain it in a comment. at th

[clang] [Tooling/Inclusion] Update std symbols mapping (PR #113612)

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

[clang] [Tooling/Inclusion] Update std symbols mapping (PR #113612)

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

[clang-tools-extra] [clangd] [Modules] Use ASTReader directly in IsModuleFileUpToDate (PR #113879)

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

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-11-01 Thread kadir çetinkaya via cfe-commits
@@ -477,6 +486,109 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor Flavor, setSeverity(Diag, Map, Loc); } +namespace { +class WarningsSpecialCaseList : public llvm::SpecialCaseList { +public: + static std::unique_ptr + create(const llvm::MemoryBuffer &MB, st

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-11-01 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet updated https://github.com/llvm/llvm-project/pull/112517 From 20f1c1fea3466de38a04b5486cb05d95dbe3b96c Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Mon, 14 Oct 2024 11:20:55 +0200 Subject: [PATCH 1/6] [clang] Introduce diagnostics suppression mappings This i

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-11-01 Thread kadir çetinkaya via cfe-commits
@@ -0,0 +1,92 @@ + +Warning suppression mappings + + +.. contents:: + :local: + +Introduction + + +Warning suppression mappings enables users to suppress clang's diagnostics in a +per-file granular manner. Enabl

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-11-01 Thread kadir çetinkaya via cfe-commits
@@ -477,6 +486,109 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor Flavor, setSeverity(Diag, Map, Loc); } +namespace { +class WarningsSpecialCaseList : public llvm::SpecialCaseList { +public: + static std::unique_ptr + create(const llvm::MemoryBuffer &MB, st

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-11-01 Thread kadir çetinkaya via cfe-commits
@@ -1315,6 +1319,29 @@ with its corresponding `Wno-` option. Note that when combined with :option:`-w` (which disables all warnings), disabling all warnings wins. +.. _warning_suppression_mappings: + +Controlling Diagnostics via Suppression Mappings +^^

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-11-01 Thread kadir çetinkaya via cfe-commits
@@ -477,6 +486,109 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor Flavor, setSeverity(Diag, Map, Loc); } +namespace { +class WarningsSpecialCaseList : public llvm::SpecialCaseList { +public: + static std::unique_ptr + create(const llvm::MemoryBuffer &MB, st

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-11-01 Thread kadir çetinkaya via cfe-commits
@@ -70,6 +76,16 @@ void clang::ProcessWarningOptions(DiagnosticsEngine &Diags, else Diags.setExtensionHandlingBehavior(diag::Severity::Ignored); + if (!Opts.DiagnosticSuppressionMappingsFile.empty()) { +if (auto Buf = kadircet wrote: i think [Buf]

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-11-01 Thread kadir çetinkaya via cfe-commits
@@ -4493,6 +4493,13 @@ static void RenderDiagnosticsOptions(const Driver &D, const ArgList &Args, Args.addOptOutFlag(CmdArgs, options::OPT_fspell_checking, options::OPT_fno_spell_checking); + + if (const Arg *A = + Args.getLastArg(options::OPT

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-11-01 Thread kadir çetinkaya via cfe-commits
@@ -477,6 +486,109 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor Flavor, setSeverity(Diag, Map, Loc); } +namespace { +class WarningsSpecialCaseList : public llvm::SpecialCaseList { +public: + static std::unique_ptr + create(const llvm::MemoryBuffer &MB, st

<    1   2   3   4   5   6   7   8   9   >