From: Seo Sanghyeon Date: Fri, 25 Jan 2008 14:57:54 +0000 (+0000) Subject: Implement -print-prog-name. Patch by Nuno Lopes. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96b99f79393b099a5110c359c9d02179751e3b8b;p=clang Implement -print-prog-name. Patch by Nuno Lopes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46353 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/ccc b/utils/ccc index 6569588ad0..308544ecbc 100755 --- a/utils/ccc +++ b/utils/ccc @@ -39,7 +39,7 @@ def link(args): def main(args): action = 'link' output = '' - compile_opts = ['-U__GNUC__'] + compile_opts = [] link_opts = [] files = [] @@ -50,6 +50,8 @@ def main(args): action = 'preprocess' if arg == '-c': action = 'compile' + if arg.startswith('-print-prog-name'): + action = 'print-prog-name' if arg == '-o': output = args[i+1] i += 1 @@ -68,6 +70,11 @@ def main(args): files.append(arg) i += 1 + if action == 'print-prog-name': + # assume we can handle everything + print sys.argv[0] + return + if not files: error('no input files')