From c0bcb9c358e22a5c61c3efe77a14a368632bac70 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Fri, 7 Jul 2017 12:31:38 -0700 Subject: Overhaul emit logic to use visitor abstraction - This is in preparation for splitting out HLSL vs. GLSL emit as different cases. - Along the way, I added more cases to the visitor implementation, to handle visitors with arguments - This is getting a bit busy, though, and we might be reaching the breaking point where a more general bit of meta-magic is needed to clean things up (either going further down the ugly template route, or plugging in a more real code generation strategy) --- source/slang/syntax.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/slang/syntax.h') diff --git a/source/slang/syntax.h b/source/slang/syntax.h index 4329f6cbd..1704c1224 100644 --- a/source/slang/syntax.h +++ b/source/slang/syntax.h @@ -671,6 +671,11 @@ namespace Slang bool isValid() const { return item.declRef.getDecl() != nullptr; } bool isOverloaded() const { return items.Count() > 1; } + + String const& getName() const + { + return items.Count() > 1 ? items[0].declRef.GetName() : item.declRef.GetName(); + } }; struct SemanticsVisitor; -- cgit v1.2.3