MCPcopy Create free account
hub / github.com/chipsalliance/Surelog / compileDataDeclaration

Method compileDataDeclaration

src/DesignCompile/CompileStmt.cpp:1127–1302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1125}
1126
1127VectorOfany* CompileHelper::compileDataDeclaration(
1128 DesignComponent* component, const FileContent* fC, NodeId nodeId,
1129 CompileDesign* compileDesign, Reduce reduce, UHDM::any* pstmt,
1130 ValuedComponentI* instance) {
1131 UHDM::Serializer& s = compileDesign->getSerializer();
1132 VectorOfany* results = nullptr;
1133 VObjectType type = fC->Type(nodeId);
1134 bool automatic_status = false;
1135 bool const_status = false;
1136 if (type == VObjectType::paLifetime_Automatic) {
1137 nodeId = fC->Sibling(nodeId);
1138 automatic_status = true;
1139 type = fC->Type(nodeId);
1140 }
1141 if (type == VObjectType::paLifetime_Static) {
1142 nodeId = fC->Sibling(nodeId);
1143 automatic_status = false;
1144 type = fC->Type(nodeId);
1145 }
1146 if (type == VObjectType::paConst_type) {
1147 nodeId = fC->Sibling(nodeId);
1148 const_status = true;
1149 type = fC->Type(nodeId);
1150 }
1151 switch (type) {
1152 case VObjectType::paAssertion_variable_declaration:
1153 case VObjectType::paVariable_declaration: {
1154 NodeId Data_type = fC->Child(nodeId);
1155 // typespec* ts = compileTypespec(component, fC, Data_type,
1156 // compileDesign);
1157 NodeId List_of_variable_decl_assignments = fC->Sibling(Data_type);
1158 if (fC->Type(List_of_variable_decl_assignments) ==
1159 VObjectType::paPacked_dimension) {
1160 List_of_variable_decl_assignments =
1161 fC->Sibling(List_of_variable_decl_assignments);
1162 }
1163 NodeId Variable_decl_assignment =
1164 fC->Child(List_of_variable_decl_assignments);
1165 VectorOfvariables* scovars = nullptr;
1166 if (scope* sco = any_cast<scope*>(pstmt)) {
1167 scovars = sco->Variables();
1168 if (scovars == nullptr) {
1169 scovars = s.MakeVariablesVec();
1170 sco->Variables(scovars);
1171 }
1172 }
1173 while (Variable_decl_assignment) {
1174 NodeId Var = Variable_decl_assignment;
1175 if (fC->Child(Var)) Var = fC->Child(Var);
1176 NodeId tmp = fC->Sibling(Var);
1177 std::vector<UHDM::range*>* unpackedDimensions = nullptr;
1178 if (fC->Type(tmp) != VObjectType::paExpression) {
1179 int32_t unpackedSize;
1180 unpackedDimensions =
1181 compileRanges(component, fC, tmp, compileDesign, reduce, nullptr,
1182 instance, unpackedSize, false);
1183 }
1184 while (tmp && (fC->Type(tmp) != VObjectType::paExpression)) {

Callers 6

collectObjects_Method · 0.45
collectObjects_Method · 0.45
collectModuleObjects_Method · 0.45
collectObjects_Method · 0.45

Calls 6

populateCoreMembersMethod · 0.80
TypeMethod · 0.45
SiblingMethod · 0.45
ChildMethod · 0.45
SymNameMethod · 0.45
ParentMethod · 0.45

Tested by

no test coverage detected