@@ -417,7 +417,8 @@ getOutputStream(StringRef Path, DiagnosticsEngine &Diags, bool Binary) {
417417}
418418
419419static bool ExecuteAssemblerImpl (AssemblerInvocation &Opts,
420- DiagnosticsEngine &Diags) {
420+ DiagnosticsEngine &Diags,
421+ IntrusiveRefCntPtr<vfs::FileSystem> VFS) {
421422 // Get the target specific parser.
422423 std::string Error;
423424 const Target *TheTarget = TargetRegistry::lookupTarget (Opts.Triple , Error);
@@ -440,6 +441,7 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
440441 // Record the location of the include directories so that the lexer can find
441442 // it later.
442443 SrcMgr.setIncludeDirs (Opts.IncludePaths );
444+ SrcMgr.setVirtualFileSystem (VFS);
443445
444446 std::unique_ptr<MCRegisterInfo> MRI (TheTarget->createMCRegInfo (Opts.Triple ));
445447 assert (MRI && " Unable to create target register info!" );
@@ -632,8 +634,9 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
632634}
633635
634636static bool ExecuteAssembler (AssemblerInvocation &Opts,
635- DiagnosticsEngine &Diags) {
636- bool Failed = ExecuteAssemblerImpl (Opts, Diags);
637+ DiagnosticsEngine &Diags,
638+ IntrusiveRefCntPtr<vfs::FileSystem> VFS) {
639+ bool Failed = ExecuteAssemblerImpl (Opts, Diags, VFS);
637640
638641 // Delete output file if there were errors.
639642 if (Failed) {
@@ -714,7 +717,7 @@ int cc1as_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {
714717 }
715718
716719 // Execute the invocation, unless there were parsing errors.
717- bool Failed = Diags.hasErrorOccurred () || ExecuteAssembler (Asm, Diags);
720+ bool Failed = Diags.hasErrorOccurred () || ExecuteAssembler (Asm, Diags, VFS );
718721
719722 // If any timers were active but haven't been destroyed yet, print their
720723 // results now.
0 commit comments