@@ -562,7 +562,8 @@ getInstrProfOptions(const CodeGenOptions &CodeGenOpts,
562562 return Options;
563563}
564564
565- static void setCommandLineOpts (const CodeGenOptions &CodeGenOpts) {
565+ static void setCommandLineOpts (const CodeGenOptions &CodeGenOpts,
566+ vfs::FileSystem &VFS) {
566567 SmallVector<const char *, 16 > BackendArgs;
567568 BackendArgs.push_back (" clang" ); // Fake program name.
568569 if (!CodeGenOpts.DebugPass .empty ()) {
@@ -582,8 +583,9 @@ static void setCommandLineOpts(const CodeGenOptions &CodeGenOpts) {
582583 // FIXME: The command line parser below is not thread-safe and shares a global
583584 // state, so this call might crash or overwrite the options of another Clang
584585 // instance in the same process.
585- llvm::cl::ParseCommandLineOptions (BackendArgs.size () - 1 ,
586- BackendArgs.data ());
586+ llvm::cl::ParseCommandLineOptions (BackendArgs.size () - 1 , BackendArgs.data (),
587+ /* Overview=*/ " " , /* Errs=*/ nullptr ,
588+ /* VFS=*/ &VFS);
587589}
588590
589591void EmitAssemblyHelper::CreateTargetMachine (bool MustCreateTM) {
@@ -1260,7 +1262,7 @@ void EmitAssemblyHelper::RunCodegenPipeline(
12601262void EmitAssemblyHelper::emitAssembly (BackendAction Action,
12611263 std::unique_ptr<raw_pwrite_stream> OS,
12621264 BackendConsumer *BC) {
1263- setCommandLineOpts (CodeGenOpts);
1265+ setCommandLineOpts (CodeGenOpts, CI. getVirtualFileSystem () );
12641266
12651267 bool RequiresCodeGen = actionRequiresCodeGen (Action);
12661268 CreateTargetMachine (RequiresCodeGen);
@@ -1295,7 +1297,7 @@ runThinLTOBackend(CompilerInstance &CI, ModuleSummaryIndex *CombinedIndex,
12951297 ModuleToDefinedGVSummaries;
12961298 CombinedIndex->collectDefinedGVSummariesPerModule (ModuleToDefinedGVSummaries);
12971299
1298- setCommandLineOpts (CGOpts);
1300+ setCommandLineOpts (CGOpts, CI. getVirtualFileSystem () );
12991301
13001302 // We can simply import the values mentioned in the combined index, since
13011303 // we should only invoke this using the individual indexes written out
0 commit comments