@@ -712,6 +712,42 @@ void MSVCToolChain::AddSystemIncludeWithSubfolder(
712712 addSystemInclude (DriverArgs, CC1Args, path);
713713}
714714
715+ #ifdef ENABLE_CLASSIC_FLANG
716+ // / Convert path list to Fortran frontend argument
717+ static void AddFlangSysIncludeArg (const ArgList &DriverArgs,
718+ ArgStringList &Flang1Args,
719+ ToolChain::path_list IncludePathList) {
720+ std::string ArgValue; // Path argument value
721+
722+ // Make up argument value consisting of paths separated by colons
723+ bool first = true ;
724+ for (auto P : IncludePathList) {
725+ if (first) {
726+ first = false ;
727+ } else {
728+ ArgValue += " ;" ;
729+ }
730+ ArgValue += P;
731+ }
732+
733+ // Add the argument
734+ Flang1Args.push_back (" -stdinc" );
735+ Flang1Args.push_back (DriverArgs.MakeArgString (ArgValue));
736+ }
737+
738+ void MSVCToolChain::AddFlangSystemIncludeArgs (const ArgList &DriverArgs,
739+ ArgStringList &Flang1Args) const {
740+ path_list IncludePathList;
741+ const Driver &D = getDriver ();
742+ if (DriverArgs.hasArg (options::OPT_nostdinc))
743+ return ;
744+ SmallString<128 > P (D.InstalledDir );
745+ llvm::sys::path::append (P, " ../include" );
746+ IncludePathList.push_back (P.c_str ());
747+ AddFlangSysIncludeArg (DriverArgs, Flang1Args, IncludePathList);
748+ }
749+ #endif
750+
715751void MSVCToolChain::AddClangSystemIncludeArgs (const ArgList &DriverArgs,
716752 ArgStringList &CC1Args) const {
717753 if (DriverArgs.hasArg (options::OPT_nostdinc))
0 commit comments