summaryrefslogtreecommitdiffstats
path: root/clang/utils/check_cfc/check_cfc.py
diff options
context:
space:
mode:
authorRussell Gallop <russell.gallop@gmail.com>2015-06-03 15:09:13 +0000
committerRussell Gallop <russell.gallop@gmail.com>2015-06-03 15:09:13 +0000
commit14c4dab6036607c38f5f1dc522a5025618ef55db (patch)
treef9c10f24e8eebdf0d42b908e99245dc891ec78f7 /clang/utils/check_cfc/check_cfc.py
parent224b16228028554e3594c0b72b3dacf3893d22d6 (diff)
downloadbcm5719-llvm-14c4dab6036607c38f5f1dc522a5025618ef55db.tar.gz
bcm5719-llvm-14c4dab6036607c38f5f1dc522a5025618ef55db.zip
[utils] Improvements to check_cfc.py to work better with some build systems.
Recognise options to output dependency files and don't perform checks. Report input file name when reporting a check failure so it is more obvious in large build logs. Differential Revision: http://reviews.llvm.org/D10183 llvm-svn: 238928
Diffstat (limited to 'clang/utils/check_cfc/check_cfc.py')
-rwxr-xr-xclang/utils/check_cfc/check_cfc.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/utils/check_cfc/check_cfc.py b/clang/utils/check_cfc/check_cfc.py
index df586e9eab4..c6ab9abf235 100755
--- a/clang/utils/check_cfc/check_cfc.py
+++ b/clang/utils/check_cfc/check_cfc.py
@@ -213,16 +213,18 @@ def set_input_file(args, input_file):
def is_normal_compile(args):
"""Check if this is a normal compile which will output an object file rather
- than a preprocess or link."""
+ than a preprocess or link. args is a list of command line arguments."""
compile_step = '-c' in args
# Bitcode cannot be disassembled in the same way
bitcode = '-flto' in args or '-emit-llvm' in args
# Version and help are queries of the compiler and override -c if specified
query = '--version' in args or '--help' in args
+ # Options to output dependency files for make
+ dependency = '-M' in args or '-MM' in args
# Check if the input is recognised as a source file (this may be too
# strong a restriction)
input_is_valid = bool(get_input_file(args))
- return compile_step and not bitcode and not query and input_is_valid
+ return compile_step and not bitcode and not query and not dependency and input_is_valid
def run_step(command, my_env, error_on_failure):
"""Runs a step of the compilation. Reports failure as exception."""
@@ -379,7 +381,7 @@ if __name__ == '__main__':
checker.perform_check(arguments_a, my_env)
except WrapperCheckException as e:
# Check failure
- print(e.msg, file=sys.stderr)
+ print("{} {}".format(get_input_file(arguments_a), e.msg), file=sys.stderr)
# Remove file to comply with build system expectations (no
# output file if failed)
OpenPOWER on IntegriCloud