summaryrefslogtreecommitdiffstats
path: root/source/slang/lookup.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-02-04 12:11:18 -0500
committerTim Foley <tfoleyNV@users.noreply.github.com>2019-02-04 09:11:18 -0800
commit0d206996cd68b9f08ae1b4d9da6f16293984302c (patch)
tree023fe84547955b1356a770f407433f45e1fb8048 /source/slang/lookup.cpp
parent3726194fbe3da234eb30b6371e5b4ab1ea388f93 (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/lookup.cpp')
-rw-r--r--source/slang/lookup.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/slang/lookup.cpp b/source/slang/lookup.cpp
index 0ded328c7..2c822eb15 100644
--- a/source/slang/lookup.cpp
+++ b/source/slang/lookup.cpp
@@ -45,7 +45,7 @@ void buildMemberDictionary(ContainerDecl* decl)
decl->transparentMembers.Clear();
// are we a generic?
- GenericDecl* genericDecl = dynamic_cast<GenericDecl*>(decl);
+ GenericDecl* genericDecl = as<GenericDecl>(decl);
for (auto m : decl->Members)
{
@@ -84,21 +84,21 @@ void buildMemberDictionary(ContainerDecl* decl)
bool DeclPassesLookupMask(Decl* decl, LookupMask mask)
{
// type declarations
- if(auto aggTypeDecl = dynamic_cast<AggTypeDecl*>(decl))
+ if(auto aggTypeDecl = as<AggTypeDecl>(decl))
{
return int(mask) & int(LookupMask::type);
}
- else if(auto simpleTypeDecl = dynamic_cast<SimpleTypeDecl*>(decl))
+ else if(auto simpleTypeDecl = as<SimpleTypeDecl>(decl))
{
return int(mask) & int(LookupMask::type);
}
// function declarations
- else if(auto funcDecl = dynamic_cast<FunctionDeclBase*>(decl))
+ else if(auto funcDecl = as<FunctionDeclBase>(decl))
{
return (int(mask) & int(LookupMask::Function)) != 0;
}
// attribute declaration
- else if( auto attrDecl = dynamic_cast<AttributeDecl*>(decl) )
+ else if( auto attrDecl = as<AttributeDecl>(decl) )
{
return (int(mask) & int(LookupMask::Attribute)) != 0;
}