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 {
393
393
public:
394
394
virtual void getTopLevelDecls (SmallVectorImpl<Decl*> &results) const override ;
395
395
396
+ virtual void getDisplayDecls (SmallVectorImpl<Decl*> &results) const override ;
397
+
396
398
virtual void
397
399
getOperatorDecls (SmallVectorImpl<OperatorDecl *> &results) const override ;
398
400
Original file line number Diff line number Diff line change @@ -822,6 +822,17 @@ void SourceFile::getTopLevelDecls(SmallVectorImpl<Decl*> &Results) const {
822
822
Results.append (decls.begin (), decls.end ());
823
823
}
824
824
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
+
825
836
void ModuleDecl::getOperatorDecls (
826
837
SmallVectorImpl<OperatorDecl *> &results) const {
827
838
// For a parsed module, we can check the source cache on the module rather
Original file line number Diff line number Diff line change 3
3
// 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
4
4
// RUN: %{python} -m json.tool %t/EmitWhileBuilding.symbols.json %t/EmitWhileBuilding.formatted.symbols.json
5
5
// RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.formatted.symbols.json
6
+ // RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.formatted.symbols.json --check-prefix HEADER
6
7
7
8
// REQUIRES: objc_interop
8
9
9
10
import Foundation
10
11
11
12
public enum SwiftEnum { }
12
13
14
+ // HEADER: "precise": "c:@testVariable"
15
+
16
+ // CHECK: "precise": "s:17EmitWhileBuilding9SwiftEnumO",
13
17
// CHECK: "declarationFragments": [
14
18
// CHECK-NEXT: {
15
19
// CHECK-NEXT: "kind": "keyword",
You can’t perform that action at this time.
0 commit comments