aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy98
-rw-r--r--rcc/lib/CMakeLists.txt5
-rw-r--r--rcc/lib/Support/Errno.cc10
3 files changed, 35 insertions, 78 deletions
diff --git a/.clang-tidy b/.clang-tidy
index ba38270..f367f2e 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -1,4 +1,4 @@
-HeaderFilterRegex: '(^|/)(rcc|cfront)/(include|lib|tools)/'
+HeaderFilterRegex: ''
Checks: >
-*,
clang-diagnostic-*,
@@ -10,76 +10,30 @@ Checks: >
-misc-non-private-member-variables-in-classes,
-misc-unused-parameters,
-misc-use-anonymous-namespace,
- readability-identifier-naming,
- bugprone-argument-comment,
- bugprone-assert-side-effect,
- bugprone-branch-clone,
- bugprone-copy-constructor-init,
- bugprone-dangling-handle,
- bugprone-dynamic-static-initializers,
- bugprone-macro-parentheses,
- bugprone-macro-repeated-side-effects,
- bugprone-misplaced-widening-cast,
- bugprone-move-forwarding-reference,
- bugprone-multiple-statement-macro,
- bugprone-suspicious-semicolon,
- bugprone-swapped-arguments,
- bugprone-terminating-continue,
- bugprone-unused-raii,
- bugprone-unused-return-value,
- misc-redundant-expression,
- misc-static-assert,
- misc-unused-using-decls,
- modernize-use-bool-literals,
- modernize-loop-convert,
- modernize-make-unique,
- modernize-raw-string-literal,
- modernize-use-equals-default,
- modernize-use-default-member-init,
- modernize-use-emplace,
- modernize-use-nullptr,
- modernize-use-override,
- modernize-use-using,
- performance-for-range-copy,
- performance-implicit-conversion-in-loop,
- performance-inefficient-algorithm,
- performance-inefficient-vector-operation,
- performance-move-const-arg,
- performance-no-automatic-move,
- performance-trivially-destructible,
- performance-unnecessary-copy-initialization,
- performance-unnecessary-value-param,
- readability-avoid-const-params-in-decls,
- readability-const-return-type,
- readability-container-size-empty,
- readability-inconsistent-declaration-parameter-name,
- readability-misleading-indentation,
- readability-redundant-control-flow,
- readability-redundant-smartptr-get,
- readability-simplify-boolean-expr,
- readability-simplify-subscript-expr,
- readability-use-anyofallof
+ readability-identifier-naming
CheckOptions:
- - key: readability-identifier-naming.ClassCase
- value: CamelCase
- - key: readability-identifier-naming.EnumCase
- value: CamelCase
- - key: readability-identifier-naming.FunctionCase
- value: camelBack
- - key: readability-identifier-naming.MemberCase
- value: camelBack
- - key: readability-identifier-naming.ParameterCase
- value: camelBack
- - key: readability-identifier-naming.UnionCase
- value: CamelCase
- - key: readability-identifier-naming.VariableCase
- value: camelBack
- - key: readability-identifier-naming.IgnoreMainLikeFunctions
- value: 1
- - key: readability-redundant-member-init.IgnoreBaseInCopyConstructors
- value: 1
- - key: modernize-use-default-member-init.UseAssignment
- value: 1
- - key: modernize-use-using.IgnoreExternC
- value: true
+ - key: readability-identifier-naming.ClassCase
+ value: CamelCase
+ - key: readability-identifier-naming.EnumCase
+ value: CamelCase
+ - key: readability-identifier-naming.FunctionCase
+ value: camelBack
+ # Exclude from scanning as this is an exported symbol used for fuzzing
+ # throughout the code base.
+ - key: readability-identifier-naming.FunctionIgnoredRegexp
+ value: "LLVMFuzzerTestOneInput"
+ - key: readability-identifier-naming.MemberCase
+ value: camelBack
+ - key: readability-identifier-naming.ParameterCase
+ value: camelBack
+ - key: readability-identifier-naming.UnionCase
+ value: CamelCase
+ - key: readability-identifier-naming.VariableCase
+ value: camelBack
+ - key: readability-identifier-naming.IgnoreMainLikeFunctions
+ value: 1
+ - key: readability-redundant-member-init.IgnoreBaseInCopyConstructors
+ value: 1
+ - key: modernize-use-default-member-init.UseAssignment
+ value: 1
diff --git a/rcc/lib/CMakeLists.txt b/rcc/lib/CMakeLists.txt
index f515bc8..366e6d2 100644
--- a/rcc/lib/CMakeLists.txt
+++ b/rcc/lib/CMakeLists.txt
@@ -1,3 +1,6 @@
# SPDX-License-Identifier: GPL-3.0-or-later
-# Add library subdirectories here as their implementations are introduced.
+add_rcc_library(RCCSupport
+ STATIC
+ Support/Errno.cc
+)
diff --git a/rcc/lib/Support/Errno.cc b/rcc/lib/Support/Errno.cc
index 5a99571..f0161a6 100644
--- a/rcc/lib/Support/Errno.cc
+++ b/rcc/lib/Support/Errno.cc
@@ -48,8 +48,8 @@ StrError (int errnum)
}
#if defined(HAVE_STRERROR_R) || HAVE_DECL_STRERROR_S
- const int MaxErrStrLen = 2000;
- char buffer[MaxErrStrLen];
+ const int maxErrStrLen = 2000;
+ char buffer[maxErrStrLen];
buffer[0] = '\0';
#endif
@@ -58,14 +58,14 @@ StrError (int errnum)
#if defined(__GLIBC__) && defined(_GNU_SOURCE)
// glibc defines its own incompatible version of strerror_r which may not
// use the buffer supplied.
- str = strerror_r (errnum, buffer, MaxErrStrLen - 1);
+ str = strerror_r (errnum, buffer, maxErrStrLen - 1);
#else
- strerror_r (errnum, buffer, MaxErrStrLen - 1);
+ strerror_r (errnum, buffer, maxErrStrLen - 1);
str = buffer;
#endif
#elif HAVE_DECL_STRERROR_S
// Windows Secure API.
- strerror_s (buffer, MaxErrStrLen - 1, errnum);
+ strerror_s (buffer, maxErrStrLen - 1, errnum);
str = buffer;
#else
// Copy the thread-unsafe result of strerror into the buffer as fast as