Skip to content
This repository was archived by the owner on Apr 2, 2020. It is now read-only.

Commit cc336aa

Browse files
authored
Fix MainThreadCheckerRuntime.cpp to recognize properties from functions. (#681)
* Fix MainThreadCheckerRuntime.cpp to recognize properties from functions. <rdar://problem/36557167> * Move the fix to <swiftlang/swift#17150> and update MainThreadCheckerRuntime.cpp to stop using .loadAllMembers().
1 parent 2bd1d2e commit cc336aa

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

packages/Python/lldbsuite/test/functionalities/mtc/swift-property/TestMTCSwiftProperty.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class MTCSwiftPropertyTestCase(TestBase):
1717
mydir = TestBase.compute_mydir(__file__)
1818

1919
@skipUnlessDarwin
20-
@expectedFailureAll(bugnumber="rdar://problem/36557167")
2120
def test(self):
2221
self.mtc_dylib_path = findMainThreadCheckerDylib()
2322
if self.mtc_dylib_path == "":

source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.cpp

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -118,20 +118,9 @@ static std::string TranslateObjCNameToSwiftName(std::string className,
118118

119119
// If the decl is actually an accessor, use the property name instead.
120120
swift::AbstractFunctionDecl *decl = funcs.front();
121-
if (auto func = llvm::dyn_cast<swift::FuncDecl>(decl)) {
122-
swift::DeclContext *funcCtx = func->getParent();
123-
// We need to loadAllMembers(), otherwise 'isAccessor' returns false.
124-
if (auto extension = llvm::dyn_cast<swift::ExtensionDecl>(funcCtx)) {
125-
extension->loadAllMembers();
126-
} else if (auto nominal =
127-
llvm::dyn_cast<swift::NominalTypeDecl>(funcCtx)) {
128-
nominal->loadAllMembers();
129-
}
130-
131-
if (auto accessor = llvm::dyn_cast<swift::AccessorDecl>(func)) {
132-
result = accessor->getStorage()->getFullName();
133-
return;
134-
}
121+
if (auto accessor = llvm::dyn_cast<swift::AccessorDecl>(decl)) {
122+
result = accessor->getStorage()->getFullName();
123+
return;
135124
}
136125

137126
result = decl->getFullName();

0 commit comments

Comments
 (0)