[compiler-rt] f305176 - [cpplint] As part of using inclusive language within the llvm project,
Hubert Tong via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 20 12:44:46 PDT 2020
On Sat, Jun 20, 2020 at 3:32 PM Eric Christopher via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
>
> Author: Eric Christopher
> Date: 2020-06-20T00:58:04-07:00
> New Revision: f305176bc606eb1e6aab116d84125a38edae7047
>
> URL:
> https://github.com/llvm/llvm-project/commit/f305176bc606eb1e6aab116d84125a38edae7047
> DIFF:
> https://github.com/llvm/llvm-project/commit/f305176bc606eb1e6aab116d84125a38edae7047.diff
>
> LOG: [cpplint] As part of using inclusive language within the llvm project,
> migrate away from the use of blacklist and whitelist.
>
> Added:
>
>
> Modified:
> compiler-rt/lib/sanitizer_common/scripts/cpplint.py
>
> Removed:
>
>
>
>
> ################################################################################
> diff --git a/compiler-rt/lib/sanitizer_common/scripts/cpplint.py
> b/compiler-rt/lib/sanitizer_common/scripts/cpplint.py
> index 65baa6cc1603..59e99f2585e8 100755
> --- a/compiler-rt/lib/sanitizer_common/scripts/cpplint.py
> +++ b/compiler-rt/lib/sanitizer_common/scripts/cpplint.py
> @@ -3866,8 +3866,8 @@ def CheckTrailingSemicolon(filename, clean_lines,
> linenum, error):
>
> # Block bodies should not be followed by a semicolon. Due to C++11
> # brace initialization, there are more places where semicolons are
> - # required than not, so we use a whitelist approach to check these
> - # rather than a blacklist. These are the places where "};" should
> + # required than not, so we use a allowed list approach to check these
>
s/a allowed/an allowed/;
> + # rather than an exclusion list. These are the places where "};" should
> # be replaced by just "}":
> # 1. Some flavor of block following closing parenthesis:
> # for (;;) {};
> @@ -3924,11 +3924,11 @@ def CheckTrailingSemicolon(filename, clean_lines,
> linenum, error):
> # - INTERFACE_DEF
> # - EXCLUSIVE_LOCKS_REQUIRED, SHARED_LOCKS_REQUIRED, LOCKS_EXCLUDED:
> #
> - # We implement a whitelist of safe macros instead of a blacklist of
> + # We implement a list of allowed safe macros instead of a list of
> # unsafe macros, even though the latter appears less frequently in
> # google code and would have been easier to implement. This is
> because
> - # the downside for getting the whitelist wrong means some extra
> - # semicolons, while the downside for getting the blacklist wrong
> + # the downside for getting the allowed list wrong means some extra
> + # semicolons, while the downside for getting the exclusion list wrong
> # would result in compile errors.
> #
> # In addition to macros, we also don't want to warn on
> @@ -5124,19 +5124,19 @@ def CheckForNonConstReference(filename,
> clean_lines, linenum,
> #
> # We also accept & in static_assert, which looks like a function but
> # it's actually a declaration expression.
> - whitelisted_functions = (r'(?:[sS]wap(?:<\w:+>)?|'
> + allowed_functions = (r'(?:[sS]wap(?:<\w:+>)?|'
> r'operator\s*[<>][<>]|'
> r'static_assert|COMPILE_ASSERT'
> r')\s*\(')
> - if Search(whitelisted_functions, line):
> + if Search(allowed_functions, line):
> return
> elif not Search(r'\S+\([^)]*$', line):
> - # Don't see a whitelisted function on this line. Actually we
> + # Don't see an allowed function entry on this line. Actually we
> # didn't see any function name on this line, so this is likely a
> # multi-line parameter list. Try a bit harder to catch this case.
> for i in xrange(2):
> if (linenum > i and
> - Search(whitelisted_functions, clean_lines.elided[linenum - i -
> 1])):
> + Search(allowed_functions, clean_lines.elided[linenum - i - 1])):
> return
>
> decls = ReplaceAll(r'{[^}]*}', ' ', line) # exclude function body
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200620/99ab5b02/attachment.html>
More information about the llvm-commits
mailing list