Skip to content

Commit 66b341f

Browse files
allow swift-symbolgraph-extract to be called on non-swift modules (#42399)
rdar://90842354
1 parent 12a11e5 commit 66b341f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: lib/DriverTool/swift_symbolgraph_extract_main.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,10 @@ int swift_symbolgraph_extract_main(ArrayRef<const char *> Args,
223223
return EXIT_FAILURE;
224224
}
225225

226-
const auto &MainFile = M->getMainFile(FileUnitKind::SerializedAST);
226+
FileUnitKind expectedKind = FileUnitKind::SerializedAST;
227+
if (M->isNonSwiftModule())
228+
expectedKind = FileUnitKind::ClangModule;
229+
const auto &MainFile = M->getMainFile(expectedKind);
227230

228231
if (Options.PrintMessages)
229232
llvm::errs() << "Emitting symbol graph for module file: " << MainFile.getModuleDefiningPath() << '\n';

0 commit comments

Comments
 (0)