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 {
20
20
21
21
public var description : String { String ( taking: bridged. getDebugDescription ( ) ) }
22
22
23
+ /// The module in which this declaration resides.
24
+ public var parentModule : ModuleDecl { bridged. getModuleContext ( ) . getAs ( ModuleDecl . self) }
25
+
23
26
// True if this declaration is imported from C/C++/ObjC.
24
27
public var hasClangNode : Bool { bridged. hasClangNode ( ) }
25
28
@@ -88,7 +91,9 @@ final public class ParamDecl: VarDecl {}
88
91
89
92
final public class SubscriptDecl : AbstractStorageDecl { }
90
93
91
- public class AbstractFunctionDecl : ValueDecl { }
94
+ public class AbstractFunctionDecl : ValueDecl {
95
+ public var isOverridden : Bool { bridged. AbstractFunction_isOverridden ( ) }
96
+ }
92
97
93
98
final public class ConstructorDecl : AbstractFunctionDecl { }
94
99
Original file line number Diff line number Diff line change @@ -378,6 +378,7 @@ struct BridgedDeclObj {
378
378
BridgedDeclObj (SwiftObject obj) : obj(obj) {}
379
379
BridgedOwnedString getDebugDescription () const ;
380
380
BRIDGED_INLINE BridgedSourceLoc getLoc () const ;
381
+ SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedDeclObj getModuleContext () const ;
381
382
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedStringRef Type_getName () const ;
382
383
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedStringRef Value_getUserFacingName () const ;
383
384
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedSourceLoc Value_getNameLoc () const ;
@@ -389,6 +390,7 @@ struct BridgedDeclObj {
389
390
BRIDGED_INLINE bool Struct_hasUnreferenceableStorage () const ;
390
391
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType Class_getSuperclass () const ;
391
392
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedDeclObj Class_getDestructor () const ;
393
+ BRIDGED_INLINE bool AbstractFunction_isOverridden () const ;
392
394
BRIDGED_INLINE bool Destructor_isIsolated () const ;
393
395
};
394
396
Original file line number Diff line number Diff line change @@ -176,6 +176,10 @@ BridgedSourceLoc BridgedDeclObj::getLoc() const {
176
176
return BridgedSourceLoc (sourceLoc .getOpaquePointerValue ());
177
177
}
178
178
179
+ BridgedDeclObj BridgedDeclObj ::getModuleContext () const {
180
+ return {unbridged ()-> getModuleContext ()};
181
+ }
182
+
179
183
BridgedStringRef BridgedDeclObj ::Type_getName () const {
180
184
return getAs < swift ::TypeDecl > ()-> getName ().str ();
181
185
}
@@ -220,6 +224,10 @@ BridgedDeclObj BridgedDeclObj::Class_getDestructor() const {
220
224
return {getAs < swift ::ClassDecl > ( )-> getDestructor ()};
221
225
}
222
226
227
+ bool BridgedDeclObj ::AbstractFunction_isOverridden () const {
228
+ return getAs < swift ::AbstractFunctionDecl > ( )-> isOverridden ();
229
+ }
230
+
223
231
bool BridgedDeclObj ::Destructor_isIsolated () const {
224
232
auto dd = getAs < swift ::DestructorDecl > ( );
225
233
auto ai = swift ::getActorIsolation (dd );
You can’t perform that action at this time.
0 commit comments