summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Driver/ToolChain.h5
-rw-r--r--clang/lib/Driver/Driver.cpp5
2 files changed, 6 insertions, 4 deletions
diff --git a/clang/include/clang/Driver/ToolChain.h b/clang/include/clang/Driver/ToolChain.h
index 560df19e25c..4471f21f498 100644
--- a/clang/include/clang/Driver/ToolChain.h
+++ b/clang/include/clang/Driver/ToolChain.h
@@ -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
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index ec289875a8b..5b34f9842dc 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -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;
OpenPOWER on IntegriCloud