Skip to content

Commit 16aa00b

Browse files
committed
[clang][cli] Port FileSystem options to new option parsing system
Depends on D84187 Reviewed By: dexonsmith Original patch by Daniel Grumberg. Differential Revision: https://reviews.llvm.org/D84188
1 parent 98a4289 commit 16aa00b

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3354,7 +3354,8 @@ def : Flag<["-"], "no-integrated-as">, Alias<fno_integrated_as>,
33543354
Flags<[CC1Option, NoXarchOption]>;
33553355

33563356
def working_directory : JoinedOrSeparate<["-"], "working-directory">, Flags<[CC1Option]>,
3357-
HelpText<"Resolve file paths relative to the specified directory">;
3357+
HelpText<"Resolve file paths relative to the specified directory">,
3358+
MarshallingInfoString<"FileSystemOpts.WorkingDir">;
33583359
def working_directory_EQ : Joined<["-"], "working-directory=">, Flags<[CC1Option]>,
33593360
Alias<working_directory>;
33603361

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1876,10 +1876,6 @@ bool clang::ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
18761876
return Success;
18771877
}
18781878

1879-
static void ParseFileSystemArgs(FileSystemOptions &Opts, ArgList &Args) {
1880-
Opts.WorkingDir = std::string(Args.getLastArgValue(OPT_working_directory));
1881-
}
1882-
18831879
/// Parse the argument to the -ftest-module-file-extension
18841880
/// command-line argument.
18851881
///
@@ -3839,7 +3835,6 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res,
38393835
Success &= ParseDiagnosticArgs(Res.getDiagnosticOpts(), Args, &Diags,
38403836
/*DefaultDiagColor=*/false);
38413837
ParseCommentArgs(LangOpts.CommentOpts, Args);
3842-
ParseFileSystemArgs(Res.getFileSystemOpts(), Args);
38433838
// FIXME: We shouldn't have to pass the DashX option around here
38443839
InputKind DashX = ParseFrontendArgs(Res.getFrontendOpts(), Args, Diags,
38453840
LangOpts.IsHeaderFile);

0 commit comments

Comments
 (0)