summaryrefslogtreecommitdiffstats
path: root/source/slangc/main.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoley@nvidia.com>2017-06-15 16:35:10 -0700
committerTim Foley <tfoley@nvidia.com>2017-06-15 16:35:10 -0700
commite0389f5a1f32cb611e5a595a5974ee1d5c15f43d (patch)
tree7bee1ed3a1f235ac97de9f8d9893f2994015c5c3 /source/slangc/main.cpp
parent04d43cd71f081f1b8d2f0fd803a47cb6342e4fcd (diff)
Replace `DeclRef` approach
For context: a `DeclRef` is supposed to capture both a pointer to a particualr declaration, and also any information needed to specialize that declaration for a context (e.g., generic parameter substitutions). The existing approach had a hiearchy of specialized decl-ref types that mirrored the AST hierarchy, but that led to a lot of boilerplate where you had to recapitulate the exact same hierarchy. The new appraoch basically treats `DeclRef<T>` as a sort of "smart pointer" in that it wraps a pointer to a `T` (the declaration), plus a side field for the specialization info, and then allows it to be cast as needed to other types (where the pointer cast would be allowed), while carrying along the side info. To enable this, all the things that used to be member functions of declaration-reference types are now free functions that take a `DeclRef<T>` for some specific `T` as a parameter.
Diffstat (limited to 'source/slangc/main.cpp')
0 files changed, 0 insertions, 0 deletions