@@ -38,22 +38,24 @@ namespace swift {
38
38
class TypeRepr ;
39
39
40
40
void printSourceLocDescription (llvm::raw_ostream &out, SourceLoc loc,
41
- ASTContext &Context, bool addNewline = true );
41
+ const ASTContext &Context,
42
+ bool addNewline = true );
42
43
43
44
// / PrettyStackTraceLocation - Observe that we are doing some
44
45
// / processing starting at a fixed location.
45
46
class PrettyStackTraceLocation : public llvm ::PrettyStackTraceEntry {
46
- ASTContext &Context;
47
+ const ASTContext &Context;
47
48
SourceLoc Loc;
48
49
const char *Action;
49
50
public:
50
- PrettyStackTraceLocation (ASTContext &C, const char *action, SourceLoc loc)
51
+ PrettyStackTraceLocation (const ASTContext &C, const char *action,
52
+ SourceLoc loc)
51
53
: Context(C), Loc(loc), Action(action) {}
52
54
virtual void print (llvm::raw_ostream &OS) const ;
53
55
};
54
56
55
57
void printDeclDescription (llvm::raw_ostream &out, const Decl *D,
56
- ASTContext &Context, bool addNewline = true );
58
+ const ASTContext &Context, bool addNewline = true );
57
59
58
60
// / PrettyStackTraceDecl - Observe that we are processing a specific
59
61
// / declaration.
@@ -78,60 +80,60 @@ class PrettyStackTraceAnyFunctionRef : public llvm::PrettyStackTraceEntry {
78
80
};
79
81
80
82
void printExprDescription (llvm::raw_ostream &out, Expr *E,
81
- ASTContext &Context, bool addNewline = true );
83
+ const ASTContext &Context, bool addNewline = true );
82
84
83
85
// / PrettyStackTraceExpr - Observe that we are processing a specific
84
86
// / expression.
85
87
class PrettyStackTraceExpr : public llvm ::PrettyStackTraceEntry {
86
- ASTContext &Context;
88
+ const ASTContext &Context;
87
89
Expr *TheExpr;
88
90
const char *Action;
89
91
public:
90
- PrettyStackTraceExpr (ASTContext &C, const char *action, Expr *E)
92
+ PrettyStackTraceExpr (const ASTContext &C, const char *action, Expr *E)
91
93
: Context(C), TheExpr(E), Action(action) {}
92
94
virtual void print (llvm::raw_ostream &OS) const ;
93
95
};
94
96
95
97
void printStmtDescription (llvm::raw_ostream &out, Stmt *S,
96
- ASTContext &Context, bool addNewline = true );
98
+ const ASTContext &Context, bool addNewline = true );
97
99
98
100
// / PrettyStackTraceStmt - Observe that we are processing a specific
99
101
// / statement.
100
102
class PrettyStackTraceStmt : public llvm ::PrettyStackTraceEntry {
101
- ASTContext &Context;
103
+ const ASTContext &Context;
102
104
Stmt *TheStmt;
103
105
const char *Action;
104
106
public:
105
- PrettyStackTraceStmt (ASTContext &C, const char *action, Stmt *S)
107
+ PrettyStackTraceStmt (const ASTContext &C, const char *action, Stmt *S)
106
108
: Context(C), TheStmt(S), Action(action) {}
107
109
virtual void print (llvm::raw_ostream &OS) const ;
108
110
};
109
111
110
112
void printPatternDescription (llvm::raw_ostream &out, Pattern *P,
111
- ASTContext &Context, bool addNewline = true );
113
+ const ASTContext &Context, bool addNewline = true );
112
114
113
115
// / PrettyStackTracePattern - Observe that we are processing a
114
116
// / specific pattern.
115
117
class PrettyStackTracePattern : public llvm ::PrettyStackTraceEntry {
116
- ASTContext &Context;
118
+ const ASTContext &Context;
117
119
Pattern *ThePattern;
118
120
const char *Action;
119
121
public:
120
- PrettyStackTracePattern (ASTContext &C, const char *action, Pattern *P)
122
+ PrettyStackTracePattern (const ASTContext &C, const char *action, Pattern *P)
121
123
: Context(C), ThePattern(P), Action(action) {}
122
124
virtual void print (llvm::raw_ostream &OS) const ;
123
125
};
124
126
125
127
void printTypeDescription (llvm::raw_ostream &out, Type T,
126
- ASTContext &Context, bool addNewline = true );
128
+ const ASTContext &Context, bool addNewline = true );
127
129
128
130
// / PrettyStackTraceType - Observe that we are processing a specific type.
129
131
class PrettyStackTraceType : public llvm ::PrettyStackTraceEntry {
130
- ASTContext &Context;
132
+ const ASTContext &Context;
131
133
Type TheType;
132
134
const char *Action;
133
135
public:
134
- PrettyStackTraceType (ASTContext &C, const char *action, Type type)
136
+ PrettyStackTraceType (const ASTContext &C, const char *action, Type type)
135
137
: Context(C), TheType(type), Action(action) {}
136
138
virtual void print (llvm::raw_ostream &OS) const ;
137
139
};
@@ -149,31 +151,33 @@ class PrettyStackTraceClangType : public llvm::PrettyStackTraceEntry {
149
151
150
152
// / Observe that we are processing a specific type representation.
151
153
class PrettyStackTraceTypeRepr : public llvm ::PrettyStackTraceEntry {
152
- ASTContext &Context;
154
+ const ASTContext &Context;
153
155
TypeRepr *TheType;
154
156
const char *Action;
155
157
public:
156
- PrettyStackTraceTypeRepr (ASTContext &C, const char *action, TypeRepr *type)
158
+ PrettyStackTraceTypeRepr (const ASTContext &C, const char *action,
159
+ TypeRepr *type)
157
160
: Context(C), TheType(type), Action(action) {}
158
161
virtual void print (llvm::raw_ostream &OS) const ;
159
162
};
160
163
161
164
// / PrettyStackTraceConformance - Observe that we are processing a
162
165
// / specific protocol conformance.
163
166
class PrettyStackTraceConformance : public llvm ::PrettyStackTraceEntry {
164
- ASTContext &Context;
167
+ const ASTContext &Context;
165
168
const ProtocolConformance *Conformance;
166
169
const char *Action;
167
170
public:
168
- PrettyStackTraceConformance (ASTContext &C, const char *action,
171
+ PrettyStackTraceConformance (const ASTContext &C, const char *action,
169
172
const ProtocolConformance *conformance)
170
173
: Context(C), Conformance(conformance), Action(action) {}
171
174
virtual void print (llvm::raw_ostream &OS) const ;
172
175
};
173
176
174
177
void printConformanceDescription (llvm::raw_ostream &out,
175
178
const ProtocolConformance *conformance,
176
- ASTContext &Context, bool addNewline = true );
179
+ const ASTContext &Context,
180
+ bool addNewline = true );
177
181
178
182
class PrettyStackTraceGenericSignature : public llvm ::PrettyStackTraceEntry {
179
183
const char *Action;
0 commit comments