summaryrefslogtreecommitdiffstats
path: root/source/slang/mangle.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoley@nvidia.com>2017-11-07 08:31:06 -0800
committerTim Foley <tfoley@nvidia.com>2017-11-07 10:40:04 -0800
commit9640df03814593d2f4b34c36bbec6756b1ed7fba (patch)
tree3a155f58f7afe94d5b5fba3c9f6bfe6d0db32110 /source/slang/mangle.cpp
parent19c7c371aaef9dc537f6a6ed8cbfd77355f219ff (diff)
Handle "ThisType" subsitutions when specialization generics in the IR
The original code is handling the issue where a call site might be specializing a generic function, so it has a `DeclRef` that represents what it wants to specialize, but the callee is actually a different overload of the same generic function (e.g., a target-specific overload) and so we need to construct a set of substitutions that are equivalent (same arguments), but point to different `GenericDecl`s. That code was making some bad assumptions, though: 1. It assumed that the substitutions list would always start with a generic substitution (no longer true with `ThisTypeSubstitution`. 2. It assumed that only the top-most substitution would need to be translated. This assumption is probably safe for now, but it could break down if we ever introduced an ability for a type to be re-opened to introduce new (target-specific) overloads of its members. The new approach goes ahead and does a deep copy of the substitition list (but a shallow copy of the arguments), and only copies the generic substititions for now.
Diffstat (limited to 'source/slang/mangle.cpp')
0 files changed, 0 insertions, 0 deletions