File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed
SwiftCompilerSources/Sources/AST Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ public class Decl: CustomStringConvertible, Hashable {
2020
2121 public var description : String { String ( taking: bridged. getDebugDescription ( ) ) }
2222
23+ /// The module in which this declaration resides.
24+ public var parentModule : ModuleDecl { bridged. getModuleContext ( ) . getAs ( ModuleDecl . self) }
25+
2326 // True if this declaration is imported from C/C++/ObjC.
2427 public var hasClangNode : Bool { bridged. hasClangNode ( ) }
2528
@@ -88,7 +91,9 @@ final public class ParamDecl: VarDecl {}
8891
8992final public class SubscriptDecl : AbstractStorageDecl { }
9093
91- public class AbstractFunctionDecl : ValueDecl { }
94+ public class AbstractFunctionDecl : ValueDecl {
95+ public var isOverridden : Bool { bridged. AbstractFunction_isOverridden ( ) }
96+ }
9297
9398final public class ConstructorDecl : AbstractFunctionDecl { }
9499
Original file line number Diff line number Diff line change @@ -378,6 +378,7 @@ struct BridgedDeclObj {
378378 BridgedDeclObj (SwiftObject obj) : obj(obj) {}
379379 BridgedOwnedString getDebugDescription () const ;
380380 BRIDGED_INLINE BridgedSourceLoc getLoc () const ;
381+ SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedDeclObj getModuleContext () const ;
381382 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedStringRef Type_getName () const ;
382383 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedStringRef Value_getUserFacingName () const ;
383384 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedSourceLoc Value_getNameLoc () const ;
@@ -389,6 +390,7 @@ struct BridgedDeclObj {
389390 BRIDGED_INLINE bool Struct_hasUnreferenceableStorage () const ;
390391 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType Class_getSuperclass () const ;
391392 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedDeclObj Class_getDestructor () const ;
393+ BRIDGED_INLINE bool AbstractFunction_isOverridden () const ;
392394 BRIDGED_INLINE bool Destructor_isIsolated () const ;
393395};
394396
Original file line number Diff line number Diff line change @@ -176,6 +176,10 @@ BridgedSourceLoc BridgedDeclObj::getLoc() const {
176176 return BridgedSourceLoc (sourceLoc .getOpaquePointerValue ());
177177}
178178
179+ BridgedDeclObj BridgedDeclObj ::getModuleContext () const {
180+ return {unbridged ()-> getModuleContext ()};
181+ }
182+
179183BridgedStringRef BridgedDeclObj ::Type_getName () const {
180184 return getAs < swift ::TypeDecl > ()-> getName ().str ();
181185}
@@ -220,6 +224,10 @@ BridgedDeclObj BridgedDeclObj::Class_getDestructor() const {
220224 return {getAs < swift ::ClassDecl > ( )-> getDestructor ()};
221225}
222226
227+ bool BridgedDeclObj ::AbstractFunction_isOverridden () const {
228+ return getAs < swift ::AbstractFunctionDecl > ( )-> isOverridden ();
229+ }
230+
223231bool BridgedDeclObj ::Destructor_isIsolated () const {
224232 auto dd = getAs < swift ::DestructorDecl > ( );
225233 auto ai = swift ::getActorIsolation (dd );
You can’t perform that action at this time.
0 commit comments