File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed
test/SymbolGraph/ClangImporter Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -393,6 +393,8 @@ class SourceFile final : public FileUnit {
393393public:
394394 virtual void getTopLevelDecls (SmallVectorImpl<Decl*> &results) const override ;
395395
396+ virtual void getDisplayDecls (SmallVectorImpl<Decl*> &results) const override ;
397+
396398 virtual void
397399 getOperatorDecls (SmallVectorImpl<OperatorDecl *> &results) const override ;
398400
Original file line number Diff line number Diff line change @@ -822,6 +822,17 @@ void SourceFile::getTopLevelDecls(SmallVectorImpl<Decl*> &Results) const {
822822 Results.append (decls.begin (), decls.end ());
823823}
824824
825+ void SourceFile::getDisplayDecls (SmallVectorImpl<Decl*> &Results) const {
826+ if (Imports.hasValue ()) {
827+ for (auto import : *Imports) {
828+ if (import .options .contains (ImportFlags::Exported)) {
829+ import .module .importedModule ->getDisplayDecls (Results);
830+ }
831+ }
832+ }
833+ getTopLevelDecls (Results);
834+ }
835+
825836void ModuleDecl::getOperatorDecls (
826837 SmallVectorImpl<OperatorDecl *> &results) const {
827838 // For a parsed module, we can check the source cache on the module rather
Original file line number Diff line number Diff line change 33// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-objc-interop -emit-module-path %t/EmitWhileBuilding.framework/Modules/EmitWhileBuilding.swiftmodule/%target-swiftmodule-name -import-underlying-module -F %t -module-name EmitWhileBuilding -disable-objc-attr-requires-foundation-module %s -emit-symbol-graph -emit-symbol-graph-dir %t
44// RUN: %{python} -m json.tool %t/EmitWhileBuilding.symbols.json %t/EmitWhileBuilding.formatted.symbols.json
55// RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.formatted.symbols.json
6+ // RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.formatted.symbols.json --check-prefix HEADER
67
78// REQUIRES: objc_interop
89
910import Foundation
1011
1112public enum SwiftEnum { }
1213
14+ // HEADER: "precise": "c:@testVariable"
15+
16+ // CHECK: "precise": "s:17EmitWhileBuilding9SwiftEnumO",
1317// CHECK: "declarationFragments": [
1418// CHECK-NEXT: {
1519// CHECK-NEXT: "kind": "keyword",
You can’t perform that action at this time.
0 commit comments