aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-09-30 21:20:51 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-09-30 21:20:51 +0000
commit869f8b6053cfea7b6ffa4781fda3d05fb3a93c69 (patch)
treeee6fda081fff66e50b297e247fee95ff95eb299f
parent2a2990473fe999c3680a2342922c14412ded7ddf (diff)
ccc: Infer action type upfront.
- More straightforward, e.g. -E should always imply action = 'preprocess' (I think). - Pass another option through for OS X. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56884 91177308-0d34-0410-b5e6-96231b3b80d8
-rwxr-xr-xutils/ccc22
1 files changed, 13 insertions, 9 deletions
diff --git a/utils/ccc b/utils/ccc
index e2ede507e9..d4e9799b39 100755
--- a/utils/ccc
+++ b/utils/ccc
@@ -171,8 +171,18 @@ def inferlanguage(extension):
else:
return ""
+def inferaction(args):
+ if '-E' in args:
+ return 'preprocess'
+ if '-c' in args:
+ return 'compile'
+ for arg in args:
+ if arg.startswith('-print-prog-name'):
+ return 'pring-prog-name'
+ return 'link'
+
def main(args):
- action = 'link'
+ action = inferaction(args)
output = ''
compile_opts = []
link_opts = []
@@ -186,12 +196,6 @@ def main(args):
arg = args[i]
# Modes ccc supports
- if arg == '-E':
- action = 'preprocess'
- if arg == '-c':
- action = 'compile'
- if arg.startswith('-print-prog-name'):
- action = 'print-prog-name'
if arg == '-save-temps':
save_temps = 1
if arg == '-emit-llvm' or arg == '--emit-llvm':
@@ -229,7 +233,7 @@ def main(args):
i += 1
# Options with no arguments that should pass through
- if arg in ('-dynamiclib',):
+ if arg in ('-dynamiclib','-bundle'):
link_opts.append(arg)
# Options with one argument that should pass through
@@ -280,7 +284,7 @@ def main(args):
i += 1
i += 1
-
+
if action == 'print-prog-name':
# assume we can handle everything
print sys.argv[0]