summaryrefslogtreecommitdiff
path: root/source/slang/ir-legalize-types.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-01-31 10:14:26 -0500
committerGitHub <noreply@github.com>2019-01-31 10:14:26 -0500
commit11c547d1e94fa620f527c3590174e6e25ab21883 (patch)
tree008ab5b447af351d2a30fb86c768c9e8e8d8030e /source/slang/ir-legalize-types.cpp
parent4db0aba1edc5fd55b91457481bae119ef66dde89 (diff)
Feature/as refactor (#817)
* Made dynamicCast a free function. * Replace As with as or dynamicCast depending on if it is a type. * Fix problem with using non smart pointer cast. * Removed legacy asXXXX methods. * Remove As from Type. * Removed As from Qual type -> made coercable into Type*, such that can just use free 'as'. * Remove left over QualType::As() impl. * Remove As from SyntaxNodeBase. * Made as for instructions implemented by dynamicCast. * Replace As on DeclRef. Use the global as<> to do the cast. * Add const safe versions of dynamicCast and as for IRInst
Diffstat (limited to 'source/slang/ir-legalize-types.cpp')
-rw-r--r--source/slang/ir-legalize-types.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/slang/ir-legalize-types.cpp b/source/slang/ir-legalize-types.cpp
index 141799a06..eb22da967 100644
--- a/source/slang/ir-legalize-types.cpp
+++ b/source/slang/ir-legalize-types.cpp
@@ -71,7 +71,7 @@ LegalVal LegalVal::implicitDeref(LegalVal const& val)
LegalVal LegalVal::getImplicitDeref()
{
SLANG_ASSERT(flavor == Flavor::implicitDeref);
- return obj.As<ImplicitDerefVal>()->val;
+ return as<ImplicitDerefVal>(obj)->val;
}
@@ -1017,7 +1017,7 @@ static LegalVal legalizeInst(
RefPtr<VarLayout> findVarLayout(IRInst* value)
{
if (auto layoutDecoration = value->findDecoration<IRLayoutDecoration>())
- return layoutDecoration->getLayout()->dynamicCast<VarLayout>();
+ return dynamicCast<VarLayout>(layoutDecoration->getLayout());
return nullptr;
}