Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2016 The ANGLE Project Authors. All rights reserved. |
| 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | // SimplifyLoopConditions is an AST traverser that converts loop conditions and loop expressions |
| 7 | // to regular statements inside the loop. This way further transformations that generate statements |
| 8 | // from loop conditions and loop expressions work correctly. |
| 9 | // |
| 10 | |
| 11 | #include "compiler/translator/SimplifyLoopConditions.h" |
| 12 | |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 13 | #include "compiler/translator/IntermNodePatternMatcher.h" |
Olli Etuaho | 3ec7568 | 2017-07-05 17:02:55 +0300 | [diff] [blame] | 14 | #include "compiler/translator/IntermNode_util.h" |
Olli Etuaho | cccf2b0 | 2017-07-05 14:50:54 +0300 | [diff] [blame] | 15 | #include "compiler/translator/IntermTraverse.h" |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 16 | |
Jamie Madill | 45bcc78 | 2016-11-07 13:58:48 -0500 | [diff] [blame] | 17 | namespace sh |
| 18 | { |
| 19 | |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 20 | namespace |
| 21 | { |
| 22 | |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 23 | class SimplifyLoopConditionsTraverser : public TLValueTrackingTraverser |
| 24 | { |
| 25 | public: |
| 26 | SimplifyLoopConditionsTraverser(unsigned int conditionsToSimplifyMask, |
Olli Etuaho | a5e693a | 2017-07-13 16:07:26 +0300 | [diff] [blame] | 27 | TSymbolTable *symbolTable, |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 28 | int shaderVersion); |
| 29 | |
| 30 | void traverseLoop(TIntermLoop *node) override; |
| 31 | |
Olli Etuaho | bb5a7e2 | 2017-08-30 13:03:12 +0300 | [diff] [blame^] | 32 | bool visitUnary(Visit visit, TIntermUnary *node) override; |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 33 | bool visitBinary(Visit visit, TIntermBinary *node) override; |
| 34 | bool visitAggregate(Visit visit, TIntermAggregate *node) override; |
Olli Etuaho | d0bad2c | 2016-09-09 18:01:16 +0300 | [diff] [blame] | 35 | bool visitTernary(Visit visit, TIntermTernary *node) override; |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 36 | bool visitDeclaration(Visit visit, TIntermDeclaration *node) override; |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 37 | |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 38 | bool foundLoopToChange() const { return mFoundLoopToChange; } |
| 39 | |
| 40 | protected: |
Olli Etuaho | 9676d1a | 2017-05-16 11:29:24 +0300 | [diff] [blame] | 41 | // Marked to true once an operation that needs to be hoisted out of a loop expression has been |
| 42 | // found. |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 43 | bool mFoundLoopToChange; |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 44 | bool mInsideLoopInitConditionOrExpression; |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 45 | IntermNodePatternMatcher mConditionsToSimplify; |
| 46 | }; |
| 47 | |
| 48 | SimplifyLoopConditionsTraverser::SimplifyLoopConditionsTraverser( |
| 49 | unsigned int conditionsToSimplifyMask, |
Olli Etuaho | a5e693a | 2017-07-13 16:07:26 +0300 | [diff] [blame] | 50 | TSymbolTable *symbolTable, |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 51 | int shaderVersion) |
| 52 | : TLValueTrackingTraverser(true, false, false, symbolTable, shaderVersion), |
| 53 | mFoundLoopToChange(false), |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 54 | mInsideLoopInitConditionOrExpression(false), |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 55 | mConditionsToSimplify(conditionsToSimplifyMask) |
| 56 | { |
| 57 | } |
| 58 | |
Olli Etuaho | 9676d1a | 2017-05-16 11:29:24 +0300 | [diff] [blame] | 59 | // If we're inside a loop initialization, condition, or expression, we check for expressions that |
| 60 | // should be moved out of the loop condition or expression. If one is found, the loop is |
| 61 | // transformed. |
| 62 | // If we're not inside loop initialization, condition, or expression, we only need to traverse nodes |
| 63 | // that may contain loops. |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 64 | |
Olli Etuaho | bb5a7e2 | 2017-08-30 13:03:12 +0300 | [diff] [blame^] | 65 | bool SimplifyLoopConditionsTraverser::visitUnary(Visit visit, TIntermUnary *node) |
| 66 | { |
| 67 | if (!mInsideLoopInitConditionOrExpression) |
| 68 | return false; |
| 69 | |
| 70 | if (mFoundLoopToChange) |
| 71 | return false; // Already decided to change this loop. |
| 72 | |
| 73 | mFoundLoopToChange = mConditionsToSimplify.match(node); |
| 74 | return !mFoundLoopToChange; |
| 75 | } |
| 76 | |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 77 | bool SimplifyLoopConditionsTraverser::visitBinary(Visit visit, TIntermBinary *node) |
| 78 | { |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 79 | if (!mInsideLoopInitConditionOrExpression) |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 80 | return false; |
| 81 | |
Olli Etuaho | 9676d1a | 2017-05-16 11:29:24 +0300 | [diff] [blame] | 82 | if (mFoundLoopToChange) |
| 83 | return false; // Already decided to change this loop. |
| 84 | |
Jamie Madill | 666f65a | 2016-08-26 01:34:37 +0000 | [diff] [blame] | 85 | mFoundLoopToChange = mConditionsToSimplify.match(node, getParentNode(), isLValueRequiredHere()); |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 86 | return !mFoundLoopToChange; |
| 87 | } |
| 88 | |
| 89 | bool SimplifyLoopConditionsTraverser::visitAggregate(Visit visit, TIntermAggregate *node) |
| 90 | { |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 91 | if (!mInsideLoopInitConditionOrExpression) |
Olli Etuaho | 336b147 | 2016-10-05 16:37:55 +0100 | [diff] [blame] | 92 | return false; |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 93 | |
Olli Etuaho | 9676d1a | 2017-05-16 11:29:24 +0300 | [diff] [blame] | 94 | if (mFoundLoopToChange) |
| 95 | return false; // Already decided to change this loop. |
| 96 | |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 97 | mFoundLoopToChange = mConditionsToSimplify.match(node, getParentNode()); |
| 98 | return !mFoundLoopToChange; |
| 99 | } |
| 100 | |
Olli Etuaho | d0bad2c | 2016-09-09 18:01:16 +0300 | [diff] [blame] | 101 | bool SimplifyLoopConditionsTraverser::visitTernary(Visit visit, TIntermTernary *node) |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 102 | { |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 103 | if (!mInsideLoopInitConditionOrExpression) |
| 104 | return false; |
| 105 | |
Olli Etuaho | 9676d1a | 2017-05-16 11:29:24 +0300 | [diff] [blame] | 106 | if (mFoundLoopToChange) |
| 107 | return false; // Already decided to change this loop. |
| 108 | |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 109 | mFoundLoopToChange = mConditionsToSimplify.match(node); |
| 110 | return !mFoundLoopToChange; |
| 111 | } |
| 112 | |
| 113 | bool SimplifyLoopConditionsTraverser::visitDeclaration(Visit visit, TIntermDeclaration *node) |
| 114 | { |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 115 | if (!mInsideLoopInitConditionOrExpression) |
Olli Etuaho | d0bad2c | 2016-09-09 18:01:16 +0300 | [diff] [blame] | 116 | return false; |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 117 | |
Olli Etuaho | 9676d1a | 2017-05-16 11:29:24 +0300 | [diff] [blame] | 118 | if (mFoundLoopToChange) |
| 119 | return false; // Already decided to change this loop. |
| 120 | |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 121 | mFoundLoopToChange = mConditionsToSimplify.match(node); |
| 122 | return !mFoundLoopToChange; |
| 123 | } |
| 124 | |
| 125 | void SimplifyLoopConditionsTraverser::traverseLoop(TIntermLoop *node) |
| 126 | { |
Olli Etuaho | 9676d1a | 2017-05-16 11:29:24 +0300 | [diff] [blame] | 127 | // Mark that we're inside a loop condition or expression, and determine if the loop needs to be |
| 128 | // transformed. |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 129 | |
Olli Etuaho | 1d9dcc2 | 2017-01-19 11:25:32 +0000 | [diff] [blame] | 130 | ScopedNodeInTraversalPath addToPath(this, node); |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 131 | |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 132 | mInsideLoopInitConditionOrExpression = true; |
Olli Etuaho | 9676d1a | 2017-05-16 11:29:24 +0300 | [diff] [blame] | 133 | mFoundLoopToChange = false; |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 134 | |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 135 | if (!mFoundLoopToChange && node->getInit()) |
| 136 | { |
| 137 | node->getInit()->traverse(this); |
| 138 | } |
| 139 | |
| 140 | if (!mFoundLoopToChange && node->getCondition()) |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 141 | { |
| 142 | node->getCondition()->traverse(this); |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 143 | } |
| 144 | |
| 145 | if (!mFoundLoopToChange && node->getExpression()) |
| 146 | { |
| 147 | node->getExpression()->traverse(this); |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 148 | } |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 149 | |
Olli Etuaho | 9676d1a | 2017-05-16 11:29:24 +0300 | [diff] [blame] | 150 | mInsideLoopInitConditionOrExpression = false; |
| 151 | |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 152 | if (mFoundLoopToChange) |
| 153 | { |
Olli Etuaho | 4dd06d5 | 2017-07-05 12:41:06 +0300 | [diff] [blame] | 154 | nextTemporaryId(); |
Olli Etuaho | 9676d1a | 2017-05-16 11:29:24 +0300 | [diff] [blame] | 155 | |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 156 | // Replace the loop condition with a boolean variable that's updated on each iteration. |
Olli Etuaho | 9676d1a | 2017-05-16 11:29:24 +0300 | [diff] [blame] | 157 | TLoopType loopType = node->getType(); |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 158 | if (loopType == ELoopWhile) |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 159 | { |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 160 | // Transform: |
| 161 | // while (expr) { body; } |
| 162 | // into |
| 163 | // bool s0 = expr; |
| 164 | // while (s0) { { body; } s0 = expr; } |
| 165 | TIntermSequence tempInitSeq; |
| 166 | tempInitSeq.push_back(createTempInitDeclaration(node->getCondition()->deepCopy())); |
| 167 | insertStatementsInParentBlock(tempInitSeq); |
| 168 | |
| 169 | TIntermBlock *newBody = new TIntermBlock(); |
| 170 | if (node->getBody()) |
| 171 | { |
| 172 | newBody->getSequence()->push_back(node->getBody()); |
| 173 | } |
| 174 | newBody->getSequence()->push_back( |
| 175 | createTempAssignment(node->getCondition()->deepCopy())); |
| 176 | |
| 177 | // Can't use queueReplacement to replace old body, since it may have been nullptr. |
Olli Etuaho | 9676d1a | 2017-05-16 11:29:24 +0300 | [diff] [blame] | 178 | // It's safe to do the replacements in place here - the new body will still be |
| 179 | // traversed, but that won't create any problems. |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 180 | node->setBody(newBody); |
| 181 | node->setCondition(createTempSymbol(node->getCondition()->getType())); |
| 182 | } |
| 183 | else if (loopType == ELoopDoWhile) |
| 184 | { |
| 185 | // Transform: |
| 186 | // do { |
| 187 | // body; |
| 188 | // } while (expr); |
| 189 | // into |
| 190 | // bool s0 = true; |
| 191 | // do { |
| 192 | // { body; } |
| 193 | // s0 = expr; |
| 194 | // } while (s0); |
| 195 | TIntermSequence tempInitSeq; |
Olli Etuaho | 3ec7568 | 2017-07-05 17:02:55 +0300 | [diff] [blame] | 196 | tempInitSeq.push_back(createTempInitDeclaration(CreateBoolNode(true))); |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 197 | insertStatementsInParentBlock(tempInitSeq); |
| 198 | |
| 199 | TIntermBlock *newBody = new TIntermBlock(); |
| 200 | if (node->getBody()) |
| 201 | { |
| 202 | newBody->getSequence()->push_back(node->getBody()); |
| 203 | } |
| 204 | newBody->getSequence()->push_back( |
| 205 | createTempAssignment(node->getCondition()->deepCopy())); |
| 206 | |
| 207 | // Can't use queueReplacement to replace old body, since it may have been nullptr. |
Olli Etuaho | 9676d1a | 2017-05-16 11:29:24 +0300 | [diff] [blame] | 208 | // It's safe to do the replacements in place here - the new body will still be |
| 209 | // traversed, but that won't create any problems. |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 210 | node->setBody(newBody); |
| 211 | node->setCondition(createTempSymbol(node->getCondition()->getType())); |
| 212 | } |
| 213 | else if (loopType == ELoopFor) |
| 214 | { |
| 215 | // Move the loop condition inside the loop. |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 216 | // Transform: |
| 217 | // for (init; expr; exprB) { body; } |
| 218 | // into |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 219 | // { |
| 220 | // init; |
| 221 | // bool s0 = expr; |
Corentin Wallez | 36fd100 | 2016-12-08 11:30:44 -0500 | [diff] [blame] | 222 | // while (s0) { |
| 223 | // { body; } |
| 224 | // exprB; |
| 225 | // s0 = expr; |
| 226 | // } |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 227 | // } |
Corentin Wallez | 36fd100 | 2016-12-08 11:30:44 -0500 | [diff] [blame] | 228 | TIntermBlock *loopScope = new TIntermBlock(); |
| 229 | TIntermSequence *loopScopeSequence = loopScope->getSequence(); |
| 230 | |
| 231 | // Insert "init;" |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 232 | if (node->getInit()) |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 233 | { |
Corentin Wallez | 36fd100 | 2016-12-08 11:30:44 -0500 | [diff] [blame] | 234 | loopScopeSequence->push_back(node->getInit()); |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 235 | } |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 236 | |
Corentin Wallez | 36fd100 | 2016-12-08 11:30:44 -0500 | [diff] [blame] | 237 | // Insert "bool s0 = expr;" if applicable, "bool s0 = true;" otherwise |
| 238 | TIntermTyped *conditionInitializer = nullptr; |
| 239 | if (node->getCondition()) |
| 240 | { |
| 241 | conditionInitializer = node->getCondition()->deepCopy(); |
| 242 | } |
| 243 | else |
| 244 | { |
Olli Etuaho | 3ec7568 | 2017-07-05 17:02:55 +0300 | [diff] [blame] | 245 | conditionInitializer = CreateBoolNode(true); |
Corentin Wallez | 36fd100 | 2016-12-08 11:30:44 -0500 | [diff] [blame] | 246 | } |
| 247 | loopScopeSequence->push_back(createTempInitDeclaration(conditionInitializer)); |
| 248 | |
| 249 | // Insert "{ body; }" in the while loop |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 250 | TIntermBlock *whileLoopBody = new TIntermBlock(); |
| 251 | if (node->getBody()) |
| 252 | { |
| 253 | whileLoopBody->getSequence()->push_back(node->getBody()); |
| 254 | } |
Corentin Wallez | 36fd100 | 2016-12-08 11:30:44 -0500 | [diff] [blame] | 255 | // Insert "exprB;" in the while loop |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 256 | if (node->getExpression()) |
| 257 | { |
| 258 | whileLoopBody->getSequence()->push_back(node->getExpression()); |
| 259 | } |
Corentin Wallez | 36fd100 | 2016-12-08 11:30:44 -0500 | [diff] [blame] | 260 | // Insert "s0 = expr;" in the while loop |
| 261 | if (node->getCondition()) |
| 262 | { |
| 263 | whileLoopBody->getSequence()->push_back( |
| 264 | createTempAssignment(node->getCondition()->deepCopy())); |
| 265 | } |
| 266 | |
| 267 | // Create "while(s0) { whileLoopBody }" |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 268 | TIntermLoop *whileLoop = new TIntermLoop( |
Corentin Wallez | 36fd100 | 2016-12-08 11:30:44 -0500 | [diff] [blame] | 269 | ELoopWhile, nullptr, createTempSymbol(conditionInitializer->getType()), nullptr, |
Corentin Wallez | 1212bca | 2016-11-23 13:44:05 -0500 | [diff] [blame] | 270 | whileLoopBody); |
| 271 | loopScope->getSequence()->push_back(whileLoop); |
Olli Etuaho | ea39a22 | 2017-07-06 12:47:59 +0300 | [diff] [blame] | 272 | queueReplacement(loopScope, OriginalNode::IS_DROPPED); |
Olli Etuaho | 9676d1a | 2017-05-16 11:29:24 +0300 | [diff] [blame] | 273 | |
| 274 | // After this the old body node will be traversed and loops inside it may be |
| 275 | // transformed. This is fine, since the old body node will still be in the AST after the |
| 276 | // transformation that's queued here, and transforming loops inside it doesn't need to |
| 277 | // know the exact post-transform path to it. |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 278 | } |
| 279 | } |
| 280 | |
Olli Etuaho | 9676d1a | 2017-05-16 11:29:24 +0300 | [diff] [blame] | 281 | mFoundLoopToChange = false; |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 282 | |
Olli Etuaho | 9676d1a | 2017-05-16 11:29:24 +0300 | [diff] [blame] | 283 | // We traverse the body of the loop even if the loop is transformed. |
| 284 | if (node->getBody()) |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 285 | node->getBody()->traverse(this); |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 286 | } |
| 287 | |
| 288 | } // namespace |
| 289 | |
| 290 | void SimplifyLoopConditions(TIntermNode *root, |
| 291 | unsigned int conditionsToSimplifyMask, |
Olli Etuaho | a5e693a | 2017-07-13 16:07:26 +0300 | [diff] [blame] | 292 | TSymbolTable *symbolTable, |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 293 | int shaderVersion) |
| 294 | { |
| 295 | SimplifyLoopConditionsTraverser traverser(conditionsToSimplifyMask, symbolTable, shaderVersion); |
Olli Etuaho | 9676d1a | 2017-05-16 11:29:24 +0300 | [diff] [blame] | 296 | root->traverse(&traverser); |
| 297 | traverser.updateTree(); |
Olli Etuaho | 3cbb27a | 2016-07-14 11:55:48 +0300 | [diff] [blame] | 298 | } |
Jamie Madill | 45bcc78 | 2016-11-07 13:58:48 -0500 | [diff] [blame] | 299 | |
| 300 | } // namespace sh |