[PATCH] D92990: [clangd] Provide suggestions with invalid config keys

2020-12-10 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. Adding in support for fix-its(at least in vscode) didn't seem to work. The language server there doesn't seem to send the `textDocument/codeAction` message to the server for the `.clangd` file. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https:/

[PATCH] D92267: [clang-tidy][NFC] Use moves instead of copies when constructing OptionsProviders.

2020-12-10 Thread Nathan James via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGbedf3a0f5071: [clang-tidy][NFC] Use moves instead of copies when constructing… (authored by njames93). Repository: rG LLVM Github Monorepo CHANGE

[PATCH] D93024: [clang-tidy] Use a MemoryBufferRef when parsing configuration files.

2020-12-10 Thread Nathan James via Phabricator via cfe-commits
njames93 created this revision. njames93 added reviewers: aaron.ballman, alexfh. Herald added subscribers: usaxena95, kadircet, arphaman, xazax.hun. njames93 requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Using a MemoryBufferRef, If there

[PATCH] D92992: [clang-tidy] Add make_unique_for_overwrite/make_shared_for_overwrite check.

2020-12-10 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. I'm definitely of the opinion this should be an option in the `modernize-make-(shared|unique)` check Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92992/new/ https://reviews.llvm.org/D92992 __

[PATCH] D93024: [clang-tidy] Use a MemoryBufferRef when parsing configuration files.

2020-12-10 Thread Nathan James via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG34d2688a50f2: [clang-tidy] Use a MemoryBufferRef when parsing configuration files. (authored by njames93). Repository: rG LLVM Github Monorepo CH

[PATCH] D92986: [clangd][NFC] Remove unnecessary vector.

2020-12-10 Thread Nathan James via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGa0cf2b8f712e: [clangd][NFC] Remove unnecessary vector. (authored by njames93). Changed prior to commit: https://reviews.llvm.org/D92986?vs=310729&

[PATCH] D92920: [clang-tidy] Add a diagnostic callback to parseConfiguration

2020-12-10 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 310894. njames93 added a comment. Herald added a subscriber: mgorny. Added test cases. Added assert to ensure Handler is valid. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92920/new/ https://reviews.llvm.org

[PATCH] D92920: [clang-tidy] Add a diagnostic callback to parseConfiguration

