|
33 | 33 | namespace swift {
|
34 | 34 |
|
35 | 35 | class SILPassPipelinePlan;
|
36 |
| -struct SILPassPipeline; |
| 36 | + |
| 37 | +struct SILPassPipeline final { |
| 38 | + unsigned ID; |
| 39 | + StringRef Name; |
| 40 | + unsigned KindOffset; |
| 41 | + bool isFunctionPassPipeline; |
| 42 | + |
| 43 | + friend bool operator==(const SILPassPipeline &lhs, |
| 44 | + const SILPassPipeline &rhs) { |
| 45 | + return lhs.ID == rhs.ID && lhs.Name.equals(rhs.Name) && |
| 46 | + lhs.KindOffset == rhs.KindOffset; |
| 47 | + } |
| 48 | + |
| 49 | + friend bool operator!=(const SILPassPipeline &lhs, |
| 50 | + const SILPassPipeline &rhs) { |
| 51 | + return !(lhs == rhs); |
| 52 | + } |
| 53 | + |
| 54 | + friend llvm::hash_code hash_value(const SILPassPipeline &pipeline) { |
| 55 | + return llvm::hash_combine(pipeline.ID, pipeline.Name, pipeline.KindOffset); |
| 56 | + } |
| 57 | +}; |
37 | 58 |
|
38 | 59 | enum class PassPipelineKind {
|
39 | 60 | #define PASSPIPELINE(NAME, DESCRIPTION) NAME,
|
@@ -123,28 +144,6 @@ class SILPassPipelinePlan final {
|
123 | 144 | }
|
124 | 145 | };
|
125 | 146 |
|
126 |
| -struct SILPassPipeline final { |
127 |
| - unsigned ID; |
128 |
| - StringRef Name; |
129 |
| - unsigned KindOffset; |
130 |
| - bool isFunctionPassPipeline; |
131 |
| - |
132 |
| - friend bool operator==(const SILPassPipeline &lhs, |
133 |
| - const SILPassPipeline &rhs) { |
134 |
| - return lhs.ID == rhs.ID && lhs.Name.equals(rhs.Name) && |
135 |
| - lhs.KindOffset == rhs.KindOffset; |
136 |
| - } |
137 |
| - |
138 |
| - friend bool operator!=(const SILPassPipeline &lhs, |
139 |
| - const SILPassPipeline &rhs) { |
140 |
| - return !(lhs == rhs); |
141 |
| - } |
142 |
| - |
143 |
| - friend llvm::hash_code hash_value(const SILPassPipeline &pipeline) { |
144 |
| - return llvm::hash_combine(pipeline.ID, pipeline.Name, pipeline.KindOffset); |
145 |
| - } |
146 |
| -}; |
147 |
| - |
148 | 147 | inline void SILPassPipelinePlan::
|
149 | 148 | startPipeline(StringRef Name, bool isFunctionPassPipeline) {
|
150 | 149 | PipelineStages.push_back(SILPassPipeline{
|
|
0 commit comments