OSDN Git Service

Add performance* to default global tidy checks.
authorChih-Hung Hsieh <chh@google.com>
Tue, 26 Jul 2016 21:27:03 +0000 (14:27 -0700)
committerChih-Hung Hsieh <chh@google.com>
Tue, 26 Jul 2016 21:36:54 +0000 (14:36 -0700)
* This enables 5 performance related checks:
    performance-faster-string-find
    performance-for-range-copy
    performance-implicit-cast-in-loop
    performance-unnecessary-copy-initialization
    performance-unnecessary-value-param
* Recognize these new warnings in warn.py.

Bug: http://b/27779618
Change-Id: I7af3fdc262dd44db90d3b62eb37c5eac5a2eaa01
Test: build with WITH_TIDY=1 and run warn.py with build.log

core/clang/tidy.mk
tools/warn.py

index 35871f0..d50b43d 100644 (file)
 #
 
 # Most Android source files are not clang-tidy clean yet.
-# Global tidy checks include only google* and misc-macro-parentheses,
-# but not google-readability* or google-runtime-references.
+# Global tidy checks include only google*, performance*,
+# and misc-macro-parentheses, but not google-readability*
+# or google-runtime-references.
 DEFAULT_GLOBAL_TIDY_CHECKS := \
-  -*,google*,-google-readability*,-google-runtime-references,misc-macro-parentheses
+  -*,google*,performance*,misc-macro-parentheses \
+  ,-google-readability*,-google-runtime-references
 
 # Disable style rules usually not followed by external projects.
 # Every word in DEFAULT_LOCAL_TIDY_CHECKS list has the following format:
index 51349af..c819d7f 100755 (executable)
@@ -1774,6 +1774,21 @@ warnpatterns = [
         'description':'clang-tidy misc',
         'patterns':[r".*: .+\[misc-.+\]$"] },
     { 'category':'C/C++',   'severity':severity.TIDY,     'members':[], 'option':'',
+        'description':'clang-tidy performance-faster-string-find',
+        'patterns':[r".*: .+\[performance-faster-string-find\]$"] },
+    { 'category':'C/C++',   'severity':severity.TIDY,     'members':[], 'option':'',
+        'description':'clang-tidy performance-for-range-copy',
+        'patterns':[r".*: .+\[performance-for-range-copy\]$"] },
+    { 'category':'C/C++',   'severity':severity.TIDY,     'members':[], 'option':'',
+        'description':'clang-tidy performance-implicit-cast-in-loop',
+        'patterns':[r".*: .+\[performance-implicit-cast-in-loop\]$"] },
+    { 'category':'C/C++',   'severity':severity.TIDY,     'members':[], 'option':'',
+        'description':'clang-tidy performance-unnecessary-copy-initialization',
+        'patterns':[r".*: .+\[performance-unnecessary-copy-initialization\]$"] },
+    { 'category':'C/C++',   'severity':severity.TIDY,     'members':[], 'option':'',
+        'description':'clang-tidy performance-unnecessary-value-param',
+        'patterns':[r".*: .+\[performance-unnecessary-value-param\]$"] },
+    { 'category':'C/C++',   'severity':severity.TIDY,     'members':[], 'option':'',
         'description':'clang-tidy CERT',
         'patterns':[r".*: .+\[cert-.+\]$"] },
     { 'category':'C/C++',   'severity':severity.TIDY,     'members':[], 'option':'',