]> granicus.if.org Git - clang/commitdiff
Allow ToolChain to decide if Clang is not the right C compiler.
authorDouglas Katzman <dougk@google.com>
Fri, 12 Jun 2015 15:45:21 +0000 (15:45 +0000)
committerDouglas Katzman <dougk@google.com>
Fri, 12 Jun 2015 15:45:21 +0000 (15:45 +0000)
Removed comment in Driver::ShouldUseClangCompiler implying that there
was an opt-out ability at that point - there isn't.

Differential Revision: http://reviews.llvm.org/D10246

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239608 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/ToolChain.h
lib/Driver/Driver.cpp

index 560df19e25cea6bce09d5ac9c19cba5e2d3c243a..4471f21f498dc2c969fdc7fc83aa7c44f234161e 100644 (file)
@@ -164,7 +164,10 @@ public:
   }
 
   /// Choose a tool to use to handle the action \p JA.
-  Tool *SelectTool(const JobAction &JA) const;
+  ///
+  /// This can be overridden when a particular ToolChain needs to use
+  /// a C compiler other than Clang.
+  virtual Tool *SelectTool(const JobAction &JA) const;
 
   // Helper methods
 
index ec289875a8b4e1d43bab831e0eab22a99ad5bed4..5b34f9842dcd3ee22ffc77791f46bd2392e81c56 100644 (file)
@@ -2117,13 +2117,12 @@ const ToolChain &Driver::getToolChain(const ArgList &Args,
 }
 
 bool Driver::ShouldUseClangCompiler(const JobAction &JA) const {
-  // Check if user requested no clang, or clang doesn't understand this type (we
-  // only handle single inputs for now).
+  // Say "no" if there is not exactly one input of a type clang understands.
   if (JA.size() != 1 ||
       !types::isAcceptedByClang((*JA.begin())->getType()))
     return false;
 
-  // Otherwise make sure this is an action clang understands.
+  // And say "no" if this is not a kind of action clang understands.
   if (!isa<PreprocessJobAction>(JA) && !isa<PrecompileJobAction>(JA) &&
       !isa<CompileJobAction>(JA) && !isa<BackendJobAction>(JA))
     return false;