jlebar added inline comments.
================
Comment at: clang/lib/Driver/Driver.cpp:479
+ // the device toolchain we create depends on both.
+ ToolChain *&CudaTC = ToolChains[CudaTriple.str() + "/" + HostTriple.str()];
+ if (!CudaTC) {
----------------
sfantao wrote:
> I am not sure I understand why to pair host and device toolchain in the map.
> The driver can be used to several compilations, but how do these compilation
> use different host toolchains? Can you give an example of an invocation?
> Maybe add it to the regression tests bellow.
> The driver can be used to several compilations, but how do these compilation
> use different host toolchains?
I don't know if it's possible to do so when compiling through the command line.
But if using clang as a library, you can create a Driver and use it for
multiple compilations with arbitrary targets.
I am not certain we do this inside of the tree, although there are a few places
where we create Driver objects, such as lib/Tooling/CompilationDatabase.cpp and
lib/Tooling/Tooling.cpp. But also anyone downstream can presumably use clang
this way.
https://reviews.llvm.org/D26774
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits