Roll src/third_party/WebKit f36d5e0:68b67cd (svn 193299:193303)
[chromium-blink-merge.git] / tools / clang / scripts / blink_gc_plugin_flags.sh
blob38ea72d695807e8649c3bab696597c1a1545ca12
1 #!/usr/bin/env bash
2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 # This script returns the flags that should be passed to clang.
8 SRC_DIR=$(cd $(dirname $0)/../../.. && echo $PWD)
9 CLANG_LIB_PATH=$SRC_DIR/third_party/llvm-build/Release+Asserts/lib
11 if uname -s | grep -q Darwin; then
12 LIBSUFFIX=dylib
13 else
14 LIBSUFFIX=so
17 FLAGS=""
18 PREFIX="-Xclang -plugin-arg-blink-gc-plugin -Xclang"
19 for arg in "$@"; do
20 if [[ "$arg" = "enable-oilpan=1" ]]; then
21 FLAGS="$FLAGS $PREFIX enable-oilpan"
22 elif [[ "$arg" = "dump-graph=1" ]]; then
23 FLAGS="$FLAGS $PREFIX dump-graph"
24 elif [[ "$arg" = "warn-raw-ptr=1" ]]; then
25 FLAGS="$FLAGS $PREFIX warn-raw-ptr"
26 elif [[ "$arg" = "warn-unneeded-finalizer=1" ]]; then
27 FLAGS="$FLAGS $PREFIX warn-unneeded-finalizer"
29 done
31 echo -Xclang -load -Xclang $CLANG_LIB_PATH/libBlinkGCPlugin.$LIBSUFFIX \
32 -Xclang -add-plugin -Xclang blink-gc-plugin $FLAGS