2020-12-10 Thread Nathan James via Phabricator via cfe-commits
njames93 marked an inline comment as done. njames93 added inline comments. Comment at: clang-tools-extra/clang-tidy/ClangTidyOptions.cpp:400 +DiagCallback Handler) { + llvm::yaml::Input Input(Config, nullptr, Handler ? diagHandlerImpl : nullptr, +

[PATCH] D92920: [clang-tidy] Add a diagnostic callback to parseConfiguration

2020-12-10 Thread Nathan James via Phabricator via cfe-commits
njames93 added inline comments. Comment at: clang-tools-extra/clang-tidy/ClangTidyOptions.cpp:400 +DiagCallback Handler) { + llvm::yaml::Input Input(Config, nullptr, Handler ? diagHandlerImpl : nullptr, + &Handler); --

[PATCH] D92990: [clangd] Provide suggestions with invalid config keys

2020-12-10 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 311067. njames93 marked 3 inline comments as done. njames93 added a comment. Address some comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92990/new/ https://reviews.llvm.org/D92990 Files: clang-tools

[PATCH] D92990: [clangd] Provide suggestions with invalid config keys

2020-12-10 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. In D92990#2446097 , @sammccall wrote: > This is cool! Detecting basic typos could save a fair bit of time. > I do want to be a bit wary of spending too much complexity on small > enhancements to rarely used code - if it's more th

[PATCH] D92874: [clangd] Validate clang-tidy Checks in clangd config.

2020-12-10 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 311094. njames93 added a comment. Dont check for globs coverage instead use a fast set based approach that only matches tidy checks exactly. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92874/new/ https://re

[PATCH] D93113: [clangd] Use enumMember instead of enumConstant

2020-12-11 Thread Nathan James via Phabricator via cfe-commits
njames93 created this revision. njames93 added reviewers: sammccall, hokein. Herald added subscribers: usaxena95, kadircet, arphaman. njames93 requested review of this revision. Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov. Herald added a project: clang. We should be using enumMem

[PATCH] D93113: [clangd] Use enumMember instead of enumConstant

2020-12-11 Thread Nathan James via Phabricator via cfe-commits
njames93 added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.h:51 Enum, - EnumConstant, + EnumMember, Typedef, sammccall wrote: > `HighlightingKind` is an internal enum that doesn't match LSP naming, so no > need for changes

[PATCH] D93113: [clangd] Use enumMember instead of enumConstant

2020-12-11 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 311215. njames93 marked an inline comment as done. njames93 added a comment. Remove changes to internal infrastructure. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93113/new/ https://reviews.llvm.org/D93113

[PATCH] D93113: [clangd] Use enumMember instead of enumConstant

2020-12-11 Thread Nathan James via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG62b4a69969c3: [clangd] Use enumMember instead of enumConstant (authored by njames93). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTI

[PATCH] D92756: [clang-tidy] Support all YAML supported spellings for bools in CheckOptions.

2020-12-12 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 311388. njames93 added a comment. Fix test failures and added some to demonstrate this behaviour. Haven't added exhaustive cases as they are present in the YAML parser tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://review

[PATCH] D92920: [clang-tidy] Add a diagnostic callback to parseConfiguration

2020-12-12 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 311391. njames93 added a comment. Fix up test case now bug in yaml error locations has been fixed Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92920/new/ https://reviews.llvm.org/D92920 Files: clang-tools-

[PATCH] D93182: [clang-tidy] Add linux kernel log functions checker

2020-12-13 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. This check needs documentation adding in `clang-tools-extra/docs/clang-tidy/checks/linux-kernel-logfunctions-h.rst` Also needs to add this in `clang-tools-extra/docs/clang-tidy/checks/list.rst`, keeping it in alphabetical order. Also need to add an entry to `clang-tools

[PATCH] D93220: [clangd] Add error handling (elog) in code completion.

2020-12-14 Thread Nathan James via Phabricator via cfe-commits
njames93 added inline comments. Comment at: clang-tools-extra/clangd/CodeComplete.cpp:187-188 + if (auto Header = headerToInsertIfAllowed(Opts)) { +auto HeaderFile = toHeaderFile(*Header, FileName); +if (HeaderFile) { if (auto Spelled = ---

[PATCH] D92874: [clangd] Validate clang-tidy Checks in clangd config.

2020-12-15 Thread Nathan James via Phabricator via cfe-commits
njames93 marked 2 inline comments as done. njames93 added inline comments. Comment at: clang-tools-extra/clangd/ConfigCompile.cpp:26 +#include "../clang-tidy/ClangTidyModuleRegistry.h" #include "CompileCommands.h" sammccall wrote: > This is a pretty weird plac

[PATCH] D92874: [clangd] Validate clang-tidy Checks in clangd config.

2020-12-15 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 311926. njames93 added a comment. Address some comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92874/new/ https://reviews.llvm.org/D92874 Files: clang-tools-extra/clangd/ConfigCompile.cpp clang-too

[PATCH] D92990: [clangd] Provide suggestions with invalid config keys

2020-12-15 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 311934. njames93 marked 3 inline comments as done. njames93 added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92990/new/ https://reviews.llvm.org/D92990 Files: clang-tools-ext

[PATCH] D92874: [clangd] Validate clang-tidy Checks in clangd config.

2020-12-15 Thread Nathan James via Phabricator via cfe-commits
njames93 marked 4 inline comments as done. njames93 added inline comments. Comment at: clang-tools-extra/clangd/ConfigCompile.cpp:58 + assert(!Check.contains('*') && "isRegisteredCheck doesn't support globs"); + assert(Check.trim().size() == Check.size() && + "Check has

[PATCH] D92874: [clangd] Validate clang-tidy Checks in clangd config.

2020-12-15 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 311948. njames93 marked 2 inline comments as done. njames93 added a comment. Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92874/new/ https://reviews.llvm.org/D92874 Files: clang-tools-extr

[PATCH] D92990: [clangd] Provide suggestions with invalid config keys

2020-12-15 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 311949. njames93 marked 2 inline comments as done. njames93 added a comment. Last nits. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92990/new/ https://reviews.llvm.org/D92990 Files: clang-tools-extra/clan

[PATCH] D92990: [clangd] Provide suggestions with invalid config keys

2020-12-15 Thread Nathan James via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGcfa1010c4242: [clangd] Provide suggestions with invalid config keys (authored by njames93). Repository: rG LLVM Github Monorepo CHANGES SINCE LAS

[PATCH] D92874: [clangd] Validate clang-tidy Checks in clangd config.

2020-12-15 Thread Nathan James via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGdfac97d55769: [clangd] Validate clang-tidy Checks in clangd config. (authored by njames93). Repository: rG LLVM Github Monorepo CHANGES SINCE LAS

[PATCH] D92756: [clang-tidy] Support all YAML supported spellings for bools in CheckOptions.

2020-12-15 Thread Nathan James via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG68e642cad024: [clang-tidy] Support all YAML supported spellings for bools in CheckOptions. (authored by njames93). Repository: rG LLVM Github Mono

[PATCH] D86671: [clang-tidy] Add new case type to check variables with Hungarian notation

2020-12-15 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. One last point, is there a way to validate that these options are only set where it makes sense. If someone tries to use say `MacroDefinitionHungarianPrefix` That could be warning worthy? Comment at: clang-tools-extra/clang-tidy/readability/Identifi

[PATCH] D93354: [clang-tidy] Make clang-format and include-order-check coherent again

2020-12-15 Thread Nathan James via Phabricator via cfe-commits
njames93 created this revision. njames93 added reviewers: hokein, kadircet. Herald added a subscriber: xazax.hun. njames93 requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. After D91602 gmock support was adde

[PATCH] D92920: [clang-tidy] Add a diagnostic callback to parseConfiguration

2020-12-15 Thread Nathan James via Phabricator via cfe-commits
njames93 added inline comments. Comment at: clang-tools-extra/clang-tidy/ClangTidyOptions.cpp:400 +DiagCallback Handler) { + llvm::yaml::Input Input(Config, nullptr, Handler ? diagHandlerImpl : nullptr, + &Handler); --

[PATCH] D92920: [clang-tidy] Add a diagnostic callback to parseConfiguration

2020-12-15 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 312080. njames93 added a comment. Added back null check Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92920/new/ https://reviews.llvm.org/D92920 Files: clang-tools-extra/clang-tidy/ClangTidyOptions.cpp cl

[PATCH] D92920: [clang-tidy] Add a diagnostic callback to parseConfiguration

2020-12-16 Thread Nathan James via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGddffcdf0a660: [clang-tidy] Add a diagnostic callback to parseConfiguration (authored by njames93). Repository: rG LLVM Github Monorepo CHANGES SI

[PATCH] D93436: [clangd] Print .clang-tidy configuration parsing errors using [ev]?log.

2020-12-16 Thread Nathan James via Phabricator via cfe-commits
njames93 created this revision. njames93 added a reviewer: sammccall. Herald added subscribers: usaxena95, kadircet, arphaman. njames93 requested review of this revision. Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov. Herald added a project: clang. Currently warnings when parsing .

[PATCH] D86137: Add -Wno-error=unknown flag to clang-format.

2020-12-17 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. Herald added a subscriber: dexonsmith. I think the `=` in the option name is confusing the option parser, ➜ clang-format --Wno-error=unknown clang-format: Unknown command line argument '--Wno-error=unknown'. Try: 'clang-format --help' clang-format: Did you mean

[PATCH] D93452: [clangd] Trim memory after buildINdex

2020-12-17 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. `malloc_trim` isn't available on windows so this wont work, so this should likely be ifdef'd out on windows builds. Side note is this memory failing to free behaviour observed on windows? Comment at: clang-tools-extra/clangd/index/FileIndex.cpp:51 +v

[PATCH] D93459: Fix -Wno-error= parsing in clang-format.

2020-12-17 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. In D93459#2460445 , @fodinabor wrote: > Btw. is there a way to add tests for command-line options, so this won't > happen unnoticed again? I'd guess some lit tests could be used to verify the command line syntax is correct /

[PATCH] D93436: [clangd] Print .clang-tidy configuration parsing errors using [ev]?log.

2020-12-17 Thread Nathan James via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2808f597f872: [clangd] Print .clang-tidy configuration parsing errors using [ev]?log. (authored by njames93). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D9

[PATCH] D93452: [clangd] Trim memory after buildINdex

2020-12-18 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. In D93452#2460563 , @sammccall wrote: > I think we should pass a nonzero `pad` to malloc_trim of several MB. It only > affects the main thread, but the main thread is constantly allocating small > short-lived objects (e.g. JSON

[PATCH] D93531: [clangd] Reuse buffer for JSONTransport::readRawMessage

2020-12-18 Thread Nathan James via Phabricator via cfe-commits
njames93 created this revision. njames93 added a reviewer: sammccall. Herald added subscribers: usaxena95, kadircet, arphaman. njames93 requested review of this revision. Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov. Herald added a project: clang. Reusing the buffers for reading m

[PATCH] D72241: [clang-tidy] new altera single work item barrier check

2020-12-18 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. In D72241#2461921 , @ffrankies wrote: > @aaron.ballman hmm, that is strange. I've rebased the patch and updated the > diff, let me know if this one doesn't work either or there's something else > you'd like me to try. Thanks! Fo

[PATCH] D93531: [clangd] Reuse buffer for JSONTransport::readRawMessage

2020-12-18 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. 100% sure that failure is from trunk Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93531/new/ https://reviews.llvm.org/D93531 ___ cfe-commits mailing list cfe-commits@lists.llvm

[PATCH] D93531: [clangd] Reuse buffer for JSONTransport::readRawMessage

2020-12-18 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 312780. njames93 added a comment. Extend buffer behaviour to sendMessage. Calls to this function seem to be guarded(up the call stack) by a mutex so again we shouldn't worry about races. Besides there is no synchronization in the function currently when wri

[PATCH] D93531: [clangd] Reuse buffer for JSONTransport::readRawMessage

2020-12-18 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. In D93531#2463052 , @sammccall wrote: > This adds a bit of complexity, making the code here a fair amount harder to > follow and verify the correctness of. > > - Do we have evidence that these allocations are causing a problem? (

[PATCH] D93531: [clangd] Reuse buffer for JSONTransport::readRawMessage

2020-12-18 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 312796. njames93 added a comment. Moved a few members out of the class. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93531/new/ https://reviews.llvm.org/D93531 Files: clang-tools-extra/clangd/JSONTransport

[PATCH] D72235: [clang-tidy] new altera unroll loops check

2020-12-18 Thread Nathan James via Phabricator via cfe-commits
njames93 added inline comments. Comment at: clang-tools-extra/clang-tidy/altera/UnrollLoopsCheck.cpp:22 +void UnrollLoopsCheck::registerMatchers(MatchFinder *Finder) { + const auto ANYLOOP = anyOf(forStmt(), whileStmt(), doStmt()); + Finder->addMatcher(stmt(allOf(ANYLOOP, // Ma

[PATCH] D93531: [clangd] Reuse buffer for JSONTransport::readRawMessage

2020-12-19 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 312930. njames93 added a comment. Remove input buffers, but keep output as its easy to reason about. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93531/new/ https://reviews.llvm.org/D93531 Files: clang-too

[PATCH] D93452: [clangd] Trim memory periodically

2020-12-19 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. Just attached a debugger and ran malloc_trim on my clangd instance which was sitting at 6.7GB, afterwards it was 1.3GB. Interestingly clangd held rock solid at 1.0GB recorded memory usage throughout. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION h

[PATCH] D84924: [clang-tidy][WIP] Added command line option `fix-notes`

2020-12-21 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 313080. njames93 marked 2 inline comments as done. njames93 added a comment. Use enum for handling fix behaviour. Fix tests using `--fix-notes` instead of `-fix-notes`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.

[PATCH] D84924: [clang-tidy] Added command line option `fix-notes`

2020-12-21 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. In D84924#2446075 , @aaron.ballman wrote: > In D84924#2184132 , @njames93 wrote: > >> This is very much a work in progress >> Another direction I was thinking was only apply the fixes foun

[PATCH] D93543: clang-tidy: Leave the possibility of opting out having coloured diagnostic messages.

2020-12-21 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. Would it be wise to use `os.isatty(sys.stdout.fileno())` as the value if left unspecified. As we capture stdout from clang-tidy, clang-tidy assumes we aren't connected to a terminal and thus disables colours, unless explicitly enabled. Therefore if our python script is

[PATCH] D93633: [format] Add overload to parseConfiguration that accept llvm::MemoryBufferRef

2020-12-21 Thread Nathan James via Phabricator via cfe-commits
njames93 created this revision. njames93 added reviewers: MyDeveloperDay, fodinabor, JakeMerdichAMD. njames93 requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This overload should be used for better diagnostics when parsing configurations. N

[PATCH] D93633: [format] Add overload to parseConfiguration that accept llvm::MemoryBufferRef

2020-12-21 Thread Nathan James via Phabricator via cfe-commits
njames93 added inline comments. Comment at: clang/include/clang/Format/Format.h:2946-2951 +/// Like above but accepts an unnamed buffer. +inline std::error_code parseConfiguration(StringRef Config, FormatStyle *Style, + bool AllowUnknownOp

[PATCH] D93452: [clangd] Trim memory periodically

2020-12-22 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. I feel like we need some kind of entry for this in release notes given how much of an issue it is. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93452/new/ https://reviews.llvm.org/D93452

[PATCH] D84924: [clang-tidy] Added command line option `fix-notes`

2020-12-22 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. In D84924#2466564 , @aaron.ballman wrote: > Agreed, but I don't think the current behavior in this patch is cautious > enough. I like that we have to specify "please apply fixits from notes" > explicitly. I think that's the rig

[PATCH] D84924: [clang-tidy] Added command line option `fix-notes`

2020-12-22 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 313272. njames93 added a comment. Only apply fixes from notes if there is exactly one fix found in them. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84924/new/ https://reviews.llvm.org/D84924 Files: clang

[PATCH] D93531: [clangd] Reuse buffer for JSONTransport::sendMessage

2020-12-22 Thread Nathan James via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4b3633cf2cb6: [clangd] Reuse buffer for JSONTransport::sendMessage (authored by njames93). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93531/new/ https://

[PATCH] D93733: [NFC] replace resize calls with resize_for_overwrite

2020-12-23 Thread Nathan James via Phabricator via cfe-commits
njames93 created this revision. Herald added subscribers: dexonsmith, asbirlea, hiraditya. njames93 published this revision for review. Herald added projects: clang, LLDB, LLVM. Herald added subscribers: llvm-commits, lldb-commits, cfe-commits. Also replace a few calls to resize followed by zeroin

[PATCH] D93758: [format][NFC] Use unsigned char as the base of all enums in FormatStyle

2020-12-23 Thread Nathan James via Phabricator via cfe-commits
njames93 created this revision. njames93 added a reviewer: MyDeveloperDay. njames93 requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This removes alot of unnecessary padding, trimming the size of the struct from 728->608 on 64 bit platforms

[PATCH] D93633: [format] Add overload to parseConfiguration that accept llvm::MemoryBufferRef

2020-12-23 Thread Nathan James via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGeb9483b21053: [format] Add overload to parseConfiguration that accept llvm::MemoryBufferRef (authored by njames93). Changed prior to commit: https://reviews.llvm.org/D93633?vs=313096&id=313530#toc Repo

[PATCH] D93758: [format][NFC] Use unsigned char as the base of all enums in FormatStyle

2020-12-23 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. In D93758#2469967 , @MyDeveloperDay wrote: > We should probably check the docs/tools/dump_format_style.py still works Good catch, I'll update the script to optionally take an underlying type argument. Should that be part of thi

[PATCH] D93758: [format][NFC] Use unsigned char as the base of all enums in FormatStyle

2020-12-23 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 313559. njames93 added a comment. - Update dump_format_style script Only tweaked regex to support enum : ... { Decided there wasn't much to gain from supporting nested types etc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://r

[PATCH] D93758: [format][NFC] Use unsigned char as the base of all enums in FormatStyle

2020-12-23 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. In D93758#2470124 , @MyDeveloperDay wrote: > I don't have any major issues with this other than it makes Format.h a bit > more ugly. (there are more ugly and harder to understand pieces of code than > this change!) > > We'll on

[PATCH] D93758: [format][NFC] Use unsigned char as the base of all enums in FormatStyle

2020-12-23 Thread Nathan James via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc7e825b910a9: [format][NFC] Use unsigned char as the base of all enums in FormatStyle (authored by njames93). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D9

[PATCH] D93763: [clangd] Add a flag to disable the documentLinks LSP request

2020-12-23 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. Can you apply the clang-format patch suggested by the pre-merge bot. Alternatively, if you have a recent version of clang-format and the appropriate git-hooks you should be able to run `git clang-format` for the same effect. Repository: rG LLVM Github Monorepo CHAN

[PATCH] D93800: [clangd][WIP] Add caching behaviour for clang-format config

2020-12-24 Thread Nathan James via Phabricator via cfe-commits
njames93 created this revision. njames93 added reviewers: sammccall, kadircet, hokein. Herald added subscribers: usaxena95, arphaman, mgorny. njames93 requested review of this revision. Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov. Herald added a project: clang. I'm not super happ

[PATCH] D90682: [clangd][NFC] Make Located::operator->() use pointer sematics

2020-11-03 Thread Nathan James via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGcb9d0e8819ad: [clangd][NFC] Make Located::operator->() use pointer sematics (authored by njames93). Repository: rG LLVM Github Monorepo CHANGES S

[PATCH] D90531: [clangd] Add clang-tidy options to config

2020-11-04 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 302818. njames93 added a comment. Rebase and make apply take reference to Params. Fix fragments checks being applied on top of each other instead of overwriting the current config checks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION h

[PATCH] D90552: [clangd] Set the User option for clang-tidy to mimick its behaviour

2020-11-04 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 302871. njames93 marked an inline comment as done. njames93 added a comment. Fix typo. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90552/new/ https://reviews.llvm.org/D90552 Files: clang-tools-extra/clang

[PATCH] D90552: [clangd] Set the User option for clang-tidy to mimick its behaviour

2020-11-04 Thread Nathan James via Phabricator via cfe-commits
njames93 added inline comments. Comment at: clang-tools-extra/clangd/tool/ClangdMain.cpp:812 +EmptyDefaults.User = llvm::sys::Process::GetEnv("USER"); +if (!EmptyDefaults.User) + EmptyDefaults.User = llvm::sys::Process::GetEnv("USEUSERNAMER"); sammcc

[PATCH] D90531: [clangd] Add clang-tidy options to config

2020-11-04 Thread Nathan James via Phabricator via cfe-commits
njames93 marked 13 inline comments as done. njames93 added inline comments. Comment at: clang-tools-extra/clangd/ConfigFragment.h:183 + struct ClangTidyBlock { +llvm::Optional> Enable; +/// List of checks to enable or disable, can use wildcards. sammccal

[PATCH] D90531: [clangd] Add clang-tidy options to config

2020-11-04 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 302935. njames93 added a comment. Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90531/new/ https://reviews.llvm.org/D90531 Files: clang-tools-extra/clangd/Config.h clang-tools-extra/clang

[PATCH] D90832: [clang-tidy] Extend IdentifierNamingCheck per file config

2020-11-05 Thread Nathan James via Phabricator via cfe-commits
njames93 created this revision. njames93 added reviewers: aaron.ballman, alexfh, gribozavr2. Herald added subscribers: cfe-commits, xazax.hun. Herald added a project: clang. njames93 requested review of this revision. Add IgnoreMainLikeFunctions to the per file config. This can be extended for ne

[PATCH] D90832: [clang-tidy] Extend IdentifierNamingCheck per file config

2020-11-05 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. In D90832#2375934 , @aaron.ballman wrote: > Is there a way to test this functionality out? There's already tests for loading the individual styles from other files, I'm sure I could extend that Repository: rG LLVM Github Mo

[PATCH] D90832: [clang-tidy] Extend IdentifierNamingCheck per file config

2020-11-05 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. Didn't mean for there to be any formatting changes. I'll remove those later too Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90832/new/ https://reviews.llvm.org/D90832 ___ cfe-

[PATCH] D90832: [clang-tidy] Extend IdentifierNamingCheck per file config

2020-11-05 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 303198. njames93 added a comment. Herald added a subscriber: aheejin. Removed unnecessary formatting changes Added test cases. With the test cases I removed some cases that actually were never tested due to the order in which clang-tidy handles applying con

[PATCH] D90832: [clang-tidy] Extend IdentifierNamingCheck per file config

2020-11-05 Thread Nathan James via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG3b9b90a1914f: [clang-tidy] Extend IdentifierNamingCheck per file config (authored by njames93). Changed prior to commit: https://reviews.llvm.org/

[PATCH] D90835: [RFC][clang-tidy] Ignore diagnostics due to macro expansion from not-interested headers

2020-11-05 Thread Nathan James via Phabricator via cfe-commits
njames93 added inline comments. Comment at: clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp:249-251 + if (!HeaderFilter) +HeaderFilter = +std::make_unique(*getOptions().HeaderFilterRegex); This should also check if the Optional has a val

[PATCH] D90555: [clangd] Handle duplicate enum constants in PopulateSwitch tweak

2020-11-06 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 303502. njames93 added a comment. Addressed comments. Now using a MapVector to collect all uncovered cases in prepare, then just loop over that in apply. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90555/new

[PATCH] D90555: [clangd] Handle duplicate enum constants in PopulateSwitch tweak

2020-11-06 Thread Nathan James via Phabricator via cfe-commits
njames93 marked 6 inline comments as done. njames93 added inline comments. Comment at: clang-tools-extra/clangd/refactor/tweaks/PopulateSwitch.cpp:117 - // We trigger if there are fewer cases than enum values (and no case covers - // multiple values). This guarantees we'll ha

[PATCH] D90531: [clangd] Add clang-tidy options to config

2020-11-06 Thread Nathan James via Phabricator via cfe-commits
njames93 added inline comments. Comment at: clang-tools-extra/clangd/Config.h:78 +std::string Checks; +std::vector> CheckOptions; + } ClangTidy; sammccall wrote: > I think this should be a StringMap > > It makes sense to use a vector-of-pairs in ConfigF

[PATCH] D90944: [clang-tidy] implement misc-mt-unsafe

2020-11-06 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. It appears to not check for signs that the code is running in a multi threaded manner, This will result in many false positives in code that is known to be single threaded. Comment at: clang-tools-extra/clang-tidy/misc/MtUnsafeCheck.cpp:19 + +namespa

[PATCH] D90552: [clangd] Set the User option for clang-tidy to mimick its behaviour

2020-11-06 Thread Nathan James via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG062b5c598f21: [clangd] Set the User option for clang-tidy to mimick its behaviour (authored by njames93). Changed prior to commit: https://reviews.llvm.org/D90552?vs=302871&id=303519#toc Repository:

[PATCH] D90944: [clang-tidy] implement misc-mt-unsafe

2020-11-06 Thread Nathan James via Phabricator via cfe-commits
njames93 added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/list.rst:33 `abseil-upgrade-duration-conversions `_, "Yes" - `altera-struct-pack-align `_, + `altera-struct-pack-align `_, "Yes" `android-cloexec-accept `_, "Yes" se

[PATCH] D90555: [clangd] Handle duplicate enum constants in PopulateSwitch tweak

2020-11-06 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 303580. njames93 marked 3 inline comments as done. njames93 added a comment. Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90555/new/ https://reviews.llvm.org/D90555 Files: clang-tools-extr

[PATCH] D90555: [clangd] Handle duplicate enum constants in PopulateSwitch tweak

2020-11-06 Thread Nathan James via Phabricator via cfe-commits
njames93 marked 6 inline comments as done. njames93 added inline comments. Comment at: clang-tools-extra/clangd/refactor/tweaks/PopulateSwitch.cpp:127 + unsigned EnumIntWidth = Ctx.getIntWidth(QualType(EnumT, 0)); + bool EnumIsSigned = EnumT->isSignedIntegerOrEnumerationType();

[PATCH] D90992: [clang-tidy] Use vfs::FileSystem when getting config

2020-11-06 Thread Nathan James via Phabricator via cfe-commits
njames93 created this revision. njames93 added reviewers: alexfh, aaron.ballman, gribozavr2. Herald added subscribers: cfe-commits, xazax.hun. Herald added a project: clang. njames93 requested review of this revision. The config providers that look for configuration files currently take a pointer

[PATCH] D90531: [clangd] Add clang-tidy options to config

2020-11-06 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 303596. njames93 marked an inline comment as done. njames93 added a comment. Removed Enable. Removed the scalarBool parser as it was only needed by Enable. Removed DynamicDictParser in favour of reworking DictParser to get better control of how to handle unk

[PATCH] D90531: [clangd] Add clang-tidy options to config

2020-11-06 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 303598. njames93 added a comment. Fix the unit tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90531/new/ https://reviews.llvm.org/D90531 Files: clang-tools-extra/clangd/Config.h clang-tools-extra/cl

[PATCH] D90992: [clang-tidy] Use vfs::FileSystem when getting config

2020-11-07 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 303629. njames93 added a comment. Herald added a subscriber: mgorny. Added unittest for loading configs from an InMemoryFileSystem. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90992/new/ https://reviews.llvm

[PATCH] D90992: [clang-tidy] Use vfs::FileSystem when getting config

2020-11-07 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 303630. njames93 added a comment. Small tweak to the tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90992/new/ https://reviews.llvm.org/D90992 Files: clang-tools-extra/clang-tidy/ClangTidyOptions.cpp

[PATCH] D90975: [clangd] Don't run clang-tidy AST traversal if there are no checks.

2020-11-07 Thread Nathan James via Phabricator via cfe-commits
njames93 accepted this revision. njames93 added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90975/new/ https://reviews.llvm.org/D90975 _

[PATCH] D90992: [clang-tidy] Use vfs::FileSystem when getting config

2020-11-07 Thread Nathan James via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd725f1ce5318: [clang-tidy] Use vfs::FileSystem when getting config (authored by njames93). Changed prior to commit: https://reviews.llvm.org/D90992?vs=303630&id=303658#toc Repository: rG LLVM Github

[PATCH] D91029: [clangd] Implement clang-tidy options from config

2020-11-08 Thread Nathan James via Phabricator via cfe-commits
njames93 created this revision. njames93 added reviewers: sammccall, kadircet. Herald added subscribers: cfe-commits, usaxena95, arphaman, mgorny. Herald added a project: clang. njames93 requested review of this revision. Herald added subscribers: MaskRay, ilya-biryukov. Added some new ClangTidyOp

[PATCH] D91029: [clangd] Implement clang-tidy options from config

2020-11-08 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 303720. njames93 added a comment. Fix potential race when updating cache in `FileTidyProvider`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91029/new/ https://reviews.llvm.org/D91029 Files: clang-tools-ex

[PATCH] D91029: [clangd] Implement clang-tidy options from config

2020-11-08 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 303721. njames93 added a comment. Fix compile errors. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91029/new/ https://reviews.llvm.org/D91029 Files: clang-tools-extra/clangd/CMakeLists.txt clang-tools-ex

[PATCH] D91029: [clangd] Implement clang-tidy options from config

2020-11-08 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 303723. njames93 added a comment. Fix last compile error, check-clangd ran without a hitch. Testing the binary in another project seems to work ok. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91029/new/ htt

[PATCH] D91033: GNU nano 4.8 /tmp/edit.7czvmlx7um4go4c0/commit-message Modified [clang-tidy][NFC] Tweak GlobList to iterate backwards

2020-11-08 Thread Nathan James via Phabricator via cfe-commits
njames93 created this revision. njames93 added reviewers: aaron.ballman, alexfh, gribozavr2. Herald added subscribers: cfe-commits, xazax.hun. Herald added a project: clang. njames93 requested review of this revision. By iterating backwards over the globs we can exit the loop as soon as we find a

[PATCH] D91009: Include std::basic_string_view in readability-redundant-string-init.

2020-11-08 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. You don't really need to duplicate every single `std::string` test. Just enough so that it detects it, kind of like `::out::TestString`. Also can you update the docs and release notes to explain this behaviour. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

<    3   4   5   6   7   8   9   10   11   12   >