diff options
author | Artem Belevich <tra@google.com> | 2015-07-13 20:21:06 +0000 |
---|---|---|
committer | Artem Belevich <tra@google.com> | 2015-07-13 20:21:06 +0000 |
commit | cd42e7f77a788969bc9365b8b0b2f21e2308e04e (patch) | |
tree | 454855373f13ce3944547ca616219084bb0f4bbe /clang/tools/libclang/CIndex.cpp | |
parent | 6145ad2d3654350110e25460d0fcd9656a46e36c (diff) | |
download | bcm5719-llvm-cd42e7f77a788969bc9365b8b0b2f21e2308e04e.tar.gz bcm5719-llvm-cd42e7f77a788969bc9365b8b0b2f21e2308e04e.zip |
[cuda] Driver changes to compile and stitch together host and device-side CUDA code.
- Changed driver pipeline to compile host and device side of CUDA
files and incorporate results of device-side compilation into host
object file.
- Added a test for cuda pipeline creation in clang driver.
New clang options:
--cuda-host-only - Do host-side compilation only.
--cuda-device-only - Do device-side compilation only.
--cuda-gpu-arch=<ARCH> - specify GPU architecture for device-side
compilation. E.g. sm_35, sm_30. Default is sm_20. May be used more
than once in which case one device-compilation will be done per
unique specified GPU architecture.
Differential Revision: http://reviews.llvm.org/D9509
llvm-svn: 242058
Diffstat (limited to 'clang/tools/libclang/CIndex.cpp')
-rw-r--r-- | clang/tools/libclang/CIndex.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index 49b9da23865..6e48bab9f50 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -3102,6 +3102,12 @@ static void clang_parseTranslationUnit_Impl(void *UserData) { /*AllowPCHWithCompilerErrors=*/true, SkipFunctionBodies, /*UserFilesAreVolatile=*/true, ForSerialization, &ErrUnit)); + // Early failures in LoadFromCommandLine may return with ErrUnit unset. + if (!Unit && !ErrUnit) { + PTUI->result = CXError_ASTReadError; + return; + } + if (NumErrors != Diags->getClient()->getNumErrors()) { // Make sure to check that 'Unit' is non-NULL. if (CXXIdx->getDisplayDiagnostics()) |