aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2008-04-22 04:47:32 +0000
committerNate Begeman <natebegeman@mac.com>2008-04-22 04:47:32 +0000
commit4cd3603978a3bfc0662fe31ac9ed546453d438ac (patch)
treeb37d786c60b88f0749447f36a4591ad7257e7676
parentc70bee863b6f800d7c88f409e89dc85ed867ef64 (diff)
Don't double-increment counter for -arch and -isysroot
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50082 91177308-0d34-0410-b5e6-96231b3b80d8
-rwxr-xr-xutils/ccc-analyzer24
1 files changed, 16 insertions, 8 deletions
diff --git a/utils/ccc-analyzer b/utils/ccc-analyzer
index d564466973..abd86f85bf 100755
--- a/utils/ccc-analyzer
+++ b/utils/ccc-analyzer
@@ -174,24 +174,32 @@ def main(args):
if arg[:5] in ['-std=']:
compile_opts.append(arg)
- # Options with one argument that should pass through
- if arg in ['-include', '-isysroot', '-arch']:
+ # Options with one argument that should pass through to compiler
+ if arg == 'include':
compile_opts.append(arg)
compile_opts.append(args[i+1])
i += 1
- # Prefix matches for the link mode
- if arg[:2] in ['-l', '-L', '-O', '-F']:
- if arg == '-O': arg = '-O1'
- if arg == '-Os': arg = '-O2'
+ # Options with one argument that should pass through to linker
+ if arg == 'framework':
link_opts.append(arg)
+ link_opts.append(args[i+1])
+ i += 1
- # Options with one argument that should pass through
- if arg in ['-framework', '-isysroot', '-arch']:
+ # Options with one argument that should pass through to both
+ if arg in ['-isysroot', '-arch']:
+ compile_opts.append(arg)
+ compile_opts.append(args[i+1])
link_opts.append(arg)
link_opts.append(args[i+1])
i += 1
+ # Prefix matches for the link mode
+ if arg[:2] in ['-l', '-L', '-O', '-F']:
+ if arg == '-O': arg = '-O1'
+ if arg == '-Os': arg = '-O2'
+ link_opts.append(arg)
+
# Input files
if arg == '-filelist':
f = open(args[i+1])