Tidy up lint issues. (#3429)

These are manual fixes; mostly from clang-tidy, some from clangd (which
notes unused includes).

In typed_insts, adding inlline due to misc-definitions-in-headers. Per
discussion, clang-tidy is wrong, but inline silences it.

For parameter name skew in definition versus declaration, I'm just using
the name from the definition.

---------

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
Jon Ross-Perkins
2023-11-29 20:41:53 +00:00
committed by GitHub
co-authored by Richard Smith
parent eae630a3db
commit 0d618b1278
24 changed files with 55 additions and 63 deletions
+6 -5
View File
@@ -47,8 +47,9 @@ auto NodeKind::child_count() const -> int32_t {
return child_count;
}
void CheckNodeMatchesLexerToken(NodeKind node_kind, Lex::TokenKind token_kind,
bool has_error) {
// NOLINTNEXTLINE(readability-function-size): It's hard to extract macros.
auto CheckNodeMatchesLexerToken(NodeKind node_kind, Lex::TokenKind token_kind,
bool has_error) -> void {
switch (node_kind) {
// Use `CARBON_LOG CARBON_ANY_TOKEN` to discover which combinations happen
// in practice.
@@ -69,9 +70,9 @@ void CheckNodeMatchesLexerToken(NodeKind node_kind, Lex::TokenKind token_kind,
MatchActions \
}
#define CARBON_CASE(Name, MatchActions) \
case NodeKind::Name: \
MatchActions; \
#define CARBON_CASE(Name, MatchActions) \
case NodeKind::Name: \
MatchActions; /* NOLINT(bugprone-macro-parentheses) */ \
break;
#define CARBON_PARSE_NODE_KIND_BRACKET(Name, BracketName, MatchActions) \