mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SIL: Only enable instruction leaks checking in the frontend's and SILOpt's modules.
Leaks checking is not thread safe and e.g. lldb creates multiple SILModules in multiple threads, which would result in false alarms. Ideally we would make it thread safe, e.g. by putting the instruction counters in the SILModule, but this would be a big effort and it's not worth doing it. Leaks checking in the frontend's and SILOpt's SILModule (not including SILModules created for module interface building) is a good enough test. rdar://84688015
This commit is contained in:
@@ -2065,6 +2065,10 @@ int swift::performFrontend(ArrayRef<const char *> Args,
|
||||
FrontendOptions::ActionType::Immediate) {
|
||||
llvm::setBugReportMsg(nullptr);
|
||||
}
|
||||
|
||||
/// Enable leaks checking because this SILModule is the only one in the process
|
||||
/// (leaks checking is not thread safe).
|
||||
Invocation.getSILOptions().checkSILModuleLeaks = true;
|
||||
|
||||
PrettyStackTraceFrontend frontendTrace(Invocation.getLangOptions());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user