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

Method bindTypeDef_

src/DesignCompile/ElaborationStep.cpp:774–801  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

772}
773
774const DataType* ElaborationStep::bindTypeDef_(
775 TypeDef* typd, const DesignComponent* parent,
776 ErrorDefinition::ErrorType errtype) {
777 Compiler* compiler = m_compileDesign->getCompiler();
778 SymbolTable* symbols = compiler->getSymbolTable();
779 NodeId defNode = typd->getDefinitionNode();
780 const FileContent* fC = typd->getFileContent();
781 VObjectType defType = fC->Type(defNode);
782 std::string objName;
783 if (defType == VObjectType::slStringConst) {
784 objName = fC->SymName(defNode);
785 } else if (defType == VObjectType::paClass_scope) {
786 NodeId class_type = fC->Child(defNode);
787 NodeId nameId = fC->Child(class_type);
788 objName.assign(fC->SymName(nameId))
789 .append("::")
790 .append(fC->SymName(fC->Sibling(defNode)));
791 } else {
792 objName = "NOT_A_VALID_TYPE_NAME";
793 symbols->registerSymbol(objName);
794 }
795
796 const DataType* result = bindDataType_(objName, fC, defNode, parent, errtype);
797 if (result != typd)
798 return result;
799 else
800 return nullptr;
801}
802
803const DataType* ElaborationStep::bindDataType_(
804 std::string_view type_name, const FileContent* fC, NodeId id,

Callers

nothing calls this directly

Calls 10

getDefinitionNodeMethod · 0.80
getCompilerMethod · 0.45
getSymbolTableMethod · 0.45
getFileContentMethod · 0.45
TypeMethod · 0.45
SymNameMethod · 0.45
ChildMethod · 0.45
appendMethod · 0.45
SiblingMethod · 0.45
registerSymbolMethod · 0.45

Tested by

no test coverage detected