@@ -38,22 +38,24 @@ namespace swift {
3838 class TypeRepr ;
3939
4040void printSourceLocDescription (llvm::raw_ostream &out, SourceLoc loc,
41- ASTContext &Context, bool addNewline = true );
41+ const ASTContext &Context,
42+ bool addNewline = true );
4243
4344// / PrettyStackTraceLocation - Observe that we are doing some
4445// / processing starting at a fixed location.
4546class PrettyStackTraceLocation : public llvm ::PrettyStackTraceEntry {
46- ASTContext &Context;
47+ const ASTContext &Context;
4748 SourceLoc Loc;
4849 const char *Action;
4950public:
50- PrettyStackTraceLocation (ASTContext &C, const char *action, SourceLoc loc)
51+ PrettyStackTraceLocation (const ASTContext &C, const char *action,
52+ SourceLoc loc)
5153 : Context(C), Loc(loc), Action(action) {}
5254 virtual void print (llvm::raw_ostream &OS) const ;
5355};
5456
5557void printDeclDescription (llvm::raw_ostream &out, const Decl *D,
56- ASTContext &Context, bool addNewline = true );
58+ const ASTContext &Context, bool addNewline = true );
5759
5860// / PrettyStackTraceDecl - Observe that we are processing a specific
5961// / declaration.
@@ -78,60 +80,60 @@ class PrettyStackTraceAnyFunctionRef : public llvm::PrettyStackTraceEntry {
7880};
7981
8082void printExprDescription (llvm::raw_ostream &out, Expr *E,
81- ASTContext &Context, bool addNewline = true );
83+ const ASTContext &Context, bool addNewline = true );
8284
8385// / PrettyStackTraceExpr - Observe that we are processing a specific
8486// / expression.
8587class PrettyStackTraceExpr : public llvm ::PrettyStackTraceEntry {
86- ASTContext &Context;
88+ const ASTContext &Context;
8789 Expr *TheExpr;
8890 const char *Action;
8991public:
90- PrettyStackTraceExpr (ASTContext &C, const char *action, Expr *E)
92+ PrettyStackTraceExpr (const ASTContext &C, const char *action, Expr *E)
9193 : Context(C), TheExpr(E), Action(action) {}
9294 virtual void print (llvm::raw_ostream &OS) const ;
9395};
9496
9597void printStmtDescription (llvm::raw_ostream &out, Stmt *S,
96- ASTContext &Context, bool addNewline = true );
98+ const ASTContext &Context, bool addNewline = true );
9799
98100// / PrettyStackTraceStmt - Observe that we are processing a specific
99101// / statement.
100102class PrettyStackTraceStmt : public llvm ::PrettyStackTraceEntry {
101- ASTContext &Context;
103+ const ASTContext &Context;
102104 Stmt *TheStmt;
103105 const char *Action;
104106public:
105- PrettyStackTraceStmt (ASTContext &C, const char *action, Stmt *S)
107+ PrettyStackTraceStmt (const ASTContext &C, const char *action, Stmt *S)
106108 : Context(C), TheStmt(S), Action(action) {}
107109 virtual void print (llvm::raw_ostream &OS) const ;
108110};
109111
110112void printPatternDescription (llvm::raw_ostream &out, Pattern *P,
111- ASTContext &Context, bool addNewline = true );
113+ const ASTContext &Context, bool addNewline = true );
112114
113115// / PrettyStackTracePattern - Observe that we are processing a
114116// / specific pattern.
115117class PrettyStackTracePattern : public llvm ::PrettyStackTraceEntry {
116- ASTContext &Context;
118+ const ASTContext &Context;
117119 Pattern *ThePattern;
118120 const char *Action;
119121public:
120- PrettyStackTracePattern (ASTContext &C, const char *action, Pattern *P)
122+ PrettyStackTracePattern (const ASTContext &C, const char *action, Pattern *P)
121123 : Context(C), ThePattern(P), Action(action) {}
122124 virtual void print (llvm::raw_ostream &OS) const ;
123125};
124126
125127void printTypeDescription (llvm::raw_ostream &out, Type T,
126- ASTContext &Context, bool addNewline = true );
128+ const ASTContext &Context, bool addNewline = true );
127129
128130// / PrettyStackTraceType - Observe that we are processing a specific type.
129131class PrettyStackTraceType : public llvm ::PrettyStackTraceEntry {
130- ASTContext &Context;
132+ const ASTContext &Context;
131133 Type TheType;
132134 const char *Action;
133135public:
134- PrettyStackTraceType (ASTContext &C, const char *action, Type type)
136+ PrettyStackTraceType (const ASTContext &C, const char *action, Type type)
135137 : Context(C), TheType(type), Action(action) {}
136138 virtual void print (llvm::raw_ostream &OS) const ;
137139};
@@ -149,31 +151,33 @@ class PrettyStackTraceClangType : public llvm::PrettyStackTraceEntry {
149151
150152// / Observe that we are processing a specific type representation.
151153class PrettyStackTraceTypeRepr : public llvm ::PrettyStackTraceEntry {
152- ASTContext &Context;
154+ const ASTContext &Context;
153155 TypeRepr *TheType;
154156 const char *Action;
155157public:
156- PrettyStackTraceTypeRepr (ASTContext &C, const char *action, TypeRepr *type)
158+ PrettyStackTraceTypeRepr (const ASTContext &C, const char *action,
159+ TypeRepr *type)
157160 : Context(C), TheType(type), Action(action) {}
158161 virtual void print (llvm::raw_ostream &OS) const ;
159162};
160163
161164// / PrettyStackTraceConformance - Observe that we are processing a
162165// / specific protocol conformance.
163166class PrettyStackTraceConformance : public llvm ::PrettyStackTraceEntry {
164- ASTContext &Context;
167+ const ASTContext &Context;
165168 const ProtocolConformance *Conformance;
166169 const char *Action;
167170public:
168- PrettyStackTraceConformance (ASTContext &C, const char *action,
171+ PrettyStackTraceConformance (const ASTContext &C, const char *action,
169172 const ProtocolConformance *conformance)
170173 : Context(C), Conformance(conformance), Action(action) {}
171174 virtual void print (llvm::raw_ostream &OS) const ;
172175};
173176
174177void printConformanceDescription (llvm::raw_ostream &out,
175178 const ProtocolConformance *conformance,
176- ASTContext &Context, bool addNewline = true );
179+ const ASTContext &Context,
180+ bool addNewline = true );
177181
178182class PrettyStackTraceGenericSignature : public llvm ::PrettyStackTraceEntry {
179183 const char *Action;
0 commit comments