mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
NFC: Move AccessNotesPath to LangOptions
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -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>>(
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user