ccc: Add --analyze driver mode (for running static analyzer).

 - For now forces generation of plist files, need to think about the
   right interface.

 - Changed -fsyntax-only mode to be its own phase (more consistent).

 - Add -WA, for passing options verbatim to analyzer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62649 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/ccc/ccclib/ToolChain.py b/tools/ccc/ccclib/ToolChain.py
index ac1cc0a..ee244d7 100644
--- a/tools/ccc/ccclib/ToolChain.py
+++ b/tools/ccc/ccclib/ToolChain.py
@@ -51,15 +51,17 @@
         self.gccVersion = gccVersion
         self.archName = archName
 
+        self.clangTool = Tools.Clang_CompileTool(self)
         self.toolMap = {
             Phases.PreprocessPhase : Tools.Darwin_X86_PreprocessTool(self),
+            Phases.AnalyzePhase : self.clangTool,
+            Phases.SyntaxOnlyPhase : Tools.Darwin_X86_CompileTool(self),
             Phases.CompilePhase : Tools.Darwin_X86_CompileTool(self),
             Phases.PrecompilePhase : Tools.Darwin_X86_CompileTool(self),
             Phases.AssemblePhase : Tools.Darwin_AssembleTool(self),
             Phases.LinkPhase : Tools.Darwin_X86_LinkTool(self),
             Phases.LipoPhase : Tools.LipoTool(),
             }
-        self.clangTool = Tools.Clang_CompileTool()
 
     def getToolChainDir(self):
         return 'i686-apple-darwin%d/%s' % (self.darwinVersion[0],
@@ -171,6 +173,8 @@
         super(Generic_GCC_ToolChain, self).__init__(driver)
         self.toolMap = {
             Phases.PreprocessPhase : Tools.GCC_PreprocessTool(),
+            Phases.AnalyzePhase : Tools.Clang_CompileTool(self),
+            Phases.SyntaxOnlyPhase : Tools.GCC_CompileTool(),
             Phases.CompilePhase : Tools.GCC_CompileTool(),
             Phases.PrecompilePhase : Tools.GCC_PrecompileTool(),
             Phases.AssemblePhase : Tools.GCC_AssembleTool(),