diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-07-06 11:11:01 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-07-06 11:18:09 -0700 |
| commit | 03de737f0d18526b99b59a1810c7e290b66f4be2 (patch) | |
| tree | d0e75b2524d9b7e666de0ca9fa13f3a086bf02dc /source/slang/lower.cpp | |
| parent | 21a14cb4e0d578bc4f8a460016269a1199cac0da (diff) | |
Fix many warnings-as-errors issues.
The code should now compile cleanly with warnings as errors for VS2015 with `W3`.
Most of the changes had to do with propagating a real pointer-sized integer type through code that had been using `int`.
Diffstat (limited to 'source/slang/lower.cpp')
| -rw-r--r-- | source/slang/lower.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/source/slang/lower.cpp b/source/slang/lower.cpp index 674614cd3..e03fd878b 100644 --- a/source/slang/lower.cpp +++ b/source/slang/lower.cpp @@ -80,7 +80,7 @@ struct StructuralTransformStmtVisitor : StructuralTransformVisitorBase<V> , StmtVisitor<StructuralTransformStmtVisitor<V>, RefPtr<StatementSyntaxNode>> { - void transformFields(StatementSyntaxNode* result, StatementSyntaxNode* obj) + void transformFields(StatementSyntaxNode*, StatementSyntaxNode*) { } @@ -457,7 +457,7 @@ struct LoweringVisitor // StatementSyntaxNode* translateStmtRef( - StatementSyntaxNode* stmt) + StatementSyntaxNode*) { throw "unimplemented"; } @@ -666,13 +666,13 @@ struct LoweringVisitor } RefPtr<Substitutions> translateSubstitutions( - Substitutions* substitutions) + Substitutions* inSubstitutions) { - if (!substitutions) return nullptr; + if (!inSubstitutions) return nullptr; RefPtr<Substitutions> result = new Substitutions(); - result->genericDecl = translateDeclRef(substitutions->genericDecl).As<GenericDecl>(); - for (auto arg : substitutions->args) + result->genericDecl = translateDeclRef(inSubstitutions->genericDecl).As<GenericDecl>(); + for (auto arg : inSubstitutions->args) { result->args.Add(translateVal(arg)); } @@ -740,9 +740,8 @@ struct LoweringVisitor } else { - DeclVisitor::dispatch(declBase); + return DeclVisitor::dispatch(declBase); } - } RefPtr<Decl> lowerDecl( @@ -922,8 +921,8 @@ struct LoweringVisitor // // If this is a global variable (program scope), then add it // to the global scope. - RefPtr<ContainerDecl> parentDecl = decl->ParentDecl; - if (auto parentModuleDecl = parentDecl.As<ProgramSyntaxNode>()) + RefPtr<ContainerDecl> pp = decl->ParentDecl; + if (auto parentModuleDecl = pp.As<ProgramSyntaxNode>()) { addMember( translateDeclRef(parentModuleDecl), @@ -1138,10 +1137,6 @@ struct LoweringVisitor subscriptExpr->Position = varExpr->Position; subscriptExpr->BaseExpression = varExpr; - // TODO: we need to construct syntax for a loop to initialize - // the array here... - throw "unimplemented"; - // Note that we use the original `varLayout` that was passed in, // since that is the layout that will ultimately need to be // used on the array elements. @@ -1154,6 +1149,9 @@ struct LoweringVisitor varLayout, subscriptExpr); + // TODO: we need to construct syntax for a loop to initialize + // the array here... + throw "unimplemented"; } else if (auto declRefType = varType->As<DeclRefType>()) { |
