summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-decl.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-05-29 08:36:10 -0400
committerGitHub <noreply@github.com>2020-05-29 08:36:10 -0400
commitf3d70425fa339a0d8f39b920235c98280d250bbb (patch)
tree24923917e3ca43fdc1b3ca67ee589973c92a4b60 /source/slang/slang-check-decl.cpp
parent95597d77b131ee2c41c2eb4481844c315b2c82eb (diff)
Feature/ast syntax standard (#1360)
* Small improvements to documentation and code around DiagnosticSink * Made methods/functions in slang-syntax.h be lowerCamel Removed some commented out source (was placed elsewhere in code) * Making AST related methods and function lowerCamel. Made IsLeftValue -> isLeftValue.
Diffstat (limited to 'source/slang/slang-check-decl.cpp')
-rw-r--r--source/slang/slang-check-decl.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp
index b08baa42f..66a8ceaf8 100644
--- a/source/slang/slang-check-decl.cpp
+++ b/source/slang/slang-check-decl.cpp
@@ -322,7 +322,7 @@ namespace Slang
if (auto varDeclRef = declRef.as<VarDeclBase>())
{
QualType qualType;
- qualType.type = GetType(astBuilder, varDeclRef);
+ qualType.type = getType(astBuilder, varDeclRef);
bool isLValue = true;
if(varDeclRef.getDecl()->findModifier<ConstModifier>())
@@ -362,14 +362,14 @@ namespace Slang
}
}
- qualType.IsLeftValue = isLValue;
+ qualType.isLeftValue = isLValue;
return qualType;
}
else if( auto enumCaseDeclRef = declRef.as<EnumCaseDecl>() )
{
QualType qualType;
qualType.type = getType(astBuilder, enumCaseDeclRef);
- qualType.IsLeftValue = false;
+ qualType.isLeftValue = false;
return qualType;
}
else if (auto typeAliasDeclRef = declRef.as<TypeDefDecl>())
@@ -406,7 +406,7 @@ namespace Slang
// When we access a constraint or an inheritance decl (as a member),
// we are conceptually performing a "cast" to the given super-type,
// with the declaration showing that such a cast is legal.
- auto type = GetSup(astBuilder, constraintDeclRef);
+ auto type = getSup(astBuilder, constraintDeclRef);
return QualType(type);
}
else if( auto namespaceDeclRef = declRef.as<NamespaceDeclBase>())
@@ -428,7 +428,7 @@ namespace Slang
// TODO: This code could break if we ever go down this path with
// an identifier that doesn't have a name.
//
- sink->diagnose(loc, Diagnostics::undefinedIdentifier2, declRef.GetName());
+ sink->diagnose(loc, Diagnostics::undefinedIdentifier2, declRef.getName());
}
return QualType(astBuilder->getErrorType());
}
@@ -1285,7 +1285,7 @@ namespace Slang
for (auto requiredConstraintDeclRef : getMembersOfType<TypeConstraintDecl>(requiredAssociatedTypeDeclRef))
{
// Grab the type we expect to conform to from the constraint.
- auto requiredSuperType = GetSup(m_astBuilder, requiredConstraintDeclRef);
+ auto requiredSuperType = getSup(m_astBuilder, requiredConstraintDeclRef);
// Perform a search for a witness to the subtype relationship.
auto witness = tryGetSubtypeWitness(satisfyingType, requiredSuperType);
@@ -1478,7 +1478,7 @@ namespace Slang
// since only same-name members will be able to
// satisfy the requirement.
//
- Name* name = requiredMemberDeclRef.GetName();
+ Name* name = requiredMemberDeclRef.getName();
// We start by looking up members of the same
// name, on the type that is claiming to conform.
@@ -1714,7 +1714,7 @@ namespace Slang
void SemanticsVisitor::checkExtensionConformance(ExtensionDecl* decl)
{
auto declRef = createDefaultSubstitutionsIfNeeded(m_astBuilder, makeDeclRef(decl)).as<ExtensionDecl>();
- auto targetType = GetTargetType(m_astBuilder, declRef);
+ auto targetType = getTargetType(m_astBuilder, declRef);
for (auto inheritanceDecl : decl->getMembersOfType<InheritanceDecl>())
{
@@ -2297,12 +2297,12 @@ namespace Slang
// and `sup` types are pairwise equivalent.
//
auto leftSub = leftConstraint->sub;
- auto rightSub = GetSub(m_astBuilder, rightConstraint);
+ auto rightSub = getSub(m_astBuilder, rightConstraint);
if(!leftSub->equals(rightSub))
return false;
auto leftSup = leftConstraint->sup;
- auto rightSup = GetSup(m_astBuilder, rightConstraint);
+ auto rightSup = getSup(m_astBuilder, rightConstraint);
if(!leftSup->equals(rightSup))
return false;
}
@@ -2320,8 +2320,8 @@ namespace Slang
{
// TODO(tfoley): This copies the parameter array, which is bad for performance.
- auto fstParams = GetParameters(fst).toArray();
- auto sndParams = GetParameters(snd).toArray();
+ auto fstParams = getParameters(fst).toArray();
+ auto sndParams = getParameters(snd).toArray();
// If the functions have different numbers of parameters, then
// their signatures trivially don't match.
@@ -2336,7 +2336,7 @@ namespace Slang
auto sndParam = sndParams[ii];
// If a given parameter type doesn't match, then signatures don't match
- if (!GetType(m_astBuilder, fstParam)->equals(GetType(m_astBuilder, sndParam)))
+ if (!getType(m_astBuilder, fstParam)->equals(getType(m_astBuilder, sndParam)))
return false;
// If one parameter is `out` and the other isn't, then they don't match
@@ -2543,8 +2543,8 @@ namespace Slang
// consider result types earlier, as part of the signature
// matching step.
//
- auto resultType = GetResultType(m_astBuilder, newDeclRef);
- auto prevResultType = GetResultType(m_astBuilder, oldDeclRef);
+ auto resultType = getResultType(m_astBuilder, newDeclRef);
+ auto prevResultType = getResultType(m_astBuilder, oldDeclRef);
if (!resultType->equals(prevResultType))
{
// Bad redeclaration
@@ -2919,7 +2919,7 @@ namespace Slang
// sooner or later.
//
ensureDecl(extDeclRef, DeclCheckState::CanUseExtensionTargetType);
- auto targetType = GetTargetType(m_astBuilder, extDeclRef);
+ auto targetType = getTargetType(m_astBuilder, extDeclRef);
return calcThisType(targetType);
}
else
@@ -3064,7 +3064,7 @@ namespace Slang
}
// Now extract the target type from our (possibly specialized) extension decl-ref.
- RefPtr<Type> targetType = GetTargetType(m_astBuilder, extDeclRef);
+ RefPtr<Type> targetType = getTargetType(m_astBuilder, extDeclRef);
// As a bit of a kludge here, if the target type of the extension is
// an interface, and the `type` we are trying to match up has a this-type