diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-01-30 00:24:16 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-01-30 00:24:16 +0000 |
commit | 6949ce44f8973678319ada99080f623ad0547e09 (patch) | |
tree | 6b25311b49e95895c6b039753cd5a1420270972a | |
parent | e4c0da83128f53805a22905125a1e707e6ef7246 (diff) |
ccc: Add -Xclang option, rename -WA, to -Xanalyzer.
- -Xclang always forwards to clang
- -Xanalyzer replaces -WA,; it seems like the cleaner mechanism and
is more readable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63349 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | tools/ccc/ccclib/Arguments.py | 3 | ||||
-rw-r--r-- | tools/ccc/ccclib/Tools.py | 9 | ||||
-rw-r--r-- | tools/ccc/test/ccc/Xclang.c | 1 | ||||
-rw-r--r-- | tools/ccc/test/ccc/analyze.c | 5 |
4 files changed, 13 insertions, 5 deletions
diff --git a/tools/ccc/ccclib/Arguments.py b/tools/ccc/ccclib/Arguments.py index bb259137f5..1ff76eccd9 100644 --- a/tools/ccc/ccclib/Arguments.py +++ b/tools/ccc/ccclib/Arguments.py @@ -549,7 +549,8 @@ class OptionParser: # Blanket pass-through options. - self.WAOption = self.addOption(CommaJoinedOption('-WA,')) + self.XanalyzerOption = self.addOption(SeparateOption('-Xanalyzer')) + self.XclangOption = self.addOption(SeparateOption('-Xclang')) self.WaOption = self.addOption(CommaJoinedOption('-Wa,')) self.XassemblerOption = self.addOption(SeparateOption('-Xassembler')) diff --git a/tools/ccc/ccclib/Tools.py b/tools/ccc/ccclib/Tools.py index 61d6a24d34..ed138141b2 100644 --- a/tools/ccc/ccclib/Tools.py +++ b/tools/ccc/ccclib/Tools.py @@ -225,9 +225,9 @@ class Clang_CompileTool(Tool): cmd_args.append('-analyzer-output-plist') - # Add -WA, arguments when running as analyzer. - for arg in arglist.getArgs(arglist.parser.WAOption): - cmd_args.extend(arglist.renderAsInput(arg)) + # Add -Xanalyzer arguments when running as analyzer. + for arg in arglist.getArgs(arglist.parser.XanalyzerOption): + cmd_args.extend(arglist.getValues(arg)) else: # Perform argument translation for LLVM backend. This # takes some care in reconciling with llvm-gcc. The @@ -325,6 +325,9 @@ class Clang_CompileTool(Tool): arglist.addLastArg(cmd_args, arglist.parser.f_pascalStringsOption) arglist.addLastArg(cmd_args, arglist.parser.f_writableStringsOption) + for arg in arglist.getArgs(arglist.parser.XclangOption): + cmd_args.extend(arglist.getValues(arg)) + if arch is not None: cmd_args.extend(arglist.render(arch)) diff --git a/tools/ccc/test/ccc/Xclang.c b/tools/ccc/test/ccc/Xclang.c new file mode 100644 index 0000000000..39da6a8198 --- /dev/null +++ b/tools/ccc/test/ccc/Xclang.c @@ -0,0 +1 @@ +// RUN: xcc -fsyntax-only -Xclang --help %s | grep 'OVERVIEW: llvm clang cfe' diff --git a/tools/ccc/test/ccc/analyze.c b/tools/ccc/test/ccc/analyze.c index b03c6af9c1..6693c76667 100644 --- a/tools/ccc/test/ccc/analyze.c +++ b/tools/ccc/test/ccc/analyze.c @@ -1,5 +1,8 @@ // RUN: xcc --analyze %s -o %t && -// RUN: grep '<string>Dereference of null pointer.</string>' %t +// RUN: grep '<string>Dereference of null pointer.</string>' %t && + +// RUN: xcc -### --analyze %s -Xanalyzer -check-that-program-halts &> %t && +// RUN: grep 'check-that-program-halts' %t void f(int *p) { if (!p) |