Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Unified Diff: tools/clang/scripts/blink_gc_plugin_flags.py

Issue 1464293002: If Oilpan is enabled, warn of raw heap pointer fields by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/scripts/blink_gc_plugin_flags.py
diff --git a/tools/clang/scripts/blink_gc_plugin_flags.py b/tools/clang/scripts/blink_gc_plugin_flags.py
index 5bb28da7197e2b0ab7d1dade5d31c9c2a784c089..0b3e82ba86a92e2241582b6dea2197ffaebc620e 100755
--- a/tools/clang/scripts/blink_gc_plugin_flags.py
+++ b/tools/clang/scripts/blink_gc_plugin_flags.py
@@ -15,18 +15,27 @@ CLANG_LIB_PATH = os.path.normpath(os.path.join(
FLAGS = '-Xclang -add-plugin -Xclang blink-gc-plugin'
PREFIX= ' -Xclang -plugin-arg-blink-gc-plugin -Xclang '
+
+warn_raw_pointers = None
for arg in sys.argv[1:]:
if arg == 'enable-oilpan=1':
FLAGS += PREFIX + 'enable-oilpan'
+ if warn_raw_pointers is None:
+ warn_raw_pointers = True
elif arg == 'dump-graph=1':
FLAGS += PREFIX + 'dump-graph'
elif arg == 'warn-raw-ptr=1':
- FLAGS += PREFIX + 'warn-raw-ptr'
+ warn_raw_pointers = True
+ elif arg == 'warn-raw-ptr=0':
+ warn_raw_pointers = False
elif arg == 'warn-unneeded-finalizer=1':
FLAGS += PREFIX + 'warn-unneeded-finalizer'
elif arg.startswith('custom_clang_lib_path='):
CLANG_LIB_PATH = arg[len('custom_clang_lib_path='):]
+if warn_raw_pointers is True:
+ FLAGS += PREFIX + 'warn-raw-ptr'
+
if not sys.platform in ['win32', 'cygwin']:
LIBSUFFIX = 'dylib' if sys.platform == 'darwin' else 'so'
FLAGS = ('-Xclang -load -Xclang "%s/libBlinkGCPlugin.%s" ' + FLAGS) % \
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698