aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/ccc/ccclib/Arguments.py3
-rw-r--r--tools/ccc/ccclib/Tools.py9
-rw-r--r--tools/ccc/test/ccc/Xclang.c1
-rw-r--r--tools/ccc/test/ccc/analyze.c5
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)