Skip to content

Commit 85052a1

Browse files
committed
deprecate the -experimental-performance-annotations option
Performance annotations can now be used without specifying this option
1 parent 5e2e7e3 commit 85052a1

File tree

7 files changed

+1
-19
lines changed

7 files changed

+1
-19
lines changed

include/swift/AST/DiagnosticsSIL.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,6 @@ WARNING(warn_dead_weak_store,none,
310310
"deallocated here", ())
311311

312312
// performance diagnostics
313-
ERROR(performance_annotations_not_enabled,none,
314-
"use -experimental-performance-annotations to enable performance annotations", ())
315313
ERROR(performance_dynamic_casting,none,
316314
"dynamic casting can lock or allocate", ())
317315
ERROR(performance_metadata,none,

include/swift/AST/SILOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,6 @@ class SILOptions {
125125
/// Controls whether cross module optimization is enabled.
126126
CrossModuleOptimizationMode CMOMode = CrossModuleOptimizationMode::Off;
127127

128-
/// Enables experimental performance annotations.
129-
bool EnablePerformanceAnnotations = false;
130-
131128
/// Enables the emission of stack protectors in functions.
132129
bool EnableStackProtection = true;
133130

include/swift/Option/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ def disableCrossModuleOptimization : Flag<["-"], "disable-cmo">,
935935

936936
def ExperimentalPerformanceAnnotations : Flag<["-"], "experimental-performance-annotations">,
937937
Flags<[HelpHidden, FrontendOption]>,
938-
HelpText<"Enable experimental performance annotations">;
938+
HelpText<"Deprecated, has no effect">;
939939

940940
def RemoveRuntimeAsserts : Flag<["-"], "remove-runtime-asserts">,
941941
Flags<[FrontendOption]>,

lib/DriverTool/sil_opt_main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,6 @@ int sil_opt_main(ArrayRef<const char *> argv, void *MainAddr) {
638638
SILOpts.OptRecordFile = options.RemarksFilename;
639639
SILOpts.OptRecordPasses = options.RemarksPasses;
640640
SILOpts.checkSILModuleLeaks = true;
641-
SILOpts.EnablePerformanceAnnotations = true;
642641
SILOpts.EnableStackProtection = true;
643642
SILOpts.EnableMoveInoutStackProtection = options.EnableMoveInoutStackProtection;
644643

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2058,8 +2058,6 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
20582058
} else if (Args.hasArg(OPT_EnbaleDefaultCMO)) {
20592059
Opts.CMOMode = CrossModuleOptimizationMode::Default;
20602060
}
2061-
Opts.EnablePerformanceAnnotations |=
2062-
Args.hasArg(OPT_ExperimentalPerformanceAnnotations);
20632061
Opts.EnableStackProtection =
20642062
Args.hasFlag(OPT_enable_stack_protector, OPT_disable_stack_protector,
20652063
Opts.EnableStackProtection);

lib/SILOptimizer/Mandatory/PerformanceDiagnostics.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -486,13 +486,6 @@ class PerformanceDiagnosticsPass : public SILModuleTransform {
486486
if (function.wasDeserializedCanonical())
487487
continue;
488488

489-
if (!module->getOptions().EnablePerformanceAnnotations) {
490-
module->getASTContext().Diags.diagnose(
491-
function.getLocation().getSourceLoc(),
492-
diag::performance_annotations_not_enabled);
493-
return;
494-
}
495-
496489
diagnoser.visitFunction(&function, function.getPerfConstraints());
497490
}
498491
}

lib/SILOptimizer/Transforms/GenericSpecializer.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,6 @@ class MandatoryGenericSpecializer : public SILModuleTransform {
208208
void MandatoryGenericSpecializer::run() {
209209
SILModule *module = getModule();
210210

211-
if (!module->getOptions().EnablePerformanceAnnotations)
212-
return;
213-
214211
ClassHierarchyAnalysis *cha = getAnalysis<ClassHierarchyAnalysis>();
215212

216213
llvm::SmallVector<SILFunction *, 8> workList;

0 commit comments

Comments
 (0)