Logo Search packages:      
Sourcecode: fauhdlc version File versions

void ast::GenCode::addUnconstraintParams ( const ValDeclaration node  )  [private]

add data elements for unconstraint array bounds to the container.

Parameters:
node unconstraint ValDeclaration

Definition at line 2437 of file GenCode.cpp.

References intermediate::CodeContainer::addData(), container, ast::ResolveTypes::findBaseType(), ast::SymbolDeclaration::getICName(), intermediate::ImmediateOperand::getOne(), intermediate::ImmediateOperand::getZero(), ast::UnconstrainedArrayType::numIndices, ast::ValDeclaration::subtypeIndic, and util::MiscUtil::toString().

Referenced by processValDecl().

{
      const UnconstrainedArrayType *ua = 
            dynamic_cast<const UnconstrainedArrayType *>(
                  ResolveTypes::findBaseType(node.subtypeIndic));
      assert(ua != NULL);

      std::string prefix = node.getICName();

      for (size_t dim = 0; dim < ua->numIndices; dim++) {
            // make a NULL range the default
            TypeElement *ltypeE = new TypeElement("universal_integer",
                                    ImmediateOperand::getOne());
            TypeElement *utypeE = new TypeElement("universal_integer",
                                    ImmediateOperand::getZero());
            std::string lname = prefix + "_lb_" 
                          + util::MiscUtil::toString(dim);
            std::string uname = prefix + "_ub_" 
                          + util::MiscUtil::toString(dim);

            Data *ld = new Data(lname, STORAGE_TYPE_VARIABLE, ltypeE);
            Data *ud = new Data(uname, STORAGE_TYPE_VARIABLE, utypeE);
            this->container->addData(ld);
            this->container->addData(ud);
      }
}


Generated by  Doxygen 1.6.0   Back to index