File tree Expand file tree Collapse file tree 8 files changed +27
-1
lines changed
test/SymbolGraph/ClangImporter
Inputs/FactoryInit/FactoryInit.framework
Modules/FactoryInit.swiftmodule Expand file tree Collapse file tree 8 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -318,6 +318,9 @@ struct PrintOptions {
318
318
// / Suppress emitting @available(*, noasync)
319
319
bool SuppressNoAsyncAvailabilityAttr = false ;
320
320
321
+ // / Whether to print the \c{/*not inherited*/} comment on factory initializers.
322
+ bool PrintFactoryInitializerComment = true ;
323
+
321
324
// / How to print opaque return types.
322
325
enum class OpaqueReturnTypePrintingMode {
323
326
// / 'some P1 & P2'.
Original file line number Diff line number Diff line change @@ -4373,7 +4373,9 @@ void PrintAST::visitConstructorDecl(ConstructorDecl *decl) {
4373
4373
" unexpected convenience initializer" );
4374
4374
}
4375
4375
} else if (decl->getInitKind () == CtorInitializerKind::Factory) {
4376
- Printer << " /*not inherited*/ " ;
4376
+ if (Options.PrintFactoryInitializerComment ) {
4377
+ Printer << " /*not inherited*/ " ;
4378
+ }
4377
4379
}
4378
4380
4379
4381
printContextIfNeeded (decl);
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ PrintOptions SymbolGraph::getDeclarationFragmentsPrintOptions() const {
67
67
Opts.PrintGenericRequirements = true ;
68
68
Opts.PrintInherited = false ;
69
69
Opts.ExplodeEnumCaseDecls = true ;
70
+ Opts.PrintFactoryInitializerComment = false ;
70
71
71
72
Opts.ExclusiveAttrList .clear ();
72
73
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %target-swift-symbolgraph-extract -sdk %clang-importer-sdk -module-name FactoryInit -F %S/Inputs/FactoryInit -output-dir %t -pretty-print -v
3
+
4
+ // REQUIRES: objc_interop
5
+
6
+ // RUN: %FileCheck %s --input-file %t/FactoryInit.symbols.json
7
+
8
+ // CHECK-NOT: not inherited
Original file line number Diff line number Diff line change
1
+ @import Foundation;
2
+
3
+ __attribute__ ((swift_name(" SomeClass" )))
4
+ @interface IAMSomeClass : NSObject
5
+ @end
6
+
7
+ __attribute__((swift_name(" SomeClass.init(value:)" )))
8
+ IAMSomeClass * _Nonnull MakeIAMSomeClass(double x);
Original file line number Diff line number Diff line change
1
+ framework module FactoryInit {
2
+ header "FactoryInit.h"
3
+ export *
4
+ }
You can’t perform that action at this time.
0 commit comments