@@ -104,7 +104,7 @@ getDefaultMakeStructRawValuedOptions() {
104
104
return opts;
105
105
}
106
106
107
- static bool isInSystemModule (DeclContext *D) {
107
+ static bool isInSystemModule (const DeclContext *D) {
108
108
return cast<ClangModuleUnit>(D->getModuleScopeContext ())->isSystemModule ();
109
109
}
110
110
@@ -4091,7 +4091,7 @@ namespace {
4091
4091
// / Check whether we have already imported a method with the given
4092
4092
// / selector in the given context.
4093
4093
bool isMethodAlreadyImported (ObjCSelector selector, bool isInstance,
4094
- DeclContext *dc,
4094
+ const DeclContext *dc,
4095
4095
llvm::function_ref<bool (AbstractFunctionDecl *fn)> filter) {
4096
4096
// We only need to perform this check for classes.
4097
4097
auto classDecl
@@ -4425,7 +4425,7 @@ namespace {
4425
4425
// / NSArray(capacity: 1024)
4426
4426
// / \endcode
4427
4427
ConstructorDecl *importConstructor (const clang::ObjCMethodDecl *objcMethod,
4428
- DeclContext *dc,
4428
+ const DeclContext *dc,
4429
4429
bool implicit,
4430
4430
Optional<CtorInitializerKind> kind,
4431
4431
bool required);
@@ -4454,7 +4454,7 @@ namespace {
4454
4454
// / This variant of the function is responsible for actually binding the
4455
4455
// / constructor declaration appropriately.
4456
4456
ConstructorDecl *importConstructor (const clang::ObjCMethodDecl *objcMethod,
4457
- DeclContext *dc,
4457
+ const DeclContext *dc,
4458
4458
bool implicit,
4459
4459
CtorInitializerKind kind,
4460
4460
bool required,
@@ -4527,7 +4527,7 @@ namespace {
4527
4527
4528
4528
// / Import constructors from our superclasses (and their
4529
4529
// / categories/extensions), effectively "inheriting" constructors.
4530
- void importInheritedConstructors (ClassDecl *classDecl,
4530
+ void importInheritedConstructors (const ClassDecl *classDecl,
4531
4531
SmallVectorImpl<Decl *> &newMembers);
4532
4532
4533
4533
Decl *VisitObjCCategoryDecl (const clang::ObjCCategoryDecl *decl) {
@@ -6083,7 +6083,7 @@ SwiftDeclConverter::getImplicitProperty(ImportedName importedName,
6083
6083
}
6084
6084
6085
6085
ConstructorDecl *SwiftDeclConverter::importConstructor (
6086
- const clang::ObjCMethodDecl *objcMethod, DeclContext *dc, bool implicit,
6086
+ const clang::ObjCMethodDecl *objcMethod, const DeclContext *dc, bool implicit,
6087
6087
Optional<CtorInitializerKind> kind, bool required) {
6088
6088
// Only methods in the 'init' family can become constructors.
6089
6089
assert (isInitMethod (objcMethod) && " Not a real init method" );
@@ -6234,7 +6234,7 @@ bool SwiftDeclConverter::existingConstructorIsWorse(
6234
6234
// / This variant of the function is responsible for actually binding the
6235
6235
// / constructor declaration appropriately.
6236
6236
ConstructorDecl *SwiftDeclConverter::importConstructor (
6237
- const clang::ObjCMethodDecl *objcMethod, DeclContext *dc, bool implicit,
6237
+ const clang::ObjCMethodDecl *objcMethod, const DeclContext *dc, bool implicit,
6238
6238
CtorInitializerKind kind, bool required, ObjCSelector selector,
6239
6239
ImportedName importedName, ArrayRef<const clang::ParmVarDecl *> args,
6240
6240
bool variadic, bool &redundant) {
@@ -6354,7 +6354,7 @@ ConstructorDecl *SwiftDeclConverter::importConstructor(
6354
6354
/* NameLoc=*/ SourceLoc (), failability, /* FailabilityLoc=*/ SourceLoc (),
6355
6355
/* Throws=*/ importedName.getErrorInfo ().hasValue (),
6356
6356
/* ThrowsLoc=*/ SourceLoc (), bodyParams,
6357
- /* GenericParams=*/ nullptr , dc );
6357
+ /* GenericParams=*/ nullptr , const_cast <DeclContext *>(dc) );
6358
6358
6359
6359
addObjCAttribute (result, selector);
6360
6360
@@ -7189,7 +7189,7 @@ void SwiftDeclConverter::importNonOverriddenMirroredMethods(DeclContext *dc,
7189
7189
}
7190
7190
7191
7191
void SwiftDeclConverter::importInheritedConstructors (
7192
- ClassDecl *classDecl, SmallVectorImpl<Decl *> &newMembers) {
7192
+ const ClassDecl *classDecl, SmallVectorImpl<Decl *> &newMembers) {
7193
7193
if (!classDecl->hasSuperclass ())
7194
7194
return ;
7195
7195
0 commit comments