@@ -1889,7 +1889,7 @@ static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args,
1889
1889
1890
1890
void CompilerInvocation::setLangDefaults (LangOptions &Opts, InputKind IK,
1891
1891
const llvm::Triple &T,
1892
- PreprocessorOptions &PPOpts ,
1892
+ std::vector<std::string> &Includes ,
1893
1893
LangStandard::Kind LangStd) {
1894
1894
// Set some properties which depend solely on the input kind; it would be nice
1895
1895
// to move these to the language standard, and have the driver resolve the
@@ -2000,9 +2000,9 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK,
2000
2000
if (Opts.IncludeDefaultHeader ) {
2001
2001
if (Opts.DeclareOpenCLBuiltins ) {
2002
2002
// Only include base header file for builtin types and constants.
2003
- PPOpts. Includes .push_back (" opencl-c-base.h" );
2003
+ Includes.push_back (" opencl-c-base.h" );
2004
2004
} else {
2005
- PPOpts. Includes .push_back (" opencl-c.h" );
2005
+ Includes.push_back (" opencl-c.h" );
2006
2006
}
2007
2007
}
2008
2008
}
@@ -2138,8 +2138,8 @@ static const StringRef GetInputKindName(InputKind IK) {
2138
2138
}
2139
2139
2140
2140
static void ParseLangArgs (LangOptions &Opts, ArgList &Args, InputKind IK,
2141
- const TargetOptions &TargetOpts ,
2142
- PreprocessorOptions &PPOpts ,
2141
+ const llvm::Triple &T ,
2142
+ std::vector<std::string> &Includes ,
2143
2143
DiagnosticsEngine &Diags) {
2144
2144
// FIXME: Cleanup per-file based stuff.
2145
2145
LangStandard::Kind LangStd = LangStandard::lang_unspecified;
@@ -2212,8 +2212,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
2212
2212
2213
2213
Opts.SYCLIsDevice = Opts.SYCL && Args.hasArg (options::OPT_fsycl_is_device);
2214
2214
2215
- llvm::Triple T (TargetOpts.Triple );
2216
- CompilerInvocation::setLangDefaults (Opts, IK, T, PPOpts, LangStd);
2215
+ CompilerInvocation::setLangDefaults (Opts, IK, T, Includes, LangStd);
2217
2216
2218
2217
// -cl-strict-aliasing needs to emit diagnostic in the case where CL > 1.0.
2219
2218
// This option should be deprecated for CL > 1.0 because
@@ -2490,7 +2489,6 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
2490
2489
Diags.Report (diag::err_drv_argument_not_allowed_with)
2491
2490
<< A->getSpelling () << " -fdefault-calling-conv" ;
2492
2491
else {
2493
- llvm::Triple T (TargetOpts.Triple );
2494
2492
if (T.getArch () != llvm::Triple::x86)
2495
2493
Diags.Report (diag::err_drv_argument_not_allowed_with)
2496
2494
<< A->getSpelling () << T.getTriple ();
@@ -2527,8 +2525,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
2527
2525
// Add unsupported host targets here:
2528
2526
case llvm::Triple::nvptx:
2529
2527
case llvm::Triple::nvptx64:
2530
- Diags.Report (diag::err_drv_omp_host_target_not_supported)
2531
- << TargetOpts.Triple ;
2528
+ Diags.Report (diag::err_drv_omp_host_target_not_supported) << T.str ();
2532
2529
break ;
2533
2530
}
2534
2531
}
@@ -2960,8 +2957,8 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res,
2960
2957
} else {
2961
2958
// Other LangOpts are only initialized when the input is not AST or LLVM IR.
2962
2959
// FIXME: Should we really be calling this for an Language::Asm input?
2963
- ParseLangArgs (LangOpts, Args, DashX, Res.getTargetOpts () ,
2964
- Res. getPreprocessorOpts (), Diags);
2960
+ ParseLangArgs (LangOpts, Args, DashX, T, Res.getPreprocessorOpts (). Includes ,
2961
+ Diags);
2965
2962
if (Res.getFrontendOpts ().ProgramAction == frontend::RewriteObjC)
2966
2963
LangOpts.ObjCExceptions = 1 ;
2967
2964
if (T.isOSDarwin () && DashX.isPreprocessed ()) {
0 commit comments