summaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorArtem Belevich <tra@google.com>2015-03-19 17:32:06 +0000
committerArtem Belevich <tra@google.com>2015-03-19 17:32:06 +0000
commit2b2e574cc3c0bdcc18b4cc56a38dc63d7ff32efd (patch)
tree2a6f48b680987a0fa675f4df6581e89b45f907c9 /lib/Frontend/CompilerInvocation.cpp
parent4c42621966c8dd9e7247d4dfc518dbdd6fbec46b (diff)
downloadclang-2b2e574cc3c0bdcc18b4cc56a38dc63d7ff32efd.tar.gz
Ensure that we still parse preprocessed CUDA files as CUDA when we use
-save-temps option. Summary: Fixes PR22926. Review: http://reviews.llvm.org/D8383 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@232737 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--lib/Frontend/CompilerInvocation.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index 3c818b02fd..0b15935262 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/lib/Frontend/CompilerInvocation.cpp
@@ -990,6 +990,7 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
.Case("cpp-output", IK_PreprocessedC)
.Case("assembler-with-cpp", IK_Asm)
.Case("c++-cpp-output", IK_PreprocessedCXX)
+ .Case("cuda-cpp-output", IK_PreprocessedCuda)
.Case("objective-c-cpp-output", IK_PreprocessedObjC)
.Case("objc-cpp-output", IK_PreprocessedObjC)
.Case("objective-c++-cpp-output", IK_PreprocessedObjCXX)
@@ -1193,6 +1194,7 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK,
LangStd = LangStandard::lang_opencl;
break;
case IK_CUDA:
+ case IK_PreprocessedCuda:
LangStd = LangStandard::lang_cuda;
break;
case IK_Asm:
@@ -1245,7 +1247,8 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK,
Opts.NativeHalfType = 1;
}
- Opts.CUDA = LangStd == LangStandard::lang_cuda || IK == IK_CUDA;
+ Opts.CUDA = IK == IK_CUDA || IK == IK_PreprocessedCuda ||
+ LangStd == LangStandard::lang_cuda;
// OpenCL and C++ both have bool, true, false keywords.
Opts.Bool = Opts.OpenCL || Opts.CPlusPlus;
@@ -1360,6 +1363,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
<< A->getAsString(Args) << "OpenCL";
break;
case IK_CUDA:
+ case IK_PreprocessedCuda:
if (!Std.isCPlusPlus())
Diags.Report(diag::err_drv_argument_not_allowed_with)
<< A->getAsString(Args) << "CUDA";