diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-07-07 12:31:38 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-07-07 12:37:15 -0700 |
| commit | c0bcb9c358e22a5c61c3efe77a14a368632bac70 (patch) | |
| tree | ed4adfdd34793f2656b7010f86a18c99f9eeb7cb /source/slang/syntax.h | |
| parent | 6da1782f34e8022774dce8d253bc5c3ab9b496cc (diff) | |
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)
Diffstat (limited to 'source/slang/syntax.h')
| -rw-r--r-- | source/slang/syntax.h | 5 |
1 files changed, 5 insertions, 0 deletions
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; |
