@@ -713,8 +713,8 @@ static Type getTypeForDWARFMangling(Type t) {
713
713
}
714
714
715
715
std::string ASTMangler::mangleTypeForDebugger (Type Ty, GenericSignature sig) {
716
- PrettyStackTraceType prettyStackTrace (Ty-> getASTContext () ,
717
- " mangling type for debugger " , Ty);
716
+ PrettyStackTraceType prettyStackTrace (Context, " mangling type for debugger " ,
717
+ Ty);
718
718
719
719
DWARFMangling = true ;
720
720
RespectOriginallyDefinedIn = false ;
@@ -1322,7 +1322,7 @@ void ASTMangler::appendType(Type type, GenericSignature sig,
1322
1322
// unless the type alias references a builtin type.
1323
1323
auto underlyingType = aliasTy->getSinglyDesugaredType ();
1324
1324
TypeAliasDecl *decl = aliasTy->getDecl ();
1325
- if (decl->getModuleContext () == decl-> getASTContext () .TheBuiltinModule ) {
1325
+ if (decl->getModuleContext () == Context .TheBuiltinModule ) {
1326
1326
return appendType (underlyingType, sig, forDecl);
1327
1327
}
1328
1328
@@ -2123,8 +2123,8 @@ void ASTMangler::appendImplFunctionType(SILFunctionType *fn,
2123
2123
OpArgs.push_back (' t' );
2124
2124
}
2125
2125
2126
- bool mangleClangType = fn-> getASTContext (). LangOpts . UseClangFunctionTypes &&
2127
- fn->hasNonDerivableClangType ();
2126
+ bool mangleClangType =
2127
+ Context. LangOpts . UseClangFunctionTypes && fn->hasNonDerivableClangType ();
2128
2128
2129
2129
auto appendClangTypeToVec = [this , fn](auto &Vec) {
2130
2130
llvm::raw_svector_ostream OpArgsOS (Vec);
@@ -3034,8 +3034,8 @@ void ASTMangler::appendFunctionType(AnyFunctionType *fn, GenericSignature sig,
3034
3034
3035
3035
appendFunctionSignature (fn, sig, forDecl, NoFunctionMangling, isRecursedInto);
3036
3036
3037
- bool mangleClangType = fn-> getASTContext (). LangOpts . UseClangFunctionTypes &&
3038
- fn->hasNonDerivableClangType ();
3037
+ bool mangleClangType =
3038
+ Context. LangOpts . UseClangFunctionTypes && fn->hasNonDerivableClangType ();
3039
3039
3040
3040
// Note that we do not currently use thin representations in the AST
3041
3041
// for the types of function decls. This may need to change at some
@@ -3086,7 +3086,7 @@ void ASTMangler::appendClangType(FnType *fn, llvm::raw_svector_ostream &out) {
3086
3086
SmallString<64 > scratch;
3087
3087
llvm::raw_svector_ostream scratchOS (scratch);
3088
3088
clang::ASTContext &clangCtx =
3089
- fn-> getASTContext () .getClangModuleLoader ()->getClangASTContext ();
3089
+ Context .getClangModuleLoader ()->getClangASTContext ();
3090
3090
std::unique_ptr<clang::ItaniumMangleContext> mangler{
3091
3091
clang::ItaniumMangleContext::create (clangCtx, clangCtx.getDiagnostics ())};
3092
3092
mangler->mangleCanonicalTypeName (clang::QualType (clangType, 0 ), scratchOS);
@@ -3112,7 +3112,7 @@ void ASTMangler::appendFunctionSignature(AnyFunctionType *fn,
3112
3112
if (fn->isSendable ())
3113
3113
appendOperator (" Yb" );
3114
3114
if (auto thrownError = fn->getEffectiveThrownErrorType ()) {
3115
- if ((*thrownError)->isEqual (fn-> getASTContext () .getErrorExistentialType ())
3115
+ if ((*thrownError)->isEqual (Context .getErrorExistentialType ())
3116
3116
|| !AllowTypedThrows) {
3117
3117
appendOperator (" K" );
3118
3118
} else {
@@ -3811,7 +3811,7 @@ void ASTMangler::appendClosureEntity(const AbstractClosureExpr *closure) {
3811
3811
// code; the type-checker currently isn't strict about producing typed
3812
3812
// expression nodes when it fails. Once we enforce that, we can remove this.
3813
3813
if (!type)
3814
- type = CanType (ErrorType::get (closure-> getASTContext () ));
3814
+ type = CanType (ErrorType::get (Context ));
3815
3815
3816
3816
auto canType = type->getCanonicalType ();
3817
3817
if (canType->hasLocalArchetype ())
@@ -3882,18 +3882,16 @@ CanType ASTMangler::getDeclTypeForMangling(
3882
3882
genericSig = GenericSignature ();
3883
3883
parentGenericSig = GenericSignature ();
3884
3884
3885
- auto &C = decl->getASTContext ();
3886
-
3887
3885
auto ty = decl->getInterfaceType ()->getReferenceStorageReferent ();
3888
3886
if (ty->hasError ()) {
3889
3887
if (isa<AbstractFunctionDecl>(decl) || isa<EnumElementDecl>(decl) ||
3890
3888
isa<SubscriptDecl>(decl)) {
3891
3889
// FIXME: Verify ExtInfo state is correct, not working by accident.
3892
3890
CanFunctionType::ExtInfo info;
3893
- return CanFunctionType::get ({AnyFunctionType::Param (C .TheErrorType )},
3894
- C .TheErrorType , info);
3891
+ return CanFunctionType::get ({AnyFunctionType::Param (Context .TheErrorType )},
3892
+ Context .TheErrorType , info);
3895
3893
}
3896
- return C .TheErrorType ;
3894
+ return Context .TheErrorType ;
3897
3895
}
3898
3896
3899
3897
// If this declaration predates concurrency, adjust its type to not
@@ -4503,8 +4501,7 @@ void ASTMangler::appendMacroExpansionContext(
4503
4501
if (loc.isInvalid ())
4504
4502
return appendContext (origDC, nullBase, StringRef ());
4505
4503
4506
- ASTContext &ctx = origDC->getASTContext ();
4507
- SourceManager &sourceMgr = ctx.SourceMgr ;
4504
+ SourceManager &sourceMgr = Context.SourceMgr ;
4508
4505
4509
4506
auto appendMacroExpansionLoc = [&]() {
4510
4507
appendIdentifier (origDC->getParentModule ()->getName ().str ());
@@ -4582,7 +4579,7 @@ void ASTMangler::appendMacroExpansionContext(
4582
4579
if (auto *macroDecl = decl->getResolvedMacro (attr))
4583
4580
baseName = macroDecl->getBaseName ();
4584
4581
else
4585
- baseName = ctx .getIdentifier (" __unknown_macro__" );
4582
+ baseName = Context .getIdentifier (" __unknown_macro__" );
4586
4583
4587
4584
discriminator = decl->getAttachedMacroDiscriminator (baseName, role, attr);
4588
4585
break ;
0 commit comments