aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Driver/ToolChain.cpp
diff options
context:
space:
mode:
authorAnastasia Stulova <anastasia.stulova@arm.com>2021-12-23 14:57:34 +0000
committerAnastasia Stulova <anastasia.stulova@arm.com>2021-12-23 15:10:09 +0000
commit0045d01af96ff56c5b62d133be076020a33867ff (patch)
tree991c01e75d903199fd2ec931eca2f1fff7e13b9d /clang/lib/Driver/ToolChain.cpp
parent71fc4bbdd2009019acca0f66a7574f97966620fc (diff)
downloadllvm-0045d01af96ff56c5b62d133be076020a33867ff.zip
llvm-0045d01af96ff56c5b62d133be076020a33867ff.tar.gz
llvm-0045d01af96ff56c5b62d133be076020a33867ff.tar.bz2
[SPIR-V] Add a toolchain for SPIR-V in clang
This patch adds a toolchain (TC) for SPIR-V along with the following changes in Driver and base ToolChain and Tool. This is required to provide a mechanism in clang to bypass SPIR-V backend in LLVM for SPIR-V until it lands in LLVM and matures. The SPIR-V code is generated by the SPIRV-LLVM translator tool named 'llvm-spirv' that is sought in 'PATH'. The compilation phases/actions should be bound for SPIR-V in the meantime as following: compile -> tools::Clang backend -> tools::SPIRV::Translator assemble -> tools::SPIRV::Translator However, Driver’s ToolSelector collapses compile-backend-assemble and compile-backend sequences to tools::Clang. To prevent this, added new {use,has}IntegratedBackend properties in ToolChain and Tool to which the ToolSelector reacts on, and which SPIR-V TC overrides. Linking of multiple input files is currently not supported but can be added separately. Differential Revision: https://reviews.llvm.org/D112410 Co-authored-by: Henry Linjamäki <henry.linjamaki@parmance.com>
Diffstat (limited to 'clang/lib/Driver/ToolChain.cpp')
-rw-r--r--clang/lib/Driver/ToolChain.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp
index ac033dd..50c89aa 100644
--- a/clang/lib/Driver/ToolChain.cpp
+++ b/clang/lib/Driver/ToolChain.cpp
@@ -260,7 +260,7 @@ bool ToolChain::IsUnwindTablesDefault(const ArgList &Args) const {
Tool *ToolChain::getClang() const {
if (!Clang)
- Clang.reset(new tools::Clang(*this));
+ Clang.reset(new tools::Clang(*this, useIntegratedBackend()));
return Clang.get();
}