mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add Module::failedToLoad(), mainly for REPL and debugging purposes.
LLDB asked for this to differentiate between modules loaded successfully and modules that are correctly found but can't be loaded for some reason. rdar://problem/19750055 Swift SVN r27041
This commit is contained in:
@@ -395,8 +395,8 @@ DerivedFileUnit &Module::getDerivedFileUnit() const {
|
||||
}
|
||||
|
||||
VarDecl *Module::getDSOHandle() {
|
||||
if (DSOHandleAndTestingEnabled.getPointer())
|
||||
return DSOHandleAndTestingEnabled.getPointer();
|
||||
if (DSOHandleAndFlags.getPointer())
|
||||
return DSOHandleAndFlags.getPointer();
|
||||
|
||||
auto unsafeMutablePtr = Ctx.getUnsafeMutablePointerDecl();
|
||||
if (!unsafeMutablePtr)
|
||||
@@ -418,7 +418,7 @@ VarDecl *Module::getDSOHandle() {
|
||||
handleVar->getAttrs().add(
|
||||
new (Ctx) AsmnameAttr("__dso_handle", /*Implicit=*/true));
|
||||
handleVar->setAccessibility(Accessibility::Internal);
|
||||
DSOHandleAndTestingEnabled.setPointer(handleVar);
|
||||
DSOHandleAndFlags.setPointer(handleVar);
|
||||
return handleVar;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user