diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-02-04 12:11:18 -0500 |
|---|---|---|
| committer | Tim Foley <tfoleyNV@users.noreply.github.com> | 2019-02-04 09:11:18 -0800 |
| commit | 0d206996cd68b9f08ae1b4d9da6f16293984302c (patch) | |
| tree | 023fe84547955b1356a770f407433f45e1fb8048 /source/slang/ir-union.cpp | |
| parent | 3726194fbe3da234eb30b6371e5b4ab1ea388f93 (diff) | |
Feature/casting tidyup (#822)
* Use 'is' over 'as' where appropriate.
* dynamic_cast -> dynamicCast
* Replace 'dynamicCast' with 'as' where has no change in behavior/ambiguity.
* Replace dynamicCast with as where doesn't change behavior/non ambiguous.
Diffstat (limited to 'source/slang/ir-union.cpp')
| -rw-r--r-- | source/slang/ir-union.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/slang/ir-union.cpp b/source/slang/ir-union.cpp index c50d669e1..91e60c5bf 100644 --- a/source/slang/ir-union.cpp +++ b/source/slang/ir-union.cpp @@ -366,7 +366,7 @@ struct DesugarUnionTypesContext // there to be complete type layout information for the // types involved. // - auto structTypeLayout = dynamic_cast<StructTypeLayout*>(payloadTypeLayout); + auto structTypeLayout = as<StructTypeLayout>(payloadTypeLayout); SLANG_ASSERT(structTypeLayout); // We are going to emit code to extract each of the fields @@ -665,14 +665,14 @@ struct DesugarUnionTypesContext info->replacementInst = structType; // We require/expect the earlier code generation steps to have - // assocaited a layout with every tagged union that appears in + // associated a layout with every tagged union that appears in // the code. // auto layoutDecoration = type->findDecoration<IRLayoutDecoration>(); SLANG_ASSERT(layoutDecoration); auto layout = layoutDecoration->getLayout(); SLANG_ASSERT(layout); - auto taggedUnionTypeLayout = dynamic_cast<TaggedUnionTypeLayout*>(layout); + auto taggedUnionTypeLayout = as<TaggedUnionTypeLayout>(layout); SLANG_ASSERT(taggedUnionTypeLayout); info->taggedUnionTypeLayout = taggedUnionTypeLayout; |
