diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-05-29 08:36:10 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-29 08:36:10 -0400 |
| commit | f3d70425fa339a0d8f39b920235c98280d250bbb (patch) | |
| tree | 24923917e3ca43fdc1b3ca67ee589973c92a4b60 /source/slang/slang-emit-cpp.cpp | |
| parent | 95597d77b131ee2c41c2eb4481844c315b2c82eb (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-emit-cpp.cpp')
| -rw-r--r-- | source/slang/slang-emit-cpp.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/source/slang/slang-emit-cpp.cpp b/source/slang/slang-emit-cpp.cpp index 716a8f046..bc82475f4 100644 --- a/source/slang/slang-emit-cpp.cpp +++ b/source/slang/slang-emit-cpp.cpp @@ -219,7 +219,7 @@ void CPPSourceEmitter::emitTypeDefinition(IRType* inType) case kIROp_VectorType: { auto vecType = static_cast<IRVectorType*>(type); - int count = int(GetIntVal(vecType->getElementCount())); + int count = int(getIntVal(vecType->getElementCount())); SLANG_ASSERT(count > 0 && count < 4); @@ -251,8 +251,8 @@ void CPPSourceEmitter::emitTypeDefinition(IRType* inType) { auto matType = static_cast<IRMatrixType*>(type); - const auto rowCount = int(GetIntVal(matType->getRowCount())); - const auto colCount = int(GetIntVal(matType->getColumnCount())); + const auto rowCount = int(getIntVal(matType->getRowCount())); + const auto colCount = int(getIntVal(matType->getColumnCount())); IRType* vecType = m_typeSet.addVectorType(matType->getElementType(), colCount); @@ -420,7 +420,7 @@ SlangResult CPPSourceEmitter::calcTypeName(IRType* type, CodeGenTarget target, S case kIROp_VectorType: { auto vecType = static_cast<IRVectorType*>(type); - auto vecCount = int(GetIntVal(vecType->getElementCount())); + auto vecCount = int(getIntVal(vecType->getElementCount())); auto elemType = vecType->getElementType(); if (target == CodeGenTarget::CPPSource || target == CodeGenTarget::CUDASource) @@ -446,8 +446,8 @@ SlangResult CPPSourceEmitter::calcTypeName(IRType* type, CodeGenTarget target, S auto matType = static_cast<IRMatrixType*>(type); auto elementType = matType->getElementType(); - const auto rowCount = int(GetIntVal(matType->getRowCount())); - const auto colCount = int(GetIntVal(matType->getColumnCount())); + const auto rowCount = int(getIntVal(matType->getRowCount())); + const auto colCount = int(getIntVal(matType->getColumnCount())); if (target == CodeGenTarget::CPPSource || target == CodeGenTarget::CUDASource) { @@ -471,7 +471,7 @@ SlangResult CPPSourceEmitter::calcTypeName(IRType* type, CodeGenTarget target, S { auto arrayType = static_cast<IRArrayType*>(type); auto elementType = arrayType->getElementType(); - int elementCount = int(GetIntVal(arrayType->getElementCount())); + int elementCount = int(getIntVal(arrayType->getElementCount())); out << "FixedArray<"; SLANG_RETURN_ON_FAIL(calcTypeName(elementType, target, out)); @@ -606,14 +606,14 @@ static IRBasicType* _getElementType(IRType* type) case kIROp_VectorType: { auto vecType = static_cast<IRVectorType*>(type); - const int elemCount = int(GetIntVal(vecType->getElementCount())); + const int elemCount = int(getIntVal(vecType->getElementCount())); return (!vecSwap) ? TypeDimension{1, elemCount} : TypeDimension{ elemCount, 1}; } case kIROp_MatrixType: { auto matType = static_cast<IRMatrixType*>(type); - const int colCount = int(GetIntVal(matType->getColumnCount())); - const int rowCount = int(GetIntVal(matType->getRowCount())); + const int colCount = int(getIntVal(matType->getColumnCount())); + const int rowCount = int(getIntVal(matType->getRowCount())); return TypeDimension{rowCount, colCount}; } default: return TypeDimension{1, 1}; @@ -942,7 +942,7 @@ void CPPSourceEmitter::_emitGetAtDefinition(const UnownedStringSlice& funcName, if (auto vectorType = as<IRVectorType>(srcType)) { - int vecSize = int(GetIntVal(vectorType->getElementCount())); + int vecSize = int(getIntVal(vectorType->getElementCount())); writer->emit("assert(b >= 0 && b < "); writer->emit(vecSize); @@ -952,8 +952,8 @@ void CPPSourceEmitter::_emitGetAtDefinition(const UnownedStringSlice& funcName, } else if (auto matrixType = as<IRMatrixType>(srcType)) { - //int colCount = int(GetIntVal(matrixType->getColumnCount())); - int rowCount = int(GetIntVal(matrixType->getRowCount())); + //int colCount = int(getIntVal(matrixType->getColumnCount())); + int rowCount = int(getIntVal(matrixType->getRowCount())); writer->emit("assert(b >= 0 && b < "); writer->emit(rowCount); @@ -1083,7 +1083,7 @@ void CPPSourceEmitter::_emitInitDefinition(const UnownedStringSlice& funcName, c if (IRVectorType* vecType = as<IRVectorType>(retType)) { - Index elementCount = Index(GetIntVal(vecType->getElementCount())); + Index elementCount = Index(getIntVal(vecType->getElementCount())); Index paramIndex = 0; Index paramSubIndex = 0; @@ -1105,7 +1105,7 @@ void CPPSourceEmitter::_emitInitDefinition(const UnownedStringSlice& funcName, c if (IRVectorType* paramVecType = as<IRVectorType>(paramType)) { - Index paramElementCount = Index(GetIntVal(paramVecType->getElementCount())); + Index paramElementCount = Index(getIntVal(paramVecType->getElementCount())); writer->emitChar('a' + char(paramIndex)); writer->emit("."); |
