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:
Jordan Rose
2015-04-06 21:23:57 +00:00
parent f13bffcba3
commit c5e46b524d
4 changed files with 39 additions and 10 deletions

View File

@@ -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;
}