Skip to content

Commit d046f3f

Browse files
authored
Set _swift_reportFatalErrorsToDebugger to true by default and remove all the staging parts (frontend flag, irgen changes). (#11329)
1 parent 1d5400b commit d046f3f

File tree

6 files changed

+1
-38
lines changed

6 files changed

+1
-38
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,6 @@ namespace swift {
189189
/// accesses.
190190
bool DisableTsanInoutInstrumentation = false;
191191

192-
/// \brief Staging flag for reporting runtime issues to the debugger.
193-
bool ReportErrorsToDebugger = false;
194-
195192
/// \brief Staging flag for class resilience, which we do not want to enable
196193
/// fully until more code is in place, to allow the standard library to be
197194
/// tested with value type resilience only.

include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,6 @@ def disable_tsan_inout_instrumentation : Flag<["-"],
302302
"disable-tsan-inout-instrumentation">,
303303
HelpText<"Disable treatment of inout parameters as Thread Sanitizer accesses">;
304304

305-
def report_errors_to_debugger : Flag<["-"], "report-errors-to-debugger">,
306-
HelpText<"Invoke the debugger hook on fatalError calls">;
307-
308305
def enable_infer_import_as_member :
309306
Flag<["-"], "enable-infer-import-as-member">,
310307
HelpText<"Infer when a global could be imported as a member">;

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -975,9 +975,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
975975
Opts.DisableTsanInoutInstrumentation |=
976976
Args.hasArg(OPT_disable_tsan_inout_instrumentation);
977977

978-
Opts.ReportErrorsToDebugger |=
979-
Args.hasArg(OPT_report_errors_to_debugger);
980-
981978
if (FrontendOpts.InputKind == InputFileKind::IFK_SIL)
982979
Opts.DisableAvailabilityChecking = true;
983980

lib/IRGen/IRGenModule.cpp

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
#include "llvm/ADT/PointerUnion.h"
4545
#include "llvm/Support/ErrorHandling.h"
4646
#include "llvm/Support/MD5.h"
47-
#include "llvm/Transforms/Utils/ModuleUtils.h"
4847

4948
#include "GenEnum.h"
5049
#include "GenType.h"
@@ -1016,31 +1015,6 @@ void IRGenModule::emitAutolinkInfo() {
10161015
}
10171016
}
10181017

1019-
void IRGenModule::emitEnableReportErrorsToDebugger() {
1020-
if (!Context.LangOpts.ReportErrorsToDebugger)
1021-
return;
1022-
1023-
if (!getSwiftModule()->hasEntryPoint())
1024-
return;
1025-
1026-
llvm::Function *NewFn = llvm::Function::Create(
1027-
llvm::FunctionType::get(VoidTy, false), llvm::GlobalValue::PrivateLinkage,
1028-
"_swift_enable_report_errors_to_debugger");
1029-
IRGenFunction NewIGF(*this, NewFn);
1030-
NewFn->setAttributes(constructInitialAttributes());
1031-
Module.getFunctionList().push_back(NewFn);
1032-
NewFn->setCallingConv(DefaultCC);
1033-
1034-
llvm::Value *addr =
1035-
Module.getOrInsertGlobal("_swift_reportFatalErrorsToDebugger", Int1Ty);
1036-
llvm::Value *one = llvm::ConstantInt::get(Int1Ty, 1);
1037-
1038-
NewIGF.Builder.CreateStore(one, addr, Alignment(1));
1039-
NewIGF.Builder.CreateRetVoid();
1040-
1041-
llvm::appendToGlobalCtors(Module, NewFn, 0, nullptr);
1042-
}
1043-
10441018
void IRGenModule::cleanupClangCodeGenMetadata() {
10451019
// Remove llvm.ident that ClangCodeGen might have left in the module.
10461020
auto *LLVMIdent = Module.getNamedMetadata("llvm.ident");
@@ -1109,7 +1083,6 @@ bool IRGenModule::finalize() {
11091083
return false;
11101084

11111085
emitAutolinkInfo();
1112-
emitEnableReportErrorsToDebugger();
11131086
emitGlobalLists();
11141087
if (DebugInfo)
11151088
DebugInfo->finalize();

lib/IRGen/IRGenModule.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,6 @@ class IRGenModule {
795795

796796
void emitGlobalLists();
797797
void emitAutolinkInfo();
798-
void emitEnableReportErrorsToDebugger();
799798
void cleanupClangCodeGenMetadata();
800799

801800
//--- Remote reflection metadata --------------------------------------------

stdlib/public/stubs/Assert.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
using namespace swift;
2323

24-
bool swift::_swift_reportFatalErrorsToDebugger = false;
24+
bool swift::_swift_reportFatalErrorsToDebugger = true;
2525

2626
static int swift_asprintf(char **strp, const char *fmt, ...) {
2727
va_list args;

0 commit comments

Comments
 (0)