summaryrefslogtreecommitdiffstats
path: root/tools/clang_check/cxx_wrapper.sh
blob: 9f0ff0f482879280938e1483051ac67be886105e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
#
# Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Strip out any parameters that will make clang do anything other than syntax
# checking.
TARGETOBJ=`echo $@ | sed -e 's/.*-o \(.*\.o\).*/\1/;'`

ADJUSTED=`echo "$@" | sed -e 's/ -c / /g;' |\
                      sed -e 's/ -O0 / /g;' |\
                      sed -e 's/ -g / /g;' |\
                      sed -e 's/Google Inc/GoogleInc/g;' |\
                      sed -e 's/ -Wunused-value / /g;' |\
                      sed -e 's/ -Wswitch-enum / /g;' |\
                      sed -e 's/ -pipe / /g;' |\
                      sed -e 's/ -o.*\.o / /g;'`

clang++ -fsyntax-only $ADJUSTED && touch "$TARGETOBJ"