NFC: Move AccessNotesPath to LangOptions

This commit is contained in:
Hamish Knight
2025-09-11 16:54:08 +01:00
parent 3ee222f619
commit 6ef8f45659
6 changed files with 10 additions and 10 deletions

View File

@@ -493,6 +493,9 @@ namespace swift {
std::shared_ptr<llvm::Regex> OptimizationRemarkPassedPattern;
std::shared_ptr<llvm::Regex> OptimizationRemarkMissedPattern;
/// The path to load access notes from.
std::string AccessNotesPath;
/// How should we emit diagnostics about access notes?
AccessNoteDiagnosticBehavior AccessNoteBehavior =
AccessNoteDiagnosticBehavior::RemarkOnFailureOrSuccess;

View File

@@ -107,9 +107,6 @@ public:
/// The path to which we should store indexing data, if any.
std::string IndexStorePath;
/// The path to load access notes from.
std::string AccessNotesPath;
/// The path to look in when loading a module interface file, to see if a
/// binary module has already been built for use by the compiler.
std::string PrebuiltModuleCachePath;

View File

@@ -372,9 +372,6 @@ bool ArgsToFrontendOptionsConverter::convert(
if (!computeModuleAliases())
return true;
if (const Arg *A = Args.getLastArg(OPT_access_notes_path))
Opts.AccessNotesPath = A->getValue();
if (const Arg *A = Args.getLastArg(OPT_serialize_debugging_options,
OPT_no_serialize_debugging_options)) {
Opts.SerializeOptionsForDebugging =

View File

@@ -1423,6 +1423,9 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
Opts.OptimizationRemarkMissedPattern =
generateOptimizationRemarkRegex(Diags, Args, A);
if (const Arg *A = Args.getLastArg(OPT_access_notes_path))
Opts.AccessNotesPath = A->getValue();
if (Arg *A = Args.getLastArg(OPT_Raccess_note)) {
auto value =
llvm::StringSwitch<std::optional<AccessNoteDiagnosticBehavior>>(

View File

@@ -1554,12 +1554,12 @@ void CompilerInstance::setMainModule(ModuleDecl *newMod) {
}
void CompilerInstance::loadAccessNotesIfNeeded() {
if (Invocation.getFrontendOptions().AccessNotesPath.empty())
if (Invocation.getLangOptions().AccessNotesPath.empty())
return;
auto *mainModule = getMainModule();
auto accessNotesPath = Invocation.getFrontendOptions().AccessNotesPath;
auto accessNotesPath = Invocation.getLangOptions().AccessNotesPath;
auto bufferOrError =
swift::vfs::getFileOrSTDIN(getFileSystem(), accessNotesPath);

View File

@@ -4571,7 +4571,7 @@ int main(int argc, char *argv[]) {
options::ModuleCachePath[options::ModuleCachePath.size()-1];
}
if (!options::AccessNotesPath.empty()) {
InitInvok.getFrontendOptions().AccessNotesPath =
InitInvok.getLangOptions().AccessNotesPath =
options::AccessNotesPath[options::AccessNotesPath.size() - 1];
}
if (options::ParseAsLibrary) {