From f216b77752b9e4aea52882b2110ceb1cc64a2171 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 13 Sep 2022 13:11:48 -0700 Subject: Deduplicate AST type nodes and cache lookup operations. (#2397) * wip: dedup AST type nodes and cache lookup. * Fix. * Remove profiling. * Fixes. Co-authored-by: Yong He --- source/core/slang-array.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source/core/slang-array.h') diff --git a/source/core/slang-array.h b/source/core/slang-array.h index 2647e163f..8d22e1848 100644 --- a/source/core/slang-array.h +++ b/source/core/slang-array.h @@ -125,6 +125,23 @@ namespace Slang insertArray(rs, args...); return rs; } + + + template + void addToList(TList&) + { + } + template + void addToList(TList& list, T node) + { + list.add(node); + } + template + void addToList(TList& list, T node, TArgs ... args) + { + list.add(node); + addToList(list, args...); + } } #endif -- cgit v1.2.3