[cfe-commits] r63349 - in /cfe/trunk/tools/ccc: ccclib/Arguments.py ccclib/Tools.py test/ccc/Xclang.c test/ccc/analyze.c
Daniel Dunbar
daniel at zuster.org
Thu Jan 29 16:24:17 PST 2009
Author: ddunbar
Date: Thu Jan 29 18:24:16 2009
New Revision: 63349
URL: http://llvm.org/viewvc/llvm-project?rev=63349&view=rev
Log:
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.
Added:
cfe/trunk/tools/ccc/test/ccc/Xclang.c
Modified:
cfe/trunk/tools/ccc/ccclib/Arguments.py
cfe/trunk/tools/ccc/ccclib/Tools.py
cfe/trunk/tools/ccc/test/ccc/analyze.c
Modified: cfe/trunk/tools/ccc/ccclib/Arguments.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/ccclib/Arguments.py?rev=63349&r1=63348&r2=63349&view=diff
==============================================================================
--- cfe/trunk/tools/ccc/ccclib/Arguments.py (original)
+++ cfe/trunk/tools/ccc/ccclib/Arguments.py Thu Jan 29 18:24:16 2009
@@ -549,7 +549,8 @@
# 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'))
Modified: cfe/trunk/tools/ccc/ccclib/Tools.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/ccclib/Tools.py?rev=63349&r1=63348&r2=63349&view=diff
==============================================================================
--- cfe/trunk/tools/ccc/ccclib/Tools.py (original)
+++ cfe/trunk/tools/ccc/ccclib/Tools.py Thu Jan 29 18:24:16 2009
@@ -225,9 +225,9 @@
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 @@
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))
Added: cfe/trunk/tools/ccc/test/ccc/Xclang.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/test/ccc/Xclang.c?rev=63349&view=auto
==============================================================================
--- cfe/trunk/tools/ccc/test/ccc/Xclang.c (added)
+++ cfe/trunk/tools/ccc/test/ccc/Xclang.c Thu Jan 29 18:24:16 2009
@@ -0,0 +1 @@
+// RUN: xcc -fsyntax-only -Xclang --help %s | grep 'OVERVIEW: llvm clang cfe'
Modified: cfe/trunk/tools/ccc/test/ccc/analyze.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/test/ccc/analyze.c?rev=63349&r1=63348&r2=63349&view=diff
==============================================================================
--- cfe/trunk/tools/ccc/test/ccc/analyze.c (original)
+++ cfe/trunk/tools/ccc/test/ccc/analyze.c Thu Jan 29 18:24:16 2009
@@ -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)
More information about the cfe-commits
mailing list