Skip to content

Commit cf5d3fe

Browse files
committed
[silgenpattern] Add some TODO. NFC.
1 parent 57f6a63 commit cf5d3fe

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lib/SILGen/SILGenPattern.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@
3535
using namespace swift;
3636
using namespace Lowering;
3737

38+
//===----------------------------------------------------------------------===//
39+
// Pattern Utilities
40+
//===----------------------------------------------------------------------===//
41+
42+
// TODO: These routines should probably be refactored into their own file since
43+
// they have nothing to do with the implementation of SILGenPattern
44+
// specifically.
45+
3846
/// Shallow-dump a pattern node one level deep for debug purposes.
3947
static void dumpPattern(const Pattern *p, llvm::raw_ostream &os) {
4048
if (!p) {
@@ -290,6 +298,10 @@ static Pattern *getSimilarSpecializingPattern(Pattern *p, Pattern *first) {
290298
llvm_unreachable("Unhandled PatternKind in switch.");
291299
}
292300

301+
//===----------------------------------------------------------------------===//
302+
// SILGenPattern Emission
303+
//===----------------------------------------------------------------------===//
304+
293305
namespace {
294306

295307
/// A row which we intend to specialize.
@@ -467,6 +479,10 @@ class PatternMatchEmission {
467479

468480
/// A handle to a row in a clause matrix. Does not own memory; use of the
469481
/// ClauseRow must be dominated by its originating ClauseMatrix.
482+
///
483+
/// TODO: This should be refactored into a more general formulation that uses a
484+
/// child template pattern to inject our logic. This will then allow us to
485+
/// inject "mock" objects in a unittest file.
470486
class ClauseRow {
471487
friend class ClauseMatrix;
472488

0 commit comments

Comments
 (0)