Commit 5df1f537 authored by Keishi Hattori's avatar Keishi Hattori Committed by Chromium LUCI CQ

Add win build detection to rewrite_raw_ptr_fields/rewrite.sh

Make rewrite_raw_ptr_fields/rewrite.sh auto detect when we want to rewrite for the windows platform.

Bug: 1069567
Change-Id: I18044284186555a07f63cdad5a0604e5749df94c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2626866Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarŁukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843852}
parent ef85acac
...@@ -47,10 +47,16 @@ gn gen $OUT_DIR ...@@ -47,10 +47,16 @@ gn gen $OUT_DIR
GEN_H_TARGETS=`ninja -C $OUT_DIR -t targets all | grep '^gen/.*\(\.h\|inc\|css_tokenizer_codepoints.cc\)' | cut -d : -f 1` GEN_H_TARGETS=`ninja -C $OUT_DIR -t targets all | grep '^gen/.*\(\.h\|inc\|css_tokenizer_codepoints.cc\)' | cut -d : -f 1`
time ninja -C $OUT_DIR $GEN_H_TARGETS time ninja -C $OUT_DIR $GEN_H_TARGETS
if grep -qE '^\s*target_os\s*=\s*("win"|win)' $OUT_DIR/args.gn
then
TARGET_OS_OPTION="--target_os=win"
fi
# A preliminary rewriter run in a special mode that generates a list of fields # A preliminary rewriter run in a special mode that generates a list of fields
# to ignore. These fields would likely lead to compiler errors if rewritten. # to ignore. These fields would likely lead to compiler errors if rewritten.
echo "*** Generating the ignore list ***" echo "*** Generating the ignore list ***"
time tools/clang/scripts/run_tool.py \ time tools/clang/scripts/run_tool.py \
$TARGET_OS_OPTION \
--tool rewrite_raw_ptr_fields \ --tool rewrite_raw_ptr_fields \
--tool-arg=--exclude-paths=$REWRITER_SRC_DIR/manual-paths-to-ignore.txt \ --tool-arg=--exclude-paths=$REWRITER_SRC_DIR/manual-paths-to-ignore.txt \
--generate-compdb \ --generate-compdb \
...@@ -66,6 +72,7 @@ cat ~/scratch/automated-fields-to-ignore.txt \ ...@@ -66,6 +72,7 @@ cat ~/scratch/automated-fields-to-ignore.txt \
# Main rewrite. # Main rewrite.
echo "*** Running the main rewrite phase ***" echo "*** Running the main rewrite phase ***"
time tools/clang/scripts/run_tool.py \ time tools/clang/scripts/run_tool.py \
$TARGET_OS_OPTION \
--tool rewrite_raw_ptr_fields \ --tool rewrite_raw_ptr_fields \
--tool-arg=--exclude-fields=$HOME/scratch/combined-fields-to-ignore.txt \ --tool-arg=--exclude-fields=$HOME/scratch/combined-fields-to-ignore.txt \
--tool-arg=--exclude-paths=$REWRITER_SRC_DIR/manual-paths-to-ignore.txt \ --tool-arg=--exclude-paths=$REWRITER_SRC_DIR/manual-paths-to-ignore.txt \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment