llvm-project/clang
Justin Lebar 66c4fd7987 [CUDA] Driver changes to support CUDA compilation on MacOS.
Summary:
Compiling CUDA device code requires us to know the host toolchain,
because CUDA device-side compiles pull in e.g. host headers.

When we only supported Linux compilation, this worked because
CudaToolChain, which is responsible for device-side CUDA compilation,
inherited from the Linux toolchain.  But in order to support MacOS,
CudaToolChain needs to take a HostToolChain pointer.

Because a CUDA toolchain now requires a host TC, we no longer will
create a CUDA toolchain from Driver::getToolChain -- you have to go
through CreateOffloadingDeviceToolChains.  I am *pretty* sure this is
correct, and that previously any attempt to create a CUDA toolchain
through getToolChain() would eventually have resulted in us throwing
"error: unsupported use of NVPTX for host compilation".

In any case hacking getToolChain to create a CUDA+host toolchain would
be wrong, because a Driver can be reused for multiple compilations,
potentially with different host TCs, and getToolChain will cache the
result, causing us to potentially use a stale host TC.

So that's the main change in this patch.

In addition, we have to pull CudaInstallationDetector out of Generic_GCC
and into a top-level class.  It's now used by the Generic_GCC and MachO
toolchains.

Reviewers: tra

Subscribers: rryan, hfinkel, sfantao

Differential Revision: https://reviews.llvm.org/D26774

llvm-svn: 287285
2016-11-18 00:41:22 +00:00
..
INPUTS
bindings [python bindings] Expose CXCursor_FriendDecl as CursorKind.FRIEND_DECL 2016-11-04 06:50:59 +00:00
cmake cmake: Don't try to install exports if there aren't any 2016-11-08 05:02:33 +00:00
docs [clang docs] Minor fix in ClangCheck.rst 2016-11-14 17:31:24 +00:00
examples [Examples] Fix use of sema.LateParsedTemplateMap in clang/examples. 2016-10-10 16:41:00 +00:00
include [CUDA] Driver changes to support CUDA compilation on MacOS. 2016-11-18 00:41:22 +00:00
lib [CUDA] Driver changes to support CUDA compilation on MacOS. 2016-11-18 00:41:22 +00:00
runtime [sanitizer] Passthrough CMAKE_OSX_DEPLOYMENT_TARGET when building compiler-rt from clang/runtime/CMakeLists.txt 2016-11-14 22:38:57 +00:00
test [CUDA] Driver changes to support CUDA compilation on MacOS. 2016-11-18 00:41:22 +00:00
tools Link include-fixer into libclang if clang-tools-extra is checked out. 2016-11-17 15:22:36 +00:00
unittests [Frontend] Allow attaching an external sema source to compiler instance and extra diags to TypoCorrections 2016-11-16 18:15:26 +00:00
utils Use noexcept instead of LLVM_NOEXCEPT now that all compilers support it 2016-10-19 23:39:55 +00:00
www [www] Fix spelling error in checker release notes. 2016-11-16 14:23:41 +00:00
.arcconfig Upgrade all the .arcconfigs to https. 2016-07-14 13:15:37 +00:00
.clang-format
.clang-tidy Try to use readability-identifier-naming check on Clang. 2016-04-13 08:59:49 +00:00
.gitignore
CMakeLists.txt [CMake] Support lld with LTO bootstrap 2016-11-16 23:59:06 +00:00
CODE_OWNERS.TXT
INSTALL.txt
LICENSE.TXT
ModuleInfo.txt
NOTES.txt
README.txt

README.txt

//===----------------------------------------------------------------------===//
// C Language Family Front-end
//===----------------------------------------------------------------------===//

Welcome to Clang.  This is a compiler front-end for the C family of languages
(C, C++, Objective-C, and Objective-C++) which is built as part of the LLVM
compiler infrastructure project.

Unlike many other compiler frontends, Clang is useful for a number of things
beyond just compiling code: we intend for Clang to be host to a number of
different source-level tools.  One example of this is the Clang Static Analyzer.

If you're interested in more (including how to build Clang) it is best to read
the relevant web sites.  Here are some pointers:

Information on Clang:              http://clang.llvm.org/
Building and using Clang:          http://clang.llvm.org/get_started.html
Clang Static Analyzer:             http://clang-analyzer.llvm.org/
Information on the LLVM project:   http://llvm.org/

If you have questions or comments about Clang, a great place to discuss them is
on the Clang development mailing list:
  http://lists.llvm.org/mailman/listinfo/cfe-dev

If you find a bug in Clang, please file it in the LLVM bug tracker:
  http://llvm.org/bugs/