Skip to content

Commit 6a2ae4d

Browse files
committed
ModuleTrace: include ObjC methods' containing type name
1 parent 541cfdb commit 6a2ae4d

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lib/FrontendTool/LoadedModuleTrace.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,12 @@ class ObjcMethodReferenceCollector: public SourceEntityWalker {
838838
continue;
839839
}
840840
out.object([&] {
841+
if (auto *parent = dyn_cast_or_null<clang::NamedDecl>(clangD
842+
->getParent())) {
843+
auto pName = parent->getName();
844+
if (!pName.empty())
845+
out.attribute("type", pName);
846+
}
841847
out.attribute("method", clangD->getNameAsString());
842848
out.attribute("location", Loc.printToString(SM));
843849
});

test/IDE/objc_send_collector.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ public func testProperties(_ x: FooClassBase) {
1414

1515
// CHECK-DAG: fooBaseInstanceFunc0
1616
// CHECK-DAG: fooBaseInstanceFunc1
17+
// CHECK-DAG: "type": "FooClassBase"
1718
// CHECK-DAG: SOURCE_DIR/test/IDE/Inputs/mock-sdk/Foo.framework/Headers/Foo.h

0 commit comments

Comments
 (0)