Skip to content

Commit 6ef8f45

Browse files
committed
NFC: Move AccessNotesPath to LangOptions
1 parent 3ee222f commit 6ef8f45

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,9 @@ namespace swift {
493493
std::shared_ptr<llvm::Regex> OptimizationRemarkPassedPattern;
494494
std::shared_ptr<llvm::Regex> OptimizationRemarkMissedPattern;
495495

496+
/// The path to load access notes from.
497+
std::string AccessNotesPath;
498+
496499
/// How should we emit diagnostics about access notes?
497500
AccessNoteDiagnosticBehavior AccessNoteBehavior =
498501
AccessNoteDiagnosticBehavior::RemarkOnFailureOrSuccess;

include/swift/Frontend/FrontendOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ class FrontendOptions {
107107
/// The path to which we should store indexing data, if any.
108108
std::string IndexStorePath;
109109

110-
/// The path to load access notes from.
111-
std::string AccessNotesPath;
112-
113110
/// The path to look in when loading a module interface file, to see if a
114111
/// binary module has already been built for use by the compiler.
115112
std::string PrebuiltModuleCachePath;

lib/Frontend/ArgsToFrontendOptionsConverter.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,6 @@ bool ArgsToFrontendOptionsConverter::convert(
372372
if (!computeModuleAliases())
373373
return true;
374374

375-
if (const Arg *A = Args.getLastArg(OPT_access_notes_path))
376-
Opts.AccessNotesPath = A->getValue();
377-
378375
if (const Arg *A = Args.getLastArg(OPT_serialize_debugging_options,
379376
OPT_no_serialize_debugging_options)) {
380377
Opts.SerializeOptionsForDebugging =

lib/Frontend/CompilerInvocation.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,6 +1423,9 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
14231423
Opts.OptimizationRemarkMissedPattern =
14241424
generateOptimizationRemarkRegex(Diags, Args, A);
14251425

1426+
if (const Arg *A = Args.getLastArg(OPT_access_notes_path))
1427+
Opts.AccessNotesPath = A->getValue();
1428+
14261429
if (Arg *A = Args.getLastArg(OPT_Raccess_note)) {
14271430
auto value =
14281431
llvm::StringSwitch<std::optional<AccessNoteDiagnosticBehavior>>(

lib/Frontend/Frontend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,12 +1554,12 @@ void CompilerInstance::setMainModule(ModuleDecl *newMod) {
15541554
}
15551555

15561556
void CompilerInstance::loadAccessNotesIfNeeded() {
1557-
if (Invocation.getFrontendOptions().AccessNotesPath.empty())
1557+
if (Invocation.getLangOptions().AccessNotesPath.empty())
15581558
return;
15591559

15601560
auto *mainModule = getMainModule();
15611561

1562-
auto accessNotesPath = Invocation.getFrontendOptions().AccessNotesPath;
1562+
auto accessNotesPath = Invocation.getLangOptions().AccessNotesPath;
15631563

15641564
auto bufferOrError =
15651565
swift::vfs::getFileOrSTDIN(getFileSystem(), accessNotesPath);

tools/swift-ide-test/swift-ide-test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4571,8 +4571,8 @@ int main(int argc, char *argv[]) {
45714571
options::ModuleCachePath[options::ModuleCachePath.size()-1];
45724572
}
45734573
if (!options::AccessNotesPath.empty()) {
4574-
InitInvok.getFrontendOptions().AccessNotesPath =
4575-
options::AccessNotesPath[options::AccessNotesPath.size()-1];
4574+
InitInvok.getLangOptions().AccessNotesPath =
4575+
options::AccessNotesPath[options::AccessNotesPath.size() - 1];
45764576
}
45774577
if (options::ParseAsLibrary) {
45784578
InitInvok.getFrontendOptions().InputMode =

0 commit comments

Comments
 (0